Classes and functions for GSSI file reading

Just define some classes and helper reader functions for gssi data

class pygssi.lib.gssi_filelib.DZT(header, sample)[source]

A DZT file

header

RH – The header of the file, with lot of useful (maybe) info

samp

numpy.ndarray – An array containing the actual returns (not normalized, so won’t plot well as-is

class pygssi.lib.gssi_filelib.RH[source]

You probably need to read the GSSI docs on the c struct to understand this stuff

pygssi.lib.gssi_filelib.check_headers(dzts)[source]

This function should check that the headers have the same number of channels, bytes, etc. and raise an exception if not

pygssi.lib.gssi_filelib.get_dzg_data(fn, t_srs='sps', rev=False)[source]

Read GPS data associated with a GSSI sir4000 file.

Parameters:
  • fn (str) – A dzg file with ggis and gga strings.
  • t_srs (str, optional) – Target coordinate reference. Default lat/lon (wgs84)
  • rev (bool, optional) – Reverse the points in this file (used for concatenating radar files). Default False.
Returns:

data

Return type:

NMEA

pygssi.lib.gssi_filelib.read(fns, revs, pickle_fn=None, elev_fn=None, t_srs='sps', cache=False)[source]

Read in files (and try to get their GPS info too)

Parameters:
  • fns (iterable) – The files to read
  • revs (iterable) – Reverse each file? (must be same length as fns)
  • pickle_fn (str, optional) – Try to load pre-packaged results from this filename
  • elev_fn (str, optional) – Load kinematic GPS data from this matlab file so that you don’t use the crappy ones from the GPS on the radar
  • t_srs (str, optional) – Load things into this projection (can convert to sps/EPSG:3031 or nps/EPSG:3413 from wgs84
  • cache (bool, optional) – pickle results for future use
Returns:

gps_data – GPS data for each of the input files

Return type:

list of NMEA

pygssi.lib.gssi_filelib.read_dzt(fn, rev=False)[source]

Read a dzt file

Parameters:
  • fn (str) – File to parse
  • rev (bool, optional) – Reverse the input array (useful for concatenating files)
Returns:

data

Return type:

DZT

pygssi.lib.gssi_filelib.write_dzt(fn, dzt)[source]

Write a dzt file

Parameters:
  • fn (str) – File to parse
  • dzt (DZT) – The data to write