Skip to content

Commit

Permalink
MAINT: Updating datalogger download utilities
Browse files Browse the repository at this point in the history
- Obspy requires UTCDatetime now
- RunList wasn't being parsed from the XML, so added that back in
  • Loading branch information
greglucas committed Sep 17, 2020
1 parent 58e3ffa commit a91c45c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bezpy/mt/datalogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ def download_iris_waveforms(self, name, start_time, end_time):
# pylint: disable=import-error,import-outside-toplevel
from obspy.clients.fdsn import Client
_IRIS_CLIENT = Client("IRIS")
from obspy.core import UTCDateTime

# Download the stream
# The channels are
# E: LQN/LQE
# B: LFN/LFE/LFZ
stream = _IRIS_CLIENT.get_waveforms("EM", name, "*", "*",
start_time, end_time)
UTCDateTime(start_time),
UTCDateTime(end_time))
# Convert the stream to a pandas DataFrame
waveforms = _convert_stream_to_df(stream)
# Channel conversion factors and renaming
Expand Down
6 changes: 6 additions & 0 deletions bezpy/mt/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ def read_xml(fname):
site.calc_resisitivity()

site.datalogger = DataLogger()
try:
site.datalogger.runlist = get_text(xml_site, "RunList").split()
except AttributeError:
# No RunList means no data
return site

try:
runinfo, nimsid, samplingrate = read_logger_info(site.xml)
# No info about the nimsid from the logger read, so just return
Expand Down

0 comments on commit a91c45c

Please sign in to comment.