Core API Reference

ProfilerData Base Class

Simple Class to hold data from a Profiler

class profiler.profilerdata.ProfilerData(datafile: str, dataset: str)[source]

Bases: object

Abstract base class for Profilers

Attributes:

dataset (str): The name of the glider data

Ndepth: int = None
lat = None
lon = None
time = None
profile_id = None
distE = None
distN = None
data_keys: list = []
missid: int = None
platform: str = None
pi: str = None
pdict: dict = None
meta_keys: list = []
s = None
t = None
p = None
theta = None
depth = None
qual: dict = None
has_adcp: bool = False
__init__(datafile: str, dataset: str)[source]
datafile: str = None
dataset = None
classmethod from_binned_file(datafile: str, bin_style: str, dataset: str, in_field: bool = False, missid: int = None, extra_dict: dict = None)[source]
classmethod from_rawfile(datafile: str, dataset: str, in_field: bool = False, mdict: dict = None, **kwargs)[source]

Load a raw IDG file.

Parameters:
  • datafile (str) – The path to the data file.

  • dataset (str) – The name of the dataset.

  • in_field (bool) – Whether the data is in-field or not.

Returns:

The loaded CTDData object.

Return type:

cData (CTDData)

classmethod from_dict(d: dict, darrays: dict, mdict: dict, dataset: str, in_field: bool = False)[source]

Create a ProfilerData object from a dictionary of data.

Parameters:
  • d (dict) –

    A dictionary of data. Required fields:

    time (np.ndarray): An array of times. lat (np.ndarray): An array of latitudes. lon (np.ndarray): An array of longitudes.

  • dataset (str) – The name of the dataset.

  • darrrays (dict) –

    A dictionary of data arrays. Required keys are:

    profile_arrays (list): A list of profile arrays. depth_arrays (list): A list of depth arrays. profile_depth_arrays (list): A list of profile + depth arrays. scalar_keys (list): A list of scalar keys.

  • mdict (dict) – A dictionary of metadata.

  • in_field (bool) – Whether the data is from the infield processing.

Returns:

A ProfilerData object containing the data from the dictionary.

Return type:

ProfilerData

property raw_loader
property ptime
property Nprof
property darrays
property meta_dict
cut_on_reltime(timecut: tuple)[source]

Cuts the profiler data based on good velocity values.

Variables:

timecut (tuple): range of times to include 0 to 1

Returns:

A subset of the original ProfilerData object containing only the profiles with good velocity values.

Return type:

pData (ProfilerData)

profile_subset(profiles: ndarray, init: bool = True)[source]

Create a subset of the ProfilerData object based on the given profiles.

Parameters:
  • profiles (np.ndarray) – An array of profile indices to

  • array (include in the subset. Or a boolean)

  • init (bool) – Whether to initialize a new ProfilerData object.

Returns:

A new ProfilerData object containing the subset of profiles.

Return type:

GliderData

rstr_meta()[source]

Return the representation of the CTDData object

rstr_settings()[source]

Return the representation of the CTDData object

rstr_variables()[source]
to_dict()[source]
write(outfile: str, gzip: bool = False)[source]
class profiler.profilerdata.ADCPData(datafile: str, dataset: str, adcp_on: bool = True)[source]

Bases: ProfilerData

Class to hold CTD data

udop = None
vdop = None
udopacross = None
udopalong = None
has_adcp: bool = True
__init__(datafile: str, dataset: str, adcp_on: bool = True)[source]
adcp_on: bool = None
cut_on_good_velocity(init: bool = True)[source]

Cuts the glider data based on good velocity values.

Returns:

A subset of the original ProfilerData object containing only the profiles with good velocity values.

Return type:

pData (ProfilerData)

class profiler.profilerdata.ProfilerData(datafile: str, dataset: str)[source]

Bases: object

Abstract base class for Profilers

Attributes:

dataset (str): The name of the glider data

Ndepth: int = None
lat = None
lon = None
time = None
profile_id = None
distE = None
distN = None
data_keys: list = []
missid: int = None
platform: str = None
pi: str = None
pdict: dict = None
meta_keys: list = []
s = None
t = None
p = None
theta = None
depth = None
qual: dict = None
has_adcp: bool = False
__init__(datafile: str, dataset: str)[source]
datafile: str = None
dataset = None
classmethod from_binned_file(datafile: str, bin_style: str, dataset: str, in_field: bool = False, missid: int = None, extra_dict: dict = None)[source]
classmethod from_rawfile(datafile: str, dataset: str, in_field: bool = False, mdict: dict = None, **kwargs)[source]

Load a raw IDG file.

Parameters:
  • datafile (str) – The path to the data file.

  • dataset (str) – The name of the dataset.

  • in_field (bool) – Whether the data is in-field or not.

Returns:

The loaded CTDData object.

Return type:

cData (CTDData)

classmethod from_dict(d: dict, darrays: dict, mdict: dict, dataset: str, in_field: bool = False)[source]

Create a ProfilerData object from a dictionary of data.

Parameters:
  • d (dict) –

    A dictionary of data. Required fields:

    time (np.ndarray): An array of times. lat (np.ndarray): An array of latitudes. lon (np.ndarray): An array of longitudes.

  • dataset (str) – The name of the dataset.

  • darrrays (dict) –

    A dictionary of data arrays. Required keys are:

    profile_arrays (list): A list of profile arrays. depth_arrays (list): A list of depth arrays. profile_depth_arrays (list): A list of profile + depth arrays. scalar_keys (list): A list of scalar keys.

  • mdict (dict) – A dictionary of metadata.

  • in_field (bool) – Whether the data is from the infield processing.

Returns:

A ProfilerData object containing the data from the dictionary.

Return type:

ProfilerData

property raw_loader
property ptime
property Nprof
property darrays
property meta_dict
cut_on_reltime(timecut: tuple)[source]

Cuts the profiler data based on good velocity values.

Variables:

timecut (tuple): range of times to include 0 to 1

Returns:

A subset of the original ProfilerData object containing only the profiles with good velocity values.

Return type:

pData (ProfilerData)

profile_subset(profiles: ndarray, init: bool = True)[source]

Create a subset of the ProfilerData object based on the given profiles.

Parameters:
  • profiles (np.ndarray) – An array of profile indices to

  • array (include in the subset. Or a boolean)

  • init (bool) – Whether to initialize a new ProfilerData object.

Returns:

A new ProfilerData object containing the subset of profiles.

Return type:

GliderData

rstr_meta()[source]

Return the representation of the CTDData object

rstr_settings()[source]

Return the representation of the CTDData object

rstr_variables()[source]
to_dict()[source]
write(outfile: str, gzip: bool = False)[source]

ADCPData Class

class profiler.profilerdata.ADCPData(datafile: str, dataset: str, adcp_on: bool = True)[source]

Bases: ProfilerData

Class to hold CTD data

udop = None
vdop = None
udopacross = None
udopalong = None
has_adcp: bool = True
__init__(datafile: str, dataset: str, adcp_on: bool = True)[source]
adcp_on: bool = None
cut_on_good_velocity(init: bool = True)[source]

Cuts the glider data based on good velocity values.

Returns:

A subset of the original ProfilerData object containing only the profiles with good velocity values.

Return type:

pData (ProfilerData)

Key Properties

  • has_adcp: bool - Indicates if ADCP capabilities are present

  • adcp_on: bool - Current state of ADCP functionality

Core Data Arrays

Standard arrays present in ProfilerData objects:

Profile Arrays

  • time: Unix timestamp array

  • lat: Latitude array

  • lon: Longitude array

Depth Arrays

  • depth: Depth levels

Profile-Depth Arrays

  • t: Temperature

  • s: Salinity

  • p: Pressure

  • theta: Potential temperature

  • sigma: Potential density