obspy.gse2.libgse2.parse_STA2

parse_STA2(line)[source]

Parses a string with a GSE2 STA2 header line.

Official Definition:

Position Name     Format    Description
   1-4   "STA2"   a4        Must be "STA2"
  6-14   Network  a9        Network identifier
 16-34   Lat      f9.5      Latitude (degrees, S is negative)
 36-45   Lon      f10.5     Longitude (degrees, W is negative)
 47-58   Coordsys a12       Reference coordinate system (e.g., WGS-84)
 60-64   Elev     f5.3      Elevation (km)
 66-70   Edepth   f5.3      Emplacement depth (km)

Corrected Definition (end column of “Lat” field wrong):

Position Name     Format    Description
   1-4   "STA2"   a4        Must be "STA2"
  6-14   Network  a9        Network identifier
 16-24   Lat      f9.5      Latitude (degrees, S is negative)
 26-35   Lon      f10.5     Longitude (degrees, W is negative)
 37-48   Coordsys a12       Reference coordinate system (e.g., WGS-84)
 50-54   Elev     f5.3      Elevation (km)
 56-60   Edepth   f5.3      Emplacement depth (km)

However, many files in practice do not adhere to these defined fixed positions. Here are some real-world examples:

>>> from pprint import pprint
>>> l = "STA2           -999.0000 -999.00000              -.999 -.999"
>>> pprint(parse_STA2(l))  
{'coordsys': '',
 'edepth': -0.999,
 'elev': -0.999,
 'lat': -999.0,
 'lon': -999.0,
 'network': ''}
>>> l = "STA2 ABCD       12.34567   1.234567 WGS-84       -123.456 1.234"
>>> pprint(parse_STA2(l))  
{'coordsys': 'WGS-84',
 'edepth': 1.234,
 'elev': -123.456,
 'lat': 12.34567,
 'lon': 1.234567,
 'network': 'ABCD'}

This Page