pyglider.slocum =============== .. py:module:: pyglider.slocum .. autoapi-nested-parse:: Routines to convert raw slocum dinkum files to netcdf timeseries. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: pyglider.slocum.binary_to_rawnc pyglider.slocum.merge_rawnc pyglider.slocum.raw_to_timeseries pyglider.slocum.parse_gliderState pyglider.slocum.parse_logfiles Module Contents --------------- .. py:function:: 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: **indir** : str 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`` **outdir** : str Directory to write the matching ``*.ebd.nc`` and ``*.dbd.nc`` files. Recommend ``rawnc``. **cacdir** : str 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`` **sensorlist** : str 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. **deploymentyaml** : str YAML text file with deployment information for this glider. **incremental** : bool, optional If *True* (default), only netcdf files that are older than the binary files are re-parsed. :Returns: **status** : bool *True* success. .. rubric:: Notes This process can be slow for many files. .. !! processed by numpydoc !! .. py:function:: 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: **indir** : str Directory where the raw ``*.ebd.nc`` and ``*.dbd.nc`` files are. Recommend: ``./rawnc`` **outdir** : str 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``. **deploymentyaml** : str YAML text file with deployment information for this glider. .. !! processed by numpydoc !! .. py:function:: raw_to_timeseries(indir, outdir, deploymentyaml, *, profile_filt_time=100, profile_min_time=300) :Parameters: **indir** : string Directory with raw netcdf files. **outdir** : string Directory to put the merged timeseries files. **profile_filt_time** : float 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_time** : float minimum time to consider a profile an actual profile (seconds) **Returns** .. **-------** .. **outname** : string name of the new merged netcdf file. .. !! processed by numpydoc !! .. py:function:: parse_gliderState(fname) Parse time, lat, and lon from a gliderstate file :Parameters: **fname** : string or Path Location of the gliderState.xml file for the glider :Returns: **dat** : xarray xarray with fields time, lon, lat .. !! processed by numpydoc !! .. py:function:: parse_logfiles(files) Parse time, lat, lon, and amph_total from glider logfiles. :Parameters: **files** : list of strings or Paths List of logfiles to parse. Should be sorted. :Returns: **out** : xarray xarray data set with fields time, lon, lat, ampH indexed by surfacing. More could be added. .. !! processed by numpydoc !!