[add] Metadata class now requires time for get_metadata and get_coordinates as well
This commit is contained in:
parent
3bd5243f2a
commit
1d571a0046
@ -92,7 +92,7 @@ class Metadata(object):
|
|||||||
del(self.seed_ids[seed_id])
|
del(self.seed_ids[seed_id])
|
||||||
|
|
||||||
|
|
||||||
def get_metadata(self, seed_id):
|
def get_metadata(self, seed_id, time):
|
||||||
# get metadata for a specific seed_id, if not already read, try to read from inventories
|
# get metadata for a specific seed_id, if not already read, try to read from inventories
|
||||||
if not seed_id in self.seed_ids.keys():
|
if not seed_id in self.seed_ids.keys():
|
||||||
self._read_inventory_data(seed_id)
|
self._read_inventory_data(seed_id)
|
||||||
@ -103,7 +103,7 @@ class Metadata(object):
|
|||||||
for inv_fname, metadata_dict in self.inventory_files.items():
|
for inv_fname, metadata_dict in self.inventory_files.items():
|
||||||
# use get_coordinates to check for seed_id
|
# use get_coordinates to check for seed_id
|
||||||
try:
|
try:
|
||||||
metadata_dict['data'].get_coordinates(seed_id)
|
metadata_dict['data'].get_coordinates(seed_id, time)
|
||||||
self.seed_ids[seed_id] = inv_fname
|
self.seed_ids[seed_id] = inv_fname
|
||||||
print('Found metadata for station {}!'.format(seed_id))
|
print('Found metadata for station {}!'.format(seed_id))
|
||||||
return metadata_dict
|
return metadata_dict
|
||||||
@ -148,11 +148,11 @@ class Metadata(object):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_coordinates(self, seed_id):
|
def get_coordinates(self, seed_id, time):
|
||||||
metadata = self.get_metadata(seed_id)
|
metadata = self.get_metadata(seed_id, time)
|
||||||
if not metadata:
|
if not metadata:
|
||||||
return
|
return
|
||||||
return metadata['data'].get_coordinates(seed_id)
|
return metadata['data'].get_coordinates(seed_id, time)
|
||||||
|
|
||||||
|
|
||||||
def get_paz(self, seed_id, time):
|
def get_paz(self, seed_id, time):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user