Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Verified working with older feed

Mike McGann085dc35a0094
diff --git a/bin/eventsGeoRssParser.py b/bin/eventsGeoRssParser.py
index 1e09400f1..0340a69d8 100755
--- a/bin/eventsGeoRssParser.py
+++ b/bin/eventsGeoRssParser.py
@@ -29,7 +29,7 @@ if options.development:
# Log configuration assume working from this directory
os.chdir(baseDir)
confDir = 'etc/config'
- libDir = 'src/var/lib/worldview'
+ libDir = 'src/var'
else:
confDir = '/etc/worldview'
libDir = '/var/lib/worldview'
@@ -139,6 +139,8 @@ def download(url, fileName=None):
# @return - a JSON description of the GeoRss entry
def processEntry(entry):
+ title = entry["title"]
+
# check satellite/instrument - if not MODIS, skip
if not any("tags" in n for n in entry):
debugLog.debug('skipping because no tags')
@@ -146,7 +148,7 @@ def processEntry(entry):
tags = entry["tags"]
if len(tags) < 2:
- debugLog.debug('skipping because too few tags')
+ debugLog.debug('skipping because too few tags: %s' % title)
return None
parts = tags[1].term.split("/")
@@ -295,8 +297,11 @@ def main():
obj = processEntry(e)
if obj:
if not obj["title"] in recent_titles:
+ debugLog.debug("selected: %s" % obj["title"])
data.append(obj)
num = num + 1
+ else:
+ debugLog.debug("already seen: %s" % obj["title"])
outfile.seek(0)
if len(data) < 100:
diff --git a/etc/config/events_log.conf b/etc/config/events_log.conf
index 24b804e7a..49b4e16b3 100644
--- a/etc/config/events_log.conf
+++ b/etc/config/events_log.conf
@@ -33,19 +33,19 @@ propagate=0
class=FileHandler
level=DEBUG
formatter=basicFormatter
-args=('src/var/log/worldview/events_access.log','a+')
+args=('src/var/events_access.log','a+')
[handler_error]
class=FileHandler
level=DEBUG
formatter=basicFormatter
-args=('src/var/log/worldview/events_errors.log', 'a+')
+args=('src/var/events_errors.log', 'a+')
[handler_debug]
class=FileHandler
level=DEBUG
formatter=basicFormatter
-args=('src/var/log/worldview/events_debug.log', 'a+')
+args=('src/var/events_messages.log', 'a+')
[formatter_basicFormatter]
format=%(asctime)s %(message)s
diff --git a/etc/deploy/events_log.conf b/etc/deploy/events_log.conf
index 94ce12225..dc263f31d 100644
--- a/etc/deploy/events_log.conf
+++ b/etc/deploy/events_log.conf
@@ -45,7 +45,7 @@ args=('/var/log/worldview/events_errors.log', 'a+')
class=FileHandler
level=DEBUG
formatter=basicFormatter
-args=('/var/log/worldview/events_debug.log', 'a+')
+args=('/var/log/worldview/events_messages.log', 'a+')
[formatter_basicFormatter]
format=%(asctime)s %(message)s
diff --git a/src/mock/eo_feed.2013-04-12.rss b/src/mock/eo_feed.rss-20130412
similarity index 95%
rename from src/mock/eo_feed.2013-04-12.rss
rename to src/mock/eo_feed.rss-20130412
index 66b36bd86..0fb903a68 100644
--- a/src/mock/eo_feed.2013-04-12.rss
+++ b/src/mock/eo_feed.rss-20130412
@@ -28,7 +28,7 @@
<title>Volcanic Quartet </title>
<link>http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80899&amp;src=nhrss</link>
<category>Volcanoes and Earthquakes</category>
-
+ <category domain="http://visibleearth.nasa.gov/view_cat.php?scheme=SENSOR">Terra/MODIS</category>
<media:thumbnail url="http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80899/shiveluch_tmo_2013100_tn.jpg"></media:thumbnail>
<description>Four of the volcanoes erupting on Russia’s Kamchatka Peninsula are visible in one satellite image.</description>
<content:encoded><![CDATA[
@@ -43,7 +43,6 @@
<title>Smoldering Shiveluch</title>
<link>http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80890&amp;src=nhrss</link>
<category>Volcanoes and Earthquakes</category>
- <category domain="http://visibleearth.nasa.gov/view_cat.php?scheme=SENSOR">Terra/MODIS</category>
<media:thumbnail url="http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80890/shiveluch_ali_2013099_tn.jpg"></media:thumbnail>
<description>Volcanic vapors above the Russian peak’s lava dome indicate continuing growth.</description>
<content:encoded><![CDATA[
@@ -58,6 +57,7 @@
<title>Best and Worst Time to Start a Fire </title>
<link>http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80882&amp;src=nhrss</link>
<category>Fires</category>
+ <category domain="http://visibleearth.nasa.gov/view_cat.php?scheme=SENSOR">Terra/MODIS</category>
<media:thumbnail url="http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80882/Australia_amo_2013100_tn.jpg"></media:thumbnail>
<description>Land managers in the Kimberley region of Australia set low-intensity, controlled fires early in the dry season to protect from destructive blazes later in the year. </description>
<content:encoded><![CDATA[
@@ -72,6 +72,7 @@
<title>Dust over the Arabian Sea</title>
<link>http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80878&amp;src=nhrss</link>
<category>Dust, Smoke, and Haze</category>
+ <category domain="http://visibleearth.nasa.gov/view_cat.php?scheme=SENSOR">Terra/MODIS</category>
<media:thumbnail url="http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80878/arabiansea_tmo_2013097_tn.jpg"></media:thumbnail>
<description>Acquired April 7, 2013, this image shows a dust plume spanning hundreds of kilometers along the southern Arabian Peninsula.</description>
<content:encoded><![CDATA[
@@ -100,6 +101,7 @@
<title>Tropical Storm Imelda</title>
<link>http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80870&amp;src=nhrss</link>
<category>Severe Storms</category>
+ <category domain="http://visibleearth.nasa.gov/view_cat.php?scheme=SENSOR">Terra/MODIS</category>
<media:thumbnail url="http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80870/imelda_tmo_2013098_tn.jpg"></media:thumbnail>
<description>Acquired April 8, 2013, this image shows Tropical Storm Imelda over the Indian Ocean.</description>
<content:encoded><![CDATA[
@@ -114,6 +116,7 @@
<title>Dust Plumes over the Mediterranean Sea</title>
<link>http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80865&amp;src=nhrss</link>
<category>Dust, Smoke, and Haze</category>
+ <category domain="http://visibleearth.nasa.gov/view_cat.php?scheme=SENSOR">Terra/MODIS</category>
<media:thumbnail url="http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80865/emedsea_amo_2013098_tn.jpg"></media:thumbnail>
<description>Acquired April 7 and 8, 2013, these images show dust plumes over the Mediterranean Sea.</description>
<content:encoded><![CDATA[
diff --git a/src/mock/events_data.json-20130412 b/src/mock/events_data.json-20130412
new file mode 100644
index 000000000..aa30bbfd4
--- /dev/null
+++ b/src/mock/events_data.json-20130412
@@ -0,0 +1 @@
+[{"category": "Volcanoes and Earthquakes", "satellite": "Terra", "north": "57.448624", "description": "Four of the volcanoes erupting on Russia\u2019s Kamchatka Peninsula are visible in one satellite image.", "keyword": "", "title": "Volcanic Quartet", "west": "159.335960", "instrument": "MODIS", "link": "http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80899&src=nhrss", "date": "2013-04-10", "east": "162.463956", "thumbnail": "http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80899/shiveluch_tmo_2013100_tn.jpg", "south": "54.750662"}, {"category": "Dust, Smoke, and Haze", "satellite": "Terra", "north": "22.946124", "description": "Acquired April 7, 2013, this image shows a dust plume spanning hundreds of kilometers along the southern Arabian Peninsula.", "keyword": "", "title": "Dust over the Arabian Sea", "west": "48.303096", "instrument": "MODIS", "link": "http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80878&src=nhrss", "date": "2013-04-07", "east": "61.696829", "thumbnail": "http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80878/arabiansea_tmo_2013097_tn.jpg", "south": "13.053598"}, {"category": "Severe Storms", "satellite": "Terra", "north": "-4.031176", "description": "Acquired April 8, 2013, this image shows Tropical Storm Imelda over the Indian Ocean.", "keyword": "", "title": "Tropical Storm Imelda", "west": "55.874728", "instrument": "MODIS", "link": "http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80870&src=nhrss", "date": "2013-04-08", "east": "73.925332", "thumbnail": "http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80870/imelda_tmo_2013098_tn.jpg", "south": "-17.970645"}, {"satellite": "Terra", "north": "37.497124", "description": "Acquired April 7 and 8, 2013, these images show dust plumes over the Mediterranean Sea.", "link": "http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=80865&src=nhrss", "date": "2013-04-08", "category": "Dust, Smoke, and Haze", "keyword": "", "title": "Dust Plumes over the Mediterranean Sea", "west": "29.385772", "instrument": "MODIS", "east": "37.614291", "thumbnail": "http://eoimages.gsfc.nasa.gov/images/imagerecords/80000/80865/emedsea_amo_2013098_tn.jpg", "south": "28.503918"}]
\ No newline at end of file
diff --git a/src/var/.gitignore b/src/var/.gitignore
index 2dbb99847..d6b7ef32c 100644
--- a/src/var/.gitignore
+++ b/src/var/.gitignore
@@ -1,3 +1,2 @@
*
-!log
!.gitignore
diff --git a/src/var/log/worldview/.gitignore b/src/var/log/worldview/.gitignore
deleted file mode 100644
index a5baada18..000000000
--- a/src/var/log/worldview/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*
-!.gitignore
-