FDSN / StationXML

The FDSN StationXML schema and related documents
https://docs.fdsn.org/projects/stationxml/
12 stars 16 forks source link

How to store GPS time correction data into FDSN StationXML file #25

Open zhang01GA opened 4 years ago

zhang01GA commented 4 years ago

Background

In Geoscience Australia, we have been working on an AusArray Passive Seismic Imaging Project. We process and analyse seismic waveform data from both permanent and temporary stations.

Problem Some seismic stations may have GPS clock drift problems. We have been able to use a cross-correlation method to identify and determine the time drift amount for each date. Typically we get a CSV data like the following:

network, station, date, clock_correction_seconds 7D,DE43,2012-11-27,1.0398489013215846 7D,DE43,2012-11-28,0.9408504322549281 7D,DE43,2012-11-29,0.8418519631882714 7D,DE43,2012-11-30,0.7428534941216148 7D,DE43,2012-12-01,0.6438550250549583 7D,DE43,2012-12-02,0.5448565559883017 7D,DE43,2012-12-03,0.445858086921645 7D,DE43,2012-12-04,0.3468596178549885 7D,DE43,2012-12-05,0.247861148788332 ……

What we want to do to store this CSV data into the stationXML as a standard element, so that any user can retrieve this time correction data and apply it to the waveform time series in subsequent analysis.

My initial thought is to add an extra element in the station xml file - see the attached example file modifiled_stationXML.txt

This can be done through python script using Obspy library Then we can retrieve and use the csv data by python code:   from obspy import read_inventory our_new_station_xml= 'modified_inventory_select.xml'
our_inv = read_inventory(our_new_station_xml)
csv_str = our_inv.networks[0].stations[0].extra.gpsclockcorrection.value

Then parse the csv_str data to get the last two columns (date, clock_correction_seconds) for further use.

Please help !!!

kaestli commented 4 years ago

@zhang01GA ,

You may consider the option to describe the clock drift alongside with the data rather than the station metadata. If your data is in miniseed: The fixed header section of a miniseed record (bytes 41-44, see seed standard document http://www.fdsn.org/pdf/SEEDManual_V2.4.pdf, page 109) provides this option. Any software promising miniseed support should evaluate these header bytes.

zhang01GA commented 4 years ago

Thant you @kaestli for your comments.

We are using ASDF file format for the Terabytes of archive seismic waveform data.

What we plan to do is to include the modified stationXML file into the related ASDF file. Anyone who use the ASDF file will be able to read the stationXML file and get the GPS clock corrections, and have the option to apply the correction to the original waveform time series.