pyglider.slocum#

Routines to convert raw slocum dinkum files to netcdf timeseries.

Functions#

pyglider.slocum.binary_to_rawnc(indir, outdir, cacdir, sensorlist, deploymentyaml, incremental=True, scisuffix='EBD', glidersuffix='DBD')#

Convert slocum binary data (.ebd/.dbd) to raw netcdf files.

Parameters:
indirstr

Directory with the raw *.ebd (science) and *.dbd (flight) files. These usually come from card_offload/Science/SENTLOGS or card_offload/Science/LOGS, and card_offload/Main_board/SENTLOGS and card_offload/Main_board/LOGS`. Recommend ``binary

outdirstr

Directory to write the matching *.ebd.nc and *.dbd.nc files. Recommend rawnc.

cacdirstr

Directory where the cached CAC sensor lists are kept. These lists are often in directories like ../Main_board/STATE/CACHE/ and ../Science/STATE/CACHE/, and the files in these directories should be copied to this directory by the user. Recommend cac

sensorliststr

Text file with sensor list for this glider. This filters the many sensors on the slocum gliders to just the ones listed here. The file is text, comments deelineated as # a comment and a new entry on each line.

deploymentyamlstr

YAML text file with deployment information for this glider.

incrementalbool, optional

If True (default), only netcdf files that are older than the binary files are re-parsed.

Returns:
statusbool

True success.

Notes

This process can be slow for many files.

pyglider.slocum.merge_rawnc(indir, outdir, deploymentyaml, scisuffix='EBD', glidersuffix='DBD')#

Merge all the raw netcdf files in indir. These are meant to be the raw flight and science files from the slocum.

Parameters:
indirstr

Directory where the raw *.ebd.nc and *.dbd.nc files are. Recommend: ./rawnc

outdirstr

Directory where merged raw netcdf files will be put. Recommend: ./rawnc/. Note that the netcdf files will be named following the data in deploymentyaml: glider_nameglider_serial-YYYYmmddTHHMM-rawebd.nc and ...rawdbd.nc.

deploymentyamlstr

YAML text file with deployment information for this glider.

pyglider.slocum.raw_to_timeseries(indir, outdir, deploymentyaml, *, profile_filt_time=100, profile_min_time=300)#
Parameters:
indirstring

Directory with raw netcdf files.

outdirstring

Directory to put the merged timeseries files.

profile_filt_timefloat

time in seconds over which to smooth the pressure time series for finding up and down profiles (note, doesn’t filter the data that is saved)

profile_min_timefloat

minimum time to consider a profile an actual profile (seconds)

Returns
——-
outnamestring

name of the new merged netcdf file.

pyglider.slocum.parse_gliderState(fname)#

Parse time, lat, and lon from a gliderstate file

Parameters:
fnamestring or Path

Location of the gliderState.xml file for the glider

Returns:
datxarray

xarray with fields time, lon, lat

pyglider.slocum.parse_logfiles(files)#

Parse time, lat, lon, and amph_total from glider logfiles.

Parameters:
fileslist of strings or Paths

List of logfiles to parse. Should be sorted.

Returns:
outxarray

xarray data set with fields time, lon, lat, ampH indexed by surfacing. More could be added.