gemlog.convert

gemlog.convert(rawpath='.', convertedpath='converted', metadatapath='metadata', metadatafile='', gpspath='gps', gpsfile='', t1=-inf, t2=inf, nums=nan, SN='', bitweight=nan, units='Pa', time_adjustment=0, blockdays=1, file_length_hour=24, station='', network='', location='', output_format='MSEED')

Read raw Gem files, interpolate them, and write output files in miniSEED or SAC format.

Parameters
  • rawpath (str, default '.') – Path of folder containing raw Gem data files to read.

  • convertedpath (str, 'converted') – Path of folder where converted data files should be written. If this folder does not exist, convert will try to create it.

  • metadatapath (str, 'metadata') – Path of folder where metadata files should be written. If this folder does not exist, convert will try to create it.

  • metadatafile (str) – File name for metadata file. Default is of the form ‘XXXmetadata_NNN.txt’, where ‘XXX’ is the Gem’s serial number and ‘NNN’ is the file index (000 at first, incrementing by one for each subsequent calculation).

  • gpspath (str, 'gps') – Path of folder where gps files should be written. If this folder does not exist, convert will try to create it.

  • gpsfile (str) – File name for gps file. Default is of the form ‘XXXgps_NNN.txt’, where ‘XXX’ is the Gem’s serial number and ‘NNN’ is the file index (000 at first, incrementing by one for each subsequent calculation).

  • t1 (float or obspy.UTCDateTime, default -np.inf) – Start time for the conversion. If float, the number of seconds since the epoch (1970-01-01 00:00:00 UTC).

  • t2 (float or obspy.UTCDateTime, default np.inf) – Stop time for the conversion. If float, the number of seconds since the epoch (1970-01-01 00:00:00 UTC).

  • nums (list or np.array of integers) – Numbers of raw Gem files to read. By default, it reads all files in rawpath for the specified serial number.

  • SN (str) – One Gem serial number to read and convert. Use a loop to convert multiple Gems.

  • bitweight (float) – The value of each count when converting between counts and other units (typically Pascals, possibly Volts). By default, it looks up the correct bitweight given the Gem’s serial number and gain configuration. Leave this blank unless the Gem has been modified in a way that changes the bitweight.

  • units (str, default 'Pa') – Desired output units. Options are ‘Pa’ (Pascals), ‘V’ (Volts), or ‘counts’.

  • time_adjustment (float, default 0) – Amount to shift the sample times by in case of timing error, possibly due to leap second issues.

  • blockdays (float, default 1) – Number of days worth of data to read in and convert at a time. If you have memory issues when converting data, try setting this to a smaller value.

  • file_length_hour (float, default 1) – Length of the output files in hours.

  • station (str) – Name of the station (up to five characters) to assign to the data. If not provided, uses the Gem’s serial number as the station ID.

  • network (str) – Two-character name of the sensor network. Leaving this blank is normally fine in subsequent data processing.

  • location (str) – Two-character location code for this Gem. Leaving this blank is usually fine in subsequent data processing.

  • output_format (str, default 'MSEED') – Output file format. Currently, formats ‘MSEED’ and ‘SAC’ are supported; ‘WAV’ is partly supported.

Returns

None, writes output files only (converted, metadata, and gps)

Note

All sample times involving the Gem (and most other passive seismic/acoustic data) are in UTC; time zones are not supported.