glidertest API
- glidertest.tools.calc_w_meas(ds)[source]
Calculate the vertical velocity of a glider using changes in pressure with time.
- Parameters:
(xarray.Dataset) (ds)
(array-like) (- TIME)
(array-like)
- Returns:
ds (xarray.Dataset) (Containing the new variable)
- GLIDER_VERT_VELO_DZDT (array-like) (with vertical velocities calculated from dz/dt)
Original author
—————-
Eleanor Frajka-Williams
- glidertest.tools.calc_w_sw(ds)[source]
Calculate the vertical seawater velocity and add it to the dataset.
- Parameters:
(xarray.Dataset) (ds)
- Returns:
ds (xarray.Dataset)
- Return type:
Dataset with the new variable ‘VERT_SW_SPEED’, which is the inferred vertical seawater velocity.
Note
This could be bundled with calc_glider_w_from_depth, but keeping them separate allows for some extra testing/flexibility for the user.
Eleanor Frajka-Williams
- glidertest.tools.check_monotony(da)[source]
This function check weather the selected variable over the mission is monotonically increasing or not. This is developed in particular for profile number. If the profile number is not monotonically increasing, this may mean that whatever function was used to assign the profile number may have misassigned at some points.
- Parameters:
da (xarray.DataArray on OG1 format. Data should not be gridded.)
- Returns:
It will print a sentence stating whether data is
Original author
—————-
Chiara Monforte
- glidertest.tools.compute_daynight_avg(ds, sel_var='CHLA', start_time=None, end_time=None, start_prof=None, end_prof=None)[source]
This function computes night and day averages for a selected variable over a specific period of time or a specific series of dives Data in divided into day and night using the sunset and sunrise time as described in the above function sunset_sunrise from GliderTools :param ds: Data should not be gridded. :type ds: xarray on OG1 format containing at least time, depth, latitude, longitude and the selected variable. :param sel_var: :type sel_var: variable to use to compute the day night averages :param start_time: we recommend selecting small section of few days to a few weeks. Defaults to the central week of the deployment :type start_time: Start date of the data selection. As missions can be long and can make it hard to visualise NPQ effect, :param end_time: we recommend selecting small section of few days to a few weeks. Defaults to the central week of the deployment :type end_time: End date of the data selection. As missions can be long and can make it hard to visualise NPQ effect, :param start_prof: or the central week of the deployment.
It is important to have a large enough number of dives to have some day and night data otherwise the function will not run
- Parameters:
end_prof (End profile of the data selection. If no profile is specified, the specified time selection will be used) – or the central week of the deployment.
run (It is important to have a large enough number of dives to have some day and night data otherwise the function will not)
- Returns:
day_av (pandas.Dataframe) –
- A dataframe with the day averages of the selected variable with the following columns:
batch: Number representing the grouping for each day. This number can represent the number of the day in chronological order depth: Depth values for the average dat: Average value for the selected variable day: Actual date for the batch
night_av (pandas.Dataframe) –
- A dataframe with the night averages of the selected variable with the following columns:
batch: Number representing the grouping for each day. This number can represent the number of the day in chronological order depth: Depth values for the average dat: Average value for the selected variable day: Actual date for the batch
Original author
—————-
Chiara Monforte
- glidertest.tools.compute_global_range(ds: Dataset, var='DOXY', min_val=-5, max_val=600)[source]
Applies a gross filter to the dataset by removing observations outside the specified global range.
This function checks if any values of the specified variable (var) fall outside the provided range [min_val, max_val]. If a value is out of the specified range, it is excluded from the output. The function returns the filtered dataset with the out-of-range values removed.
- Parameters:
ds (The xarray Dataset containing the variable to be filtered.)
var (The name of the variable to apply the range filter on. Default is 'DOXY'.)
min_val (The minimum allowable value for the variable. Default is -5.)
max_val (The maximum allowable value for the variable. Default is 600.)
- Returns:
xarray.DataArray – A filtered DataArray containing only the values of the specified variable within the range [min_val, max_val]. Values outside this range are dropped.
Original author
—————-
Chiara Monforte
- glidertest.tools.compute_hyst_stat(ds: Dataset, var='DOXY', v_res=1)[source]
This function computes some basic statistics for the differences between climb and dive data
- Parameters:
ds (xarray on OG1 format containing at least depth, profile_number and the selected variable. Data should not be gridded.)
var (Selected variable)
v_res (Vertical resolution for the gridding)
- Returns:
diff (difference between upcast and downcast)
err (Percentage error of the dive-climb difference. One value per depth step)
rms (Root Mean Square of the difference in values between dive and climb)
df (pandas dataframe containing dive and climb average over depth for the selected variable. A third column contains the depth values)
Original author
—————-
Chiara Monforte
- glidertest.tools.compute_prof_duration(ds: Dataset)[source]
This function computes some basic statistics for the differences between climb and dive data
- Parameters:
ds (xarray on OG1 format containing at least time and profile_number. Data should not be gridded.)
- Returns:
df (pandas dataframe containing the profile number and the duration of that profile in minutes)
Original author
—————-
Chiara Monforte
- glidertest.tools.find_outlier_duration(df: DataFrame, rolling=20, std=2)[source]
This function computes some basic statistics for the differences between climb and dive data
- Parameters:
df (pandas dataframe containing the profile number and the duration of that profile in minutes)
rolling (window size for the rolling mean)
std (number of standard deviations to use for 'odd' profile duration)
- Returns:
The function prints a statement in case there are profiles with ‘odd’ duration,
rolling_mean (Rolling mean of profile duration computed with the set window)
overt_prof (Profiles where the duration is above the set rolling mean with added standard deviation)
Original author
—————-
Chiara Monforte
- glidertest.tools.max_depth_per_profile(ds: Dataset)[source]
This function computes the maximum depth for each profile in the dataset
- Parameters:
ds (xarray on OG1 format containing at least depth and profile_number. Data)
gridded. (should not be)
- Returns:
max_depths (pandas dataframe containing the profile number and the maximum depth of that profile)
Original author
—————-
Till Moritz
Calculate the bin average of vertical velocities within specified depth ranges. This function computes the bin average of all vertical velocities within depth ranges, accounting for the uneven vertical spacing of seaglider data in depth (but regular in time). It uses the pressure data to calculate depth and then averages the vertical velocities within each depth bin.
- Parameters:
VERT_SW_SPEED (- ds using the variables PRES and)
(array-like (- zgrid)
optional) (Interval for creating depth grid if zgrid is not provided.)
(float (- dz)
optional)
- Returns:
- meanw (array-like)
- Return type:
Bin-averaged vertical velocities for each depth bin.
Note
I know this is a non-sensical name. We should re-name, but is based on advice from Ramsey Harcourt.
Eleanor Frajka-Williams
- glidertest.tools.quant_hysteresis(ds: Dataset, var='DOXY', v_res=1)[source]
This function computes up and downcast averages for a specific variable
- ds: xarray on OG1 format containing at least depth, profile_number and the selected variable.
Data should not be gridded.
var: Selected variable v_res: Vertical resolution for the gridding
df: pandas dataframe containing dive and climb average over depth for the selected variable. A third column contains the depth values
Chiara Monforte
- glidertest.tools.quant_updown_bias(ds, var='PSAL', v_res=1)[source]
This function computes up and downcast averages for a specific variable
- Parameters:
ds (xarray on OG1 format containing at least time, depth, latitude, longitude and the selected variable.) – Data should not be gridded.
var (Selected variable)
v_res (Vertical resolution for the gridding)
- Returns:
df (pandas dataframe containing dc (Dive - Climb average), cd (Climb - Dive average) and depth)
Original author
—————-
Chiara Monforte
- glidertest.plots.check_temporal_drift(ds: ~xarray.core.dataset.Dataset, var: str, ax: ~matplotlib.axes._axes.Axes = None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function can be used to plot sections for any variable with the sunrise and sunset plotted over
- Parameters:
ds (xarray on OG1 format containing at least time, depth, latitude, longitude and the selected variable.) – Data should not be gridded.
var (selected variable to plot)
ax (axis to plot the data)
- Returns:
A figure with two subplots. One is a section containing the data over time and depth. The other one is a scatter of data from the variable
over depth and colored by date
Original author
—————-
Chiara Monforte
- glidertest.plots.plot_basic_vars(ds: Dataset, v_res=1, start_prof=0, end_prof=-1, ax=None)[source]
This function plots the basic oceanographic variables temperature, salinity and density. A second plot is created and filled with oxygen and chlorophyll data if available.
- Parameters:
ds (xarray in OG1 format containing at least temperature, salinity and density and depth)
v_res (vertical resolution for the gridding. Horizontal resolution (by profile) is assumed to be 1)
start_prof (start profile used to compute the means that will be plotted. This can vary in case the dataset spread over a large timescale) – or region and subsections want to be plotted-1
end_prof (end profile used to compute the means that will be plotted. This can vary in case the dataset spread over a large timescale) – or region and subsections want to be plotted-1
- Returns:
Line plots for the averages of the different variables.
Original author
—————-
Chiara Monforte
- glidertest.plots.plot_combined_velocity_profiles(ds_out_dives: Dataset, ds_out_climbs: Dataset)[source]
Plots combined vertical velocity profiles for dives and climbs.
Replicates Fig 3 in Frajka-Williams et al. 2011, but using an updated dataset from Jim Bennett (2013), now in OG1 format as sg014_20040924T182454_delayed.nc. Note that flight model parameters may differ from those in the paper.
- Parameters:
(xarray.Dataset) (ds_out_climbs)
(xarray.Dataset)
cm/s (The function converts vertical velocities from m/s to)
climbs (plots the mean vertical velocities and their ranges for both dives and)
labels (and customizes the plot with)
legends
settings. (and axis)
Note
Assumes that the vertical velocities are in m/s and the depth grid is in meters.
Eleanor Frajka-Williams
- glidertest.plots.plot_daynight_avg(ds, var='PSAL', ax: ~matplotlib.axes._axes.Axes = None, sel_day=None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function can be used to plot the day and night averages computed with the day_night_avg function
- Parameters:
ds (xarray dataset in OG1 format containing at least time, depth and the selected variable)
var (name of the selected variable)
ax (axis to plot the data)
sel_day (selected day to plot. Defaults to the median day)
- Returns:
A line plot comparing the day and night average over depth for the selected day
Original author
—————-
Chiara Monforte
- glidertest.plots.plot_glider_track(ds: ~xarray.core.dataset.Dataset, ax: ~matplotlib.axes._axes.Axes = None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function plots the glider track on a map, with latitude and longitude colored by time.
- Parameters:
ds (xarray in OG1 format with at least TIME, LATITUDE, and LONGITUDE.)
ax (Optional; axis to plot the data.)
kw (Optional; additional keyword arguments for the scatter plot.)
- Returns:
One plot with the map of the glider track.
fig (matplotlib.figure.Figure)
ax (matplotlib.axes._subplots.AxesSubplot)
Original author
—————-
Eleanor Frajka-Williams
- glidertest.plots.plot_global_range(ds, var='DOXY', min_val=-5, max_val=600, ax=None)[source]
- This function generates a histogram of the specified variable (var) from the dataset (ds) and
overlays vertical lines at the specified minimum (min_val) and maximum (max_val) values to visually represent the global range. The function is useful for visually inspecting whether values of the specified variable fall within the expected global range.
ds : The xarray dataset containing the variable (var) to be plotted. var : The name of the variable to plot. min_val : The minimum value of the global range to highlight on the plot. max_val : The maximum value of the global range to highlight on the plot. ax : matplotlib.axes.Axes, optional
The axes on which to plot the histogram. If None, a new figure and axes are created. Default is None.
- figmatplotlib.figure.Figure
The figure object containing the plot.
- axmatplotlib.axes.Axes
The axes object containing the histogram plot.
Chiara Monforte
- glidertest.plots.plot_grid_spacing(ds: ~xarray.core.dataset.Dataset, ax: ~matplotlib.axes._axes.Axes = None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function plots histograms of the grid spacing (diff(ds.DEPTH) and diff(ds.TIME)) where only the inner 99% of values are plotted.
- Parameters:
ds (xarray in OG1 format with at least TIME and DEPTH.)
ax (Optional; axis to plot the data.)
kw (Optional; additional keyword arguments for the histograms.)
- Returns:
Two histograms showing the distribution of grid spacing for depth and time.
fig (matplotlib.figure.Figure)
ax (matplotlib.axes._subplots.AxesSubplot)
Original author
—————-
Eleanor Frajka-Williams
- glidertest.plots.plot_hysteresis(ds, var='DOXY', v_res=1, perct_err=2, ax=None)[source]
This function creates 4 plots which can help the user visualize any possible hysteresis present in their dataset for a specific variable
- ds: xarray on OG1 format containing at least depth, profile_number and the selected variable.
Data should not be gridded.
var: Selected variable v_res: Vertical resolution for the gridding perct_err: Percentage error threshold used to plot a vertical line in one of the subplots ax: Specific axis in can the user wants to add this plot to an existing figure
df: pandas dataframe containing dive and climb average over depth for the selected variable. A third column contains the depth values
Chiara Monforte
- glidertest.plots.plot_ioosqc(data, suspect_threshold=[25], fail_threshold=[50], title='', ax=None)[source]
Plots a scatter plot of the the results of IOOS qQC tests with quality control labels (GOOD, UNKNOWN, SUSPECT, FAIL, MISSING) on the y-axis, and overlays threshold-based markers for suspect and fail values. This function is useful for visualizing the status of data points according to the quality control thresholds.
Parameters:
- dataThe result from the IOOS_QC test.
A sequence of numerical values representing the data points to be plotted.
- suspect_thresholdA list containing one or two numerical values indicating the thresholds for suspect values. If one value is provided,
it applies to both lower and upper bounds for suspect data points. If two values are provided, they define the lower and upper bounds for suspect values.
- fail_threshold A list containing one or two numerical values indicating the thresholds for fail values. Similar to suspect_threshold,
it can have one or two values to define the bounds for fail data points.
- titlestr, optional, default = ‘’
The title to display at the top of the plot.
- axmatplotlib Axes object, optional, default = None
If provided, the plot will be drawn on this existing Axes object. If None, a new figure and axis will be created.
Returns:
- figmatplotlib figure
The figure object containing the plot.
- axmatplotlib Axes object
The axes object used for plotting.
Notes:
The plot uses two y-axes: one for labeling data points as ‘GOOD’, ‘UNKNOWN’, ‘SUSPECT’, ‘FAIL’, or ‘MISSING’ based on thresholds, and another for marking specific suspect and fail ranges.
- glidertest.plots.plot_max_depth_per_profile(ds: ~xarray.core.dataset.Dataset, bins=20, ax=None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function can be used to plot the maximum depth of each profile in a dataset.
- Parameters:
ds (xarray on OG1 format containing the profile number and the maximum depth.)
bins (int, optional (default=20))
- Returns:
One figure with two plots illustrating the max depth of each profile and a histogram of the max depths
Original author
—————-
Till Moritz
- glidertest.plots.plot_outlier_duration(ds: Dataset, rolling_mean: Series, overtime, std=2, ax=None)[source]
Generates two plots to visualize profile durations and highlight outliers. This helps identify profiles with abnormal durations by comparing the actual profile durations to a rolling mean, and by visualizing the shape and depth of the selected outlier profiles.
- Parameters:
ds (An xarray object containing at least the variables 'TIME', 'DEPTH', and 'PROFILE_NUMBER'.) – These are used to compute the profile durations and plot depth profiles.
rolling_mean (A series representing the rolling mean of the profile durations,) – which is used to highlight outliers based on standard deviation.
overtime (A list of profile numbers identified as having unusual durations.) – These profiles are marked on the plot to highlight the outliers.
std (float, optional, default 2) – The number of standard deviations above and below the rolling mean that will be used to define the range of “normal” durations. Profiles outside this range are considered outliers.
ax (The axes object on which to plot the results. If not provided, a new figure with two subplots is created.)
- Returns:
fig (The figure containing the generated plots.) –
A plot showing the profile durations with the rolling mean and the range defined by the rolling mean ± std (standard deviation). The range is highlighted in orange.
A scatter plot of the profile depths, with outlier profiles marked in red. These outliers are determined based on the duration exceeding the threshold defined by the rolling mean ± std.
ax (A 1x2 array of axes used for the two subplots.)
Original author
——
Chiara Monforte
- glidertest.plots.plot_prof_monotony(ds: ~xarray.core.dataset.Dataset, ax: ~matplotlib.axes._axes.Axes = None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function can be used to plot the profile number and check for any possible issues with the profile index assigned.
- Parameters:
ds (xarray dataset in OG1 format with at least PROFILE_NUMBER, TIME, DEPTH. Data should not be gridded)
ax (axis to plot the data)
- Returns:
Two plots, one line plot with the profile number over time (expected to be always increasing). A
second plot which is a scatter plot showing at which depth over time there was a profile index where the
difference was neither 0 nor 1 (meaning there are possibly issues with how the profile index was assigned).
Original author
—————-
Chiara Monforte
- glidertest.plots.plot_quench_assess(ds: ~xarray.core.dataset.Dataset, sel_var: str, ax: ~matplotlib.axes._axes.Axes = None, start_time=None, end_time=None, start_prof=None, end_prof=None, ylim=35, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function can be used to plot sections for any variable with the sunrise and sunset plotted over
- Parameters:
ds (xarray on OG1 format containing at least time, depth, latitude, longitude and the selected variable.) – Data should not be gridded.
sel_var (selected variable to plot)
ax (axis to plot the data)
start_time (Start date of the data selection format 'YYYY-MM-DD'. As missions can be long and came make it hard to visualise NPQ effect.) – Defaults to mid 4 days
end_time (End date of the data selection format 'YYYY-MM-DD'. As missions can be long and came make it hard to visualise NPQ effect.) – Defaults to mid 4 days
start_prof (Start profile of the data selection. If no profile is specified, the specified time selection will be used or the mid 4 days of the deployment)
end_prof (End profile of the data selection. If no profile is specified, the specified time selection will be used or the mid 4 days of the deployment)
ylim (specified limit for the maximum y-axis value. The minimum is computed as ylim/30)
- Returns:
A section showing the variability of the selected data over time and depth
Original author
—————-
Chiara Monforte
- glidertest.plots.plot_sampling_period(ds: Dataset, ax: Axes = None, variable='TEMP')[source]
Similar to plot_grid_spacing, this function plots histograms but of the sampling period for one variable after removing its nans.
- Parameters:
ds (xarray in OG1 format.)
ax (Optional, axis to plot the data.)
variable (display the sampling period for this variable)
- Returns:
One histogram showing the distribution of the sampling period.
ax (matplotlib.axes._subplots.AxesSubplot)
Original author
—————-
Louis Clement
- glidertest.plots.plot_sampling_period_all(ds: ~xarray.core.dataset.Dataset) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function plots several histograms of the sampling period for several variables (TEMP/PSAL by default and DOXY/CHLA if present) after removing their nans.
- Parameters:
ds (xarray in OG1 format.)
- Returns:
One histogram for each variable showing the distribution of the sampling period.
fig (matplotlib.figure.Figure)
ax (matplotlib.axes._subplots.AxesSubplot)
Original author
—————-
Louis Clement
- glidertest.plots.plot_ts(ds: ~xarray.core.dataset.Dataset, axs: ~matplotlib.axes._axes.Axes = None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function plots histograms of temperature and salinity values (middle 95%), and a 2D histogram of salinity and temperature with density contours.
- Parameters:
ds (xarray in OG1 format with at least TEMP and PSAL.)
ax (Optional; axis to plot the data.)
kw (Optional; additional keyword arguments for the histograms.)
- Returns:
Three plots (histogram of temperature, histogram of salinity, and 2D histogram of salinity and temperature with density contours.)
fig (matplotlib.figure.Figure)
ax (matplotlib.axes._subplots.AxesSubplot)
Original author
—————-
Eleanor Frajka-Williams
- glidertest.plots.plot_updown_bias(ds: ~xarray.core.dataset.Dataset, var='TEMP', v_res=1, ax: ~matplotlib.axes._axes.Axes = None, **kw: dict) -> (<class 'matplotlib.figure.Figure'>, <class 'matplotlib.axes._axes.Axes'>)[source]
This function can be used to plot the up and downcast differences computed with the updown_bias function
- Parameters:
ds (xarray on OG1 format containing at least time, depth, latitude, longitude and the selected variable.) – Data should not be gridded.
var (Selected variable)
v_res (Vertical resolution for the gridding)
ax (axis to plot the data)
- Returns:
A line plot comparing the climb and dive average over depth
Original author
—————-
Chiara Monforte
- glidertest.plots.plot_vertical_speeds_with_histograms(ds, start_prof=None, end_prof=None)[source]
Plot vertical speeds with histograms for diagnostic purposes. This function generates a diagnostic plot for the calculation of vertical seawater velocity. It plots the modelled and computed (from dz/dt) vertical velocities as line plots, where these should be similar. The difference between these velocities is the implied seawater velocity, which should be closer to zero than the vehicle velocities. The histogram provides a visual representation to identify any biases. The final calculation of the median should be close to zero if a large enough sample of dives is input and if the glider flight model is well-tuned.
- Parameters:
(xarray.Dataset) (ds)
speed (- VERT_GLIDER_SPEED is the modelled glider)
sensor (- VERT_SPEED_DZDT is the computed glider speed from the pressure)
velocity. (- VERT_SW_SPEED is the implied seawater)
(int (end_prof)
optional) (The ending profile number for subsetting the dataset. Defaults to last profile number.)
(int
optional)
- Returns:
fig, axs (tuple) (The figure and axes objects for the plot.)
Original author
—————-
Eleanor Frajka-Williams
- glidertest.plots.process_optics_assess(ds, var='CHLA')[source]
Function to assess visually any drift in deep optics data and the presence of any possible negative data. This function returns both plots and text
- Parameters:
ds (xarray dataset in OG1 format containing at least time, depth and the selected optical variable)
var (name of the selected variable)
- Returns:
Text giving info on where and when negative data was observed
Plot showing bottom data with a linear regression line to highlight any drift
Original author
—————-
Chiara Monforte
- glidertest.utilities.calc_DEPTH_Z(ds)[source]
Calculate the depth (Z position) of the glider using the gsw library to convert pressure to depth.
- Parameters:
(xarray.Dataset) (ds)
- Returns:
xarray.Dataset (The dataset with an additional ‘DEPTH_Z’ variable.)
Original author
—————-
Eleanor Frajka-Williams
- glidertest.utilities.compute_sunset_sunrise(time, lat, lon)[source]
Calculates the local sunrise/sunset of the glider location from GliderTools.
The function uses the Skyfield package to calculate the sunrise and sunset times using the date, latitude and longitude. The times are returned rather than day or night indices, as it is more flexible for the quenching correction.
- Parameters:
time (numpy.ndarray or pandas.Series) – The date & time array in a numpy.datetime64 format.
lat (numpy.ndarray or pandas.Series) – The latitude of the glider position.
lon (numpy.ndarray or pandas.Series) – The longitude of the glider position.
- Returns:
sunrise (numpy.ndarray) – An array of the sunrise times.
sunset (numpy.ndarray) – An array of the sunset times.
Original author
—————-
Function from GliderTools (https (//github.com/GliderToolsCommunity/GliderTools/blob/master/glidertools/optics.py))
- glidertest.utilities.construct_2dgrid(x, y, v, xi=1, yi=1)[source]
Function to grid data
- Parameters:
x (data with data for the x dimension)
y (data with data for the y dimension)
v (data with data for the z dimension)
xi (Horizontal resolution for the gridding)
yi (Vertical resolution for the gridding)
- Returns:
grid (z data gridded in x and y space with xi and yi resolution)
XI (x data gridded in x and y space with xi and yi resolution)
YI (y data gridded in x and y space with xi and yi resolution)
Original author
—————-
Bastien Queste (https (//github.com/bastienqueste/gliderad2cp/blob/de0652f70f4768c228f83480fa7d1d71c00f9449/gliderad2cp/process_adcp.py#L140))
- glidertest.utilities.plotting_labels(var: str)[source]
Retrieves the label associated with a variable from a predefined dictionary.
This function checks if the given variable var exists as a key in the label_dict dictionary. If found, it returns the associated label from label_dict. If not, it returns the variable name itself as the label.
- Parameters:
(str) (var)
Returns
----------
str (The label corresponding to the variable var. If the variable is not found in label_dict,) – the function returns the variable name as the label.
author (Original)
----------
Monforte (Chiara)
- glidertest.utilities.plotting_units(ds: Dataset, var: str)[source]
Retrieves the units associated with a variable from a dataset or a predefined dictionary.
This function checks if the given variable var exists as a key in the label_dict dictionary. If found, it returns the associated units from label_dict. If not, it returns the units of the variable from the dataset ds using the var key.
- Parameters:
similar) (ds (xarray.Dataset or)
(str) (var)
Returns
----------
str (The units corresponding to the variable var. If the variable is found in label_dict,) – the associated units will be returned. If not, the function returns the units from ds[var].
author (Original)
----------
Monforte (Chiara)
- glidertest.fetchers.load_sample_dataset(dataset_name='sea045_20230530T0832_delayed.nc')[source]
Download sample datasets for use with glidertest
- Parameters:
dataset_name (str, optional) – _description_. Defaults to “sea045_20230530T0832_delayed.nc”.
- Raises:
ValueError – If the requests dataset is not known, raises a value error
- Returns:
Requested sample dataset
- Return type:
xarray.Dataset