0

I am trying to create ASCII files of acceleration data from various New Zealand earthquakes, code attached below. I was previously able to generate ASCII files of the acceleration data, however, now running the same code I get the message:

UserWarning: The StationXML file has version 1, ObsPy can read versions (1.0, 1.1). Proceed with caution.

And the acceleration files are no longer being written. Please let me know if there is a way to fix this issue.

import os
from obspy import UTCDateTime
from obspy.clients.fdsn import Client as FDSN_Client
from obspy import read_inventory
from obspy.geodetics import kilometers2degrees
client = FDSN_Client("GEONET")

evid="2016p858000"
minrad=kilometers2degrees(0) 
maxrad=kilometers2degrees(30)

cat = client.get_events(eventid=evid)
print(cat)

event = cat[0]
origin = event.origins[0]
otime = origin.time
print(otime)

otime = cat[0].origins[0].time
print(otime)

inventory = client.get_stations(latitude=cat[0].origins[0].latitude,
                                longitude=cat[0].origins[0].longitude,
                                minradius=minrad,
                                maxradius=maxrad,
                                channel="H??",
                                level="channel",
                                starttime = otime-60,
                                endtime = otime+4*60).remove(channel='HNZ')
print(inventory)

from obspy import Stream
st = Stream()

for network in inventory:
    for station in network:
        try:
            st += client.get_waveforms(network.code, station.code, "*", "H??",
                                       otime-60, otime + 4*60, attach_response=True).remove(channel='HNZ')
            st_rem1=st.copy()
            pre_filt = (0.025, 0.03, 70.0, 80.0)
            acc = st_rem1.copy()
            acc.remove_response(output='ACC', pre_filt=pre_filt)
            print(acc[0])
            acc.plot()
            
            acc[0].write('MS_' + evid + '_' + network.code + '_' + station.code + '_' + station[0].code + '.ascii', format='SLIST')
            acc[1].write('MS_' + evid + '_' + network.code + '_' + station.code + '_' + station[1].code + '.ascii', format='SLIST')
        except:
            pass
b_ang
  • 1

0 Answers0