readgssi.gps (ingest GPS info)¶
Reads GPS information from DZG files.
Deprecated since version 0.0.12.
This function returns the NMEA message variables shared by both RMC and GGA.
pause_correct(header, dzg_file, threshold=0.25, verbose=False)¶
This is a streamlined way of removing pauses from DZG files and re-assigning trace values. GSSI controllers have a bug in which GPS sentences are collected with increasing trace numbers even though radar trace collection is stopped. This results in a misalignment between GPS and radar traces of the same number. This function attempts to realign the trace numbering in the GPS file by identifying stops via a calculated velocity field.
Disclaimer: this function will identify and remove ALL pauses longer than 3 epochs and renumber the traces accordingly. Obviously this can have unintended consequences if the radar controller remains collecting data during these periods. Please be extremely cautious and only use this functionality on files you know have radar pauses that are accompanied by movement pauses. A backup of the original DZG file is made each time this function is run on a file, which means that if you make a mistake, you can simply copy the DZG backup (.DZG.bak) and overwrite the output (.DZG).
Any time you are working with original files, it is always good to have a “working” and “raw” copy of your data. Experimental functionality in readgssi cannot be held responsible for its actions in modifying data. You are responsible for keeping a raw backup of your data just in case.
A detailed explanation of each step taken by this function is available in the code comments.
- Return type
corrected, de-paused GPS data (pandas.DataFrame)
readdzg(fi, frmt, header, verbose=False)¶
A parser to extract gps data from DZG file format. DZG contains raw NMEA sentences, which should include at least RMC and GGA.
NMEA RMC sentence string format:
$xxRMC,UTC hhmmss,status,lat DDmm.sss,lon DDDmm.sss,SOG,COG,date ddmmyy,checksum *xx
NMEA GGA sentence string format:
$xxGGA,UTC hhmmss.s,lat DDmm.sss,lon DDDmm.sss,fix qual,numsats,hdop,mamsl,wgs84 geoid ht,fix age,dgps sta.,checksum *xx
Shared message variables between GGA and RMC: timestamp, latitude, and longitude
RMC contains a datestamp which makes it preferable, but this parser will read either.
fi (str) – File containing gps information
frmt (str) – GPS information format (‘dzg’ = DZG file containing gps sentence strings (see below); ‘csv’ = comma separated file with: lat,lon,elev,time)
verbose (bool) – Verbose, defaults to False
- Return type
GPS data (pandas.DataFrame)
The dataframe contains the following fields: * datetimeutc (
datetime.datetime) * trace (
inttrace number) * longitude (
float) * latitude (
float) * altitude (
float) * velocity (
float) * sec_elapsed (
float) * meters (