Skip to content

Commit

Permalink
Minor changes to FederatedASDFDataSet
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Sep 4, 2023
1 parent bed16ab commit 0ff0b4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions seismic/ASDFdatabase/FederatedASDFDataSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get_closest_stations(self, lon, lat, nn=1):

# end func

def get_global_time_range(self, network, station, location=None, channel=None):
def get_global_time_range(self, network, station=None, location=None, channel=None):
"""
:param network: network code
:param station: station code
Expand All @@ -132,7 +132,7 @@ def get_global_time_range(self, network, station, location=None, channel=None):
min is set to 2100-01-01T00:00:00.000000Z and max is set to 1900-01-01T00:00:00.000000Z
"""

return self.fds.get_global_time_range(network, station, location=location, channel=channel)
return self.fds.get_global_time_range(network, station=station, location=location, channel=channel)

# end func

Expand Down
6 changes: 4 additions & 2 deletions seismic/ASDFdatabase/_FederatedASDFDataSetImpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,11 @@ def decode_tag(tag, type='raw_recording'):
self.masterinv = cPickle.loads(row[0][0])
# end func

def get_global_time_range(self, network, station, location=None, channel=None):
query = "select min(st), max(et) from wdb where net='%s' and sta='%s' "%(network, station)
def get_global_time_range(self, network, station=None, location=None, channel=None):
query = "select min(st), max(et) from wdb where net='%s' "%(network)

if (station is not None):
query += "and sta='%s' "%(station)
if (location is not None):
query += "and loc='%s' "%(location)
if (channel is not None):
Expand Down

0 comments on commit 0ff0b4f

Please sign in to comment.