Nordic file format support for ObsPy


The ObsPy Development Team (devs@obspy.org)


GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)


Pick time-residuals are handled in event.origins[0].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).


Station-magnitude residuals (only for New Nordic files) are handled in


When you read a Nordic file into Obspy and then write to Nordic format, the
following information is not retained:
 - amplitude-picks have no distance or azimuth to source
 - some event (sub-)types may change if no equivalent event type exists in

Changed in version 1.2.3: * The pick-weight from the Nordic file (0-4, 9) is now read into pick.extra.nordic_pick_weight (was arrival.time_weight) while the finalweight (0-100 %) is read into arrival.time_weight (or backazmiuth_weight, respectively). * Empty network codes are now read as None instead of β€œNA” * Magnitudes are no longer automatically sorted by size.

Changed in version 1.2.0: The number of stations used to calculate the origin was previously incorrectly stored in a comment. From version 1.2.0 this is now stored in origin.quality.used_station_count

Public Functions


Generate an empty s-file with a populated header for a given waveform.


Check whether the type 4 line is for the old or the new Nordic format.


Format picks in an Event to nordic.


Read a catalog of events from a Nordic formatted select file.


Read spectral info from an sfile.


Read header information from a seisan nordic format S-file.


Extract the waveform filename from the s-file.


Function to write a catalog to a select file in nordic format.

Private Functions


Private functions are mainly for internal/developer use and their API might change without notice.


Helper to extract event info from a list of line strings.


Basic test of whether the file is nordic format or not.


Read comment lines from s-file


Read focal mechanism info from s-file


Read high accuracy origin line.


Read the magnitude info from a Nordic header line.


Read moment tensors from s-file


Read one origin (type 1) line.


Internal pick reader.


Reads the type 4 line of the old Nordic format.


Reads the type 4 line of the old Nordic format.


Internal spectral reader.


Read hyp uncertainty line.


Internal header reader.


Internal wave-name reader.


Write comment to s-file


Get the line for a focal-mechanism


Write one Seisan header line for origin.


Write high accuracy hypocenter line E.g.: 1996 6 3 2006 35.511 46.78711 153.72245 33.011 1.923


Generate hypocentral error line.


Generate the two lines required for moment tensor solutions in Nordic.


Write an Event to a nordic formatted s-file.