Skip to content
Snippets Groups Projects
Commit 62fb154f authored by Hal Simpson's avatar Hal Simpson
Browse files

moved filter_comments out of metadata, and into an interval specific sub group

parent df95097e
No related branches found
No related tags found
No related merge requests found
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
# default metadata for the 14 USGS observatories. # default metadata for the 14 USGS observatories.
DEFAULT_METADATA = { DEFAULT_METADATA = {
'BOU': { 'BOU': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Boulder', 'station_name': 'Boulder',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -21,19 +17,23 @@ DEFAULT_METADATA = { ...@@ -21,19 +17,23 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-secondvalues using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'BRW': { 'BRW': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Barrow', 'station_name': 'Barrow',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -47,19 +47,23 @@ DEFAULT_METADATA = { ...@@ -47,19 +47,23 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'data_interval_type': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'BSL': { 'BSL': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Stennis Space Center', 'station_name': 'Stennis Space Center',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -73,19 +77,23 @@ DEFAULT_METADATA = { ...@@ -73,19 +77,23 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'CMO': { 'CMO': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'College', 'station_name': 'College',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -99,19 +107,10 @@ DEFAULT_METADATA = { ...@@ -99,19 +107,10 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' +
' 1-second values using the INTERMAGNET gaussian filter' +
' centered on the minute. Scalar 1-minute values are' +
' computed from 1-second values using the INTERMAGNET' +
' gaussian filter centered on the minute. ']
} }
}, },
'DED': { 'DED': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Deadhorse', 'station_name': 'Deadhorse',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -125,19 +124,23 @@ DEFAULT_METADATA = { ...@@ -125,19 +124,23 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'FRD': { 'FRD': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Fredericksburg', 'station_name': 'Fredericksburg',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -151,19 +154,23 @@ DEFAULT_METADATA = { ...@@ -151,19 +154,23 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'FRN': { 'FRN': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Fresno', 'station_name': 'Fresno',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -177,19 +184,23 @@ DEFAULT_METADATA = { ...@@ -177,19 +184,23 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'GUA': { 'GUA': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Guam', 'station_name': 'Guam',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -203,97 +214,113 @@ DEFAULT_METADATA = { ...@@ -203,97 +214,113 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'HON': { 'HON': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Honolulu', 'station_name': 'Honolulu',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
'geodetic_latitude': '21.316', 'geodetic_latitude': '21.316',
'geodetic_longitude': '202.000', 'geodetic_longitude': '202.000',
'elevation': '4', 'elevation': '4',
'sensor_orientation': 'HDZF', 'sensor_orientation': 'HDZF',
'sensor_sampling_rate': 0.01, 'sensor_sampling_rate': 0.01,
'declination_base': 6920, 'declination_base': 6920,
'is_gin': False, 'is_gin': False,
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'SHU': { 'SHU': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Shumagin', 'station_name': 'Shumagin',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
'geodetic_latitude': '55.348', 'geodetic_latitude': '55.348',
'geodetic_longitude': '199.538', 'geodetic_longitude': '199.538',
'elevation': '80', 'elevation': '80',
'sensor_orientation': 'HDZF', 'sensor_orientation': 'HDZF',
'sensor_sampling_rate': 0.01, 'sensor_sampling_rate': 0.01,
'declination_base': 13974, 'declination_base': 13974,
'is_gin': False, 'is_gin': False,
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'SIT': { 'SIT': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Sitka', 'station_name': 'Sitka',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
'geodetic_latitude': '57.058', 'geodetic_latitude': '57.058',
'geodetic_longitude': '224.674', 'geodetic_longitude': '224.674',
'elevation': '24', 'elevation': '24',
'sensor_orientation': 'HDZF', 'sensor_orientation': 'HDZF',
'sensor_sampling_rate': 0.01, 'sensor_sampling_rate': 0.01,
'declination_base': 16523, 'declination_base': 16523,
'is_gin': False, 'is_gin': False,
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'SJG': { 'SJG': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'San Juan', 'station_name': 'San Juan',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -307,19 +334,23 @@ DEFAULT_METADATA = { ...@@ -307,19 +334,23 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
}, },
'TUC': { 'TUC': {
'data_interval_type': {
'minute': 'filtered 1-minute (00:15-01:45) ',
'second': 'Average 1-Second'
},
'metadata': { 'metadata': {
'station_name': 'Tucson', 'station_name': 'Tucson',
'agency_name': 'United States Geological Survey (USGS)', 'agency_name': 'United States Geological Survey (USGS)',
...@@ -333,20 +364,28 @@ DEFAULT_METADATA = { ...@@ -333,20 +364,28 @@ DEFAULT_METADATA = {
'is_intermagnet': False, 'is_intermagnet': False,
'conditions_of_use': 'The Conditions of Use for data provided' + 'conditions_of_use': 'The Conditions of Use for data provided' +
' through INTERMAGNET and acknowledgement templates' + ' through INTERMAGNET and acknowledgement templates' +
' can be found at www.intermagnet.org', ' can be found at www.intermagnet.org'
'filter_comments': ['Vector 1-minute values are computed from' + },
' 1-second values using the INTERMAGNET gaussian filter' + 'interval_specific': {
' centered on the minute. Scalar 1-minute values are' + 'minute': {
' computed from 1-second values using the INTERMAGNET' + 'data_interval_type': 'filtered 1-minute (00:15-01:45) ',
' gaussian filter centered on the minute. '] 'filter_comments': ['Vector 1-minute values are computed' +
' from 1-second values using the INTERMAGNET gaussian' +
' filter centered on the minute. Scalar 1-minute values' +
' are computed from 1-second values using the' +
' INTERMAGNET gaussian filter centered on the minute. ']
},
'second': {
'data_interval_type': 'Average 1-Second'
}
} }
} }
} }
DEFAULT_DATA_INTERVAL_TYPE = { DEFAULT_INTERVAL_SPECIFIC = {
'minute': 'filtered 1-minute (00:15-01:45) ', 'minute': {'data_interval_type': 'filtered 1-minute (00:15-01:45) '},
'second': 'Average 1-Second' 'second': {'data_interval_type': 'Average 1-Second'}
} }
...@@ -359,10 +398,10 @@ class ObservatoryMetadata(object): ...@@ -359,10 +398,10 @@ class ObservatoryMetadata(object):
pull from a database, or maybe a config file. pull from a database, or maybe a config file.
""" """
def __init__(self, metadata=None, data_interval_type=None): def __init__(self, metadata=None, interval_specific=None):
self.metadata = metadata or DEFAULT_METADATA self.metadata = metadata or DEFAULT_METADATA
self.data_interval_type = data_interval_type or \ self.interval_specific = interval_specific or \
DEFAULT_DATA_INTERVAL_TYPE DEFAULT_INTERVAL_SPECIFIC
def set_metadata(self, stats, observatory, channel, type, interval): def set_metadata(self, stats, observatory, channel, type, interval):
"""Set timeseries metadata (aka a traces stats) """Set timeseries metadata (aka a traces stats)
...@@ -389,9 +428,15 @@ class ObservatoryMetadata(object): ...@@ -389,9 +428,15 @@ class ObservatoryMetadata(object):
stats['channel'] = channel stats['channel'] = channel
stats['data_interval'] = interval stats['data_interval'] = interval
stats['data_type'] = type stats['data_type'] = type
data_interval_type = self.data_interval_type or \ # copy in standard metadata
self.metadata[observatory]['data_interval_type']
stats['data_interval_type'] = data_interval_type[interval]
metadata = self.metadata[observatory]['metadata'] metadata = self.metadata[observatory]['metadata']
for key in metadata: for key in metadata:
stats[key] = metadata[key] stats[key] = metadata[key]
# copy in interval specific metadata
interval_specific = self.interval_specific
if 'interval_specific' in self.metadata[observatory]:
interval_specific = \
self.metadata[observatory]['interval_specific']
# stats['data_interval_type'] = data_interval_type[interval]
for key in interval_specific[interval]:
stats[key] = interval_specific[interval][key]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment