Hi All,
A couple of quick questions about using the StationXML building tools within OBSPY.
Following the guide at: https://docs.obspy.org/tutorial/code_snippets/stationxml_file_from_scratch.html
A question I have regards how some fields are updated.
For example, after building several channels, then appending these to a station, appending the station to a network, and the network to an inventory object, there are some summary fields that don’t represent what is in the inventory. I was wondering how to force these to be updated.
I created a sample station similar to the above guide, then wrote the file to disk as a STATIONXML File. I read this in using read_inventory into the variable inv.
For example, looking at network:
In [3]: inv.networks[0]
Out [3]:
Network NY
Station Count: None/None (Selected/Total)
Access: UNKNOWN
Contains:
Stations (1):
NY.JNPT (Johnson Point, Banks Island, NWT, Canada)
Channels (2):
NY.JNPT…HHZ (2x)
The Station Count field is left as None/None.
The same happens if one looks at the station in more detail:
In [100]: inv.networks[0].stations[0]
Out[100]:
Station JNPT (Johnson Point, Banks Island, NWT, Canada)
Station Code: JNPT
Channel Count: None/None (Selected/Total)
None -
Access: None
Latitude: 0.0, Longitude: 0.0, Elevation: 0.0 m
Available Channels:
JNPT…HHZ (2x)
Although the information is there, and the 2 channels are present, it seems the channel count as displayed isn’t updated.
Is this information, such as the station count (for a network) and channel count (for a station) generated on the fly when printing, or is this more integral within the inventory. Is there a function or module to force this information to be updated after the data is added?
Another question is whether there is a way to have the network operating time field, ie, network.start_date and network.end_date, be (semi-automatically) filled based on the current station operating times. I would have the same question as to whether the similar helper routine was available for stations, to update their start/end dates based on the current channels (ie, if a new set of channels was added, expanding the operating window).
Thanks very much for any help.
Best,
Andrew