Part of the EQcorrscan module to read nordic format s-files and write them. Maps between Nordic format and obspy Event objects.
Note that these functions do not provide full functionality between quakeML and seisan s-files. Currently (as of version 0.1.1) these only convert pick times and phase information, along with amplitude information for local magnitudes between seisan and quakeML. Location information including hypocentre, origin time and magnitudes are also handled.
A series of wrappers and conversions is included between the legacy PICK and EVENTINFO classes, however these will be depreciated along with these classes for version 0.1.0. Users should transition to using obspy.core.event classes as these have more support and functionality.
We have not implemented any handling of focal mechanism solutions between the two formats.
Pick time-residuals are handled in event.origins.arrivals, with the arrival.pick_id linking the arrival (which contain calculated information) with the pick.resource_id (where the pick contains only physical measured information).
>>> from eqcorrscan.utils import sfile_util >>> event = sfile_util.readpicks('eqcorrscan/tests/test_data/REA/TEST_/' + ... '01-0411-15L.S201309') >>> pick = event.picks >>> time_rms = [arrival.time_residual for arrival in event.origins.arrivals ... if arrival.pick_id == pick.resource_id]
|license:||GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)|
||Generate an empty s-file with a populated header for a given waveform.|
||Write an obspy.event to a nordic formatted s-file.|
||Format information from an obspy.event class to nordic string format.|
||Populate a blank nordic format S-file with pick information.|
||Read header information from a seisan nordic format S-file.|
||Read all pick information from the s-file to an obspy.event.Catalog type.|
||Extract the waveform filename from the s-file.|
||Convert obspy inventory to string formatted for Seisan STATION0.HYP file.|
5.15.2. Private Functions¶
Note that these functions are not designed for public use and may change at any point.
||Switch from obspy event magnitude types to seisan syntax.|
||Convenience tool to convert from string to float.|
||Convenience tool to convert from string to integer.|
||Switch from nordic type magnitude notation to obspy event magnitudes.|
||Convenience tool to convert a number, either float or int into a string.|