pyglider.ncprocess ================== .. py:module:: pyglider.ncprocess .. autoapi-nested-parse:: Routines that are used for common processing of netcdf files after they have been converted to standard timeseries. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: pyglider.ncprocess.extract_timeseries_profiles pyglider.ncprocess.make_gridfiles Module Contents --------------- .. py:function:: extract_timeseries_profiles(inname, outdir, deploymentyaml, force=False) Extract and save each profile from a timeseries netCDF. :Parameters: **inname** : str or Path netcdf file to break into profiles **outdir** : str or Path directory to place profiles **deploymentyaml** : str or Path location of deployment yaml file for the netCDF file. This should be the same yaml file that was used to make the timeseries file. **force** : bool, default False Force an overwite even if profile netcdf already exists .. !! processed by numpydoc !! .. py:function:: make_gridfiles(inname, outdir, deploymentyaml, *, fnamesuffix='', depth_bins=None, dz=1, starttime='1970-01-01', maskfunction=None, max_gap=100) Turn a timeseries netCDF file into a vertically gridded netCDF. :Parameters: **inname** : str or Path netcdf file to break into profiles **outdir** : str or Path directory to place profiles **deploymentyaml** : str or Path location of deployment yaml file for the netCDF file. This should be the same yaml file that was used to make the timeseries file. **depth_bins** : array, default = None User-defined depth bins, for instance ``np.arange(0, 1000.1, 1)``. If not None, these are the depth bins into which the data will be gridded. If None, ``dz`` is used to generate bins between 0 and 1100m **dz** : float, default = 1 Vertical grid spacing in meters. **maskfunction** : callable or None, optional Function applied to the dataset before gridding, usually to choose what data will be set to NaN based on quality flags. **max_gap** : int, default = 100 Maximum number of consecutive NaN values to fill when interpolating. This is used to prevent interpolation across large gaps in the data. **-------** .. **outname** : str Name of gridded netCDF file. The gridded netCDF file has coordinates of 'depth' and 'profile', so each variable is gridded in depth bins and by profile number. Each profile has a time, latitude, and longitude. If deploymentyaml is a list, data is parsed for deployment information, with subsequent files overwriting previous files. **Note:** .. **By default, the arithmetic mean is used to bin all variables, except for those with** .. **an average_method attribute inherited from the timeseries. This attribute is specified** .. **in the YAML configuration file when the timeseries is created. For example, if a variable** .. **has average_method: geometric mean, the geometric mean is used when gridding that variable.** .. **Variables with average_method: QC_protocol are treated as discrete quality flags rather than** .. **continuous data, and the maximum flag within each bin is used for gridding (e.g., if any** .. **value in a bin is QC3, the gridded bin is assigned QC3).** .. .. !! processed by numpydoc !!