API Reference

The API reference is automatically generated from the function docstrings in the GliderTools package. Refer to the examples in the sidebar for reference on how to use the functions.

Loading Data

load.seaglider_basestation_netCDFs(files, ...)

Load a list of variables from the SeaGlider object as a pandas.DataFrame.

load.seaglider_show_variables(files)

load.ego_mission_netCDF(filename)

Loads an EGO formatted glider mission file.

load.slocum_geomar_matfile(filename[, verbose])

Load .mat file generated with the geomar MATLAB script for Slocum data.

load.voto_seaexplorer_nc(filename)

Load .nc file downloaded from https://observations.voiceoftheocean.org/.

load.voto_seaexplorer_dataset(ds)

Adapts a VOTO xarray dataset, for example downloaded from the VOTO ERDAP server (https://erddap.observations.voiceoftheocean.org/erddap/index.html) to be used in GliderTools

load.voto_concat_datasets(datasets)

Concatenates multiple datasets along the time dimensions, profile_num and dives variable(s) are adapted so that they start counting from one for the first dataset and monotonically increase.

High level processing

processing.calc_physics(variable, dives, depth)

A standard setup for processing physics variables (temperature, salinity).

processing.calc_oxygen(o2raw, pressure, ...)

This function processes oxygen.

processing.calc_backscatter(bb_raw, tempC, ...)

The function processes the raw backscattering data in counts into total backscatter (bbp) in metres.

processing.calc_fluorescence(flr_raw, bbp, ...)

This function processes raw fluorescence and corrects for quenching using the Thomalla et al. (2018) approach [1]_.

processing.calc_par(par_raw, dives, depth, ...)

Calculates the theoretical PAR based on an exponential curve fit.

Cleaning

cleaning.outlier_bounds_std(arr[, multiplier])

Mask values outside the upper and lower outlier limits by standard deviation

cleaning.outlier_bounds_iqr(arr[, multiplier])

Mask values outside the upper/lower outlier limits by interquartile range:

cleaning.horizontal_diff_outliers(dives, ...)

Find Z-score outliers (> 3) on the horizontal.

cleaning.mask_bad_dive_fraction(mask, dives, var)

Find bad dives - where more than a fraction of the dive is masked

cleaning.data_density_filter(x, y[, ...])

Use the 2D density cloud of observations to find outliers for any variables

cleaning.despike(var, window_size[, ...])

Return a smooth baseline of data and the anomalous spikes

cleaning.despiking_report(dives, depth, raw, ...)

A report for the results of cleaning.despike.

cleaning.rolling_window(var, func, window)

A rolling window function that is nan-resiliant

cleaning.savitzky_golay(var, window_size, order)

Smooth (and optionally differentiate) data with a Savitzky-Golay filter.

Physics

physics.mixed_layer_depth(ds, variable[, ...])

Calculates the MLD for ungridded glider array.

physics.potential_density(salt_PSU, temp_C, ...)

Calculate density from glider measurements of salinity and temperature.

physics.brunt_vaisala(salt, temp, pres[, lat])

Calculate the square of the buoyancy frequency.

Optics

optics.find_bad_profiles(dives, depth, var)

Find profiles that exceed a threshold at a reference depth.

optics.par_dark_count(par, depth, time[, ...])

Calculates an in situ dark count from the PAR sensor.

optics.backscatter_dark_count(bbp, depth[, ...])

Calculates an in situ dark count from the backscatter sensor.

optics.fluorescence_dark_count(flr, depth[, ...])

Calculates an in situ dark count from the fluorescence sensor.

optics.par_scaling(par_uV, ...)

Scaling correction for par with factory calibration coefficients.

optics.par_fill_surface(par, dives, depth[, ...])

Algebraically calculates the top 5 metres of the par profile.

optics.photic_depth(par, dives, depth[, ...])

Algebraically calculates the euphotic depth.

optics.sunset_sunrise(time, lat, lon)

Calculates the local sunrise/sunset of the glider location.

optics.quenching_correction(flr, bbp, dives, ...)

Corrects the fluorescence data based upon Thomalla et al. (2017).

optics.quenching_report(flr, flr_corrected, ...)

A report for the results of optics.quenching_correction.

Calibration

calibration.bottle_matchup(gld_dives, ...[, ...])

Performs a matchup between glider and bottle samples based on time and depth (or density).

calibration.model_figs(bottle_data, ...[, ax])

Creates the figure for a linear model fit.

calibration.robust_linear_fit(gld_var, ...)

Perform a robust linear regression using a Huber Loss Function to remove outliers.

Gridding and Interpolation

mapping.interp_obj(x, y, z, xi, yi[, ...])

Performs objective interpolation (or Kriging) of a 2D field.

mapping.grid_data(x, y, var[, bins, how, ...])

Grids the input variable to bins for depth/dens (y) and time/dive (x).

mapping.variogram(variable, horz, vert, dives)

Find the interpolation parameters and x and y scaling of the horizontal and vertical coordinate paramters for objective interpolation (Kriging).

Plotting

plot.plot_functions(**kwargs)

Plot data (gridded or not) as a section and more.

General Utilities

utils.time_average_per_dive(dives, time)

Gets the average time stamp per dive.

utils.mask_above_depth(ds, depths)

Masks all data above depths.

utils.mask_below_depth(ds, depths)

Masks all data below depths.

utils.mask_profile_depth(df, mask_depth, above)

Masks either above or below mask_depth.

utils.merge_dimensions(df1, df2[, interp_lim])

Merges variables measured at different time intervals.

utils.calc_glider_vert_velocity(time, depth)

Calculate glider vertical velocity in cm/s

utils.calc_dive_phase(time, depth[, ...])

Determine the glider dive phase

utils.calc_dive_number(time, depth[, ...])

Determine the glider dive number (based on dive phase)

utils.dive_phase_to_number(phase)

utils.distance(lon, lat[, ref_idx])

Great-circle distance in m between lon, lat points.

utils.group_by_profiles(ds[, variables])

Group profiles by dives column.