obspy.io.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:
>>> l = "STA2 -999.0000 -999.00000 -.999 -.999" >>> for k, v in sorted(parse_sta2(l).items()): ... print(k, v) 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" >>> for k, v in sorted(parse_sta2(l).items()): ... print(k, v) coordsys WGS-84 edepth 1.234 elev -123.456 lat 12.34567 lon 1.234567 network ABCD