xarray.Dataset.argo.create_float_source

xarray.Dataset.argo.create_float_source

Dataset.argo.create_float_source(path: Optional[str] = None, force: str = 'default', select: str = 'deep', file_pref: str = '', file_suff: str = '', format: str = '5', do_compression: bool = True, debug_output: bool = False)

Preprocess data for OWC software calibration

This method can create a FLOAT SOURCE file (i.e. the .mat file that usually goes into /float_source/) for OWC software. The FLOAT SOURCE file is saved as:

<path>/<file_pref><float_WMO><file_suff>.mat

where <float_WMO> is automatically extracted from the dataset variable PLATFORM_NUMBER (in order to avoid mismatch between user input and data content). So if this dataset has measurements from more than one float, more than one Matlab file will be created.

By default, variables loaded are raw PRES, PSAL and TEMP. If PRES is adjusted, variables loaded are PRES_ADJUSTED, raw PSAL calibrated in pressure and raw TEMP.

You can force the program to load raw PRES, PSAL and TEMP whatever PRES is adjusted or not:

>>> ds.argo.create_float_source(force='raw')

or you can force the program to load adjusted variables: PRES_ADJUSTED, PSAL_ADJUSTED, TEMP_ADJUSTED

>>> ds.argo.create_float_source(force='adjusted')

Pre-processing details:

  1. select only ascending profiles

  2. subsample vertical levels to keep the deepest pressure levels on each 10db bins from the surface down to the deepest level.

  3. align pressure values, i.e. make sure that a pressure index corresponds to measurements from the same binned pressure values. This can lead to modify the number of levels in the dataset.

  4. filter variables according to the force option (see below)

  5. filter variables according to QC flags:

    • Remove measurements where timestamp QC is >= 3

    • Keep measurements where pressure QC is anything but 3

    • Keep measurements where pressure, temperature or salinity QC are anything but 4

  6. remove dummy values: salinity not in [0/50], potential temperature not in [-10/50] and pressure not in [0/60000]. Bounds inclusive.

  7. convert timestamp to fractional year

  8. convert longitudes to 0-360

Parameters
  • path (str or path-like, optional) – Path or folder name to which to save this Matlab file. If no path is provided, this function returns the resulting Matlab file as xarray.Dataset.

  • force ({"default", "raw", "adjusted"}, default: "default") –

    If force=’default’ will load PRES/PSAL/TEMP or PRES_ADJUSTED/PSAL/TEMP according to PRES_ADJUSTED filled or not.

    If force=’raw’ will load PRES/PSAL/TEMP

    If force=’adjusted’ will load PRES_ADJUSTED/PSAL_ADJUSTED/TEMP_ADJUSTED

  • select ({'deep','shallow','middle','random','min','max','mean','median'}, default: 'deep') –

  • file_pref (str, optional) – Preffix to add at the beginning of output file(s).

  • file_suff (str, optional) – Suffix to add at the end of output file(s).

  • do_compression (bool, optional) – Whether or not to compress matrices on write. Default is True.

  • format ({'5', '4'}, string, optional) – Matlab file format version. ‘5’ (the default) for MATLAB 5 and up (to 7.2). Use ‘4’ for MATLAB 4 .mat files.

Returns

The output dataset, or Matlab file, will have the following variables (n is the number of profiles, m is the number of vertical levels):

  • DATES (1xn): decimal year, e.g. 10 Dec 2000 = 2000.939726

  • LAT (1xn): decimal degrees, -ve means south of the equator, e.g. 20.5S = -20.5

  • LONG (1xn): decimal degrees, from 0 to 360, e.g. 98.5W in the eastern Pacific = 261.5E

  • PROFILE_NO (1xn): this goes from 1 to n. PROFILE_NO is the same as CYCLE_NO in the Argo files

  • PRES (mxn): dbar, from shallow to deep, e.g. 10, 20, 30 … These have to line up along a fixed nominal depth axis.

  • TEMP (mxn): in-situ IPTS-90

  • SAL (mxn): PSS-78

  • PTMP (mxn): potential temperature referenced to zero pressure, use SAL in PSS-78 and in-situ TEMP in IPTS-90 for calculation.

Return type

xarray.Dataset