Core API Reference
ProfilerData Base Class
Simple Class to hold data from a Profiler
- class profiler.profilerdata.ProfilerData(datafile: str, dataset: str)[source]
Bases:
objectAbstract base class for Profilers
Attributes:
dataset (str): The name of the glider data
- lat = None
- lon = None
- time = None
- profile_id = None
- distE = None
- distN = None
- s = None
- t = None
- p = None
- theta = None
- depth = 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.
- 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:
- 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
- class profiler.profilerdata.ADCPData(datafile: str, dataset: str, adcp_on: bool = True)[source]
Bases:
ProfilerDataClass to hold CTD data
- udop = None
- vdop = None
- udopacross = None
- udopalong = 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:
objectAbstract base class for Profilers
Attributes:
dataset (str): The name of the glider data
- lat = None
- lon = None
- time = None
- profile_id = None
- distE = None
- distN = None
- s = None
- t = None
- p = None
- theta = None
- depth = 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.
- 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:
- 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
ADCPData Class
- class profiler.profilerdata.ADCPData(datafile: str, dataset: str, adcp_on: bool = True)[source]
Bases:
ProfilerDataClass to hold CTD data
- udop = None
- vdop = None
- udopacross = None
- udopalong = 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