OK, I’ve come up with a solution, but if anyone knows a simpler or better way, I’d appreciate them sharing.
This is the code I’ve come up with to get the latest epoch data in the inventory:
inv = rs.get_stations(network='AM', station=slist[i], level='RESP') # get the instrument response
#print(inv[0])
k=0
while True:
sta = inv[0][k] #station metadata
staOK = sta.is_active(time=eventTime)
if staOK:
break
k += 1
latS = sta.latitude #station latitude
lonS = sta.longitude #station longitude
#eleS = sta.elevation #station elevation
print(slist[i], latS, lonS)
print(sta)
So I’ve set up a loop to test every epoch until it find the one that’s active at the eventTime. This should also handle retrospective events when an old epoch is relevant I think.
Al.