gutils package

gutils.boxcar_smooth_dataset(dataset, window_size)
gutils.generate_stream(processArgs)

Runs a given process and outputs the resulting text as a StringIO

Parameters:processArgs (list) – Arguments to run in a process
Returns:Resulting text
Return type:StringIO
gutils.get_decimal_degrees(lat_lon)

Converts NMEA GPS format (DDDmm.mmmm) to decimal degrees (DDD.dddddd)

Parameters:lat_lon (str) – NMEA GPS coordinate (DDDmm.mmmm)
Returns:Decimal degree coordinate (DDD.dddddd) or math.nan
Return type:float
gutils.get_profile_data(profile, method=None)
gutils.get_uv_data(profile)
gutils.interpolate_gps(timestamps, latitude, longitude)

Calculates interpolated GPS coordinates between the two surfacings

Parameters:'dataset' – An N by 3 numpy array of time, lat, lon pairs

Returns interpolated gps dataset over entire time domain of dataset

gutils.masked_epoch(timeseries)
gutils.safe_makedirs(folder)
gutils.setup_cli_logger(level=None)
gutils.validate_glider_args(*args)

Validates a glider dataset

Performs the following changes and checks: * Makes sure that there are at least 2 points in the dataset * Checks for netCDF4 fill types and changes them to NaNs * Tests for finite values in time and depth arrays

Submodules

gutils.ctd module

gutils.ctd.calculate_density(time, temperature, pressure, salinity, latitude, longitude)

Calculates density given glider practical salinity, pressure, latitude, and longitude using Gibbs gsw SA_from_SP and rho functions.

Parameters:
  • time (UNIX epoch) –
  • temperature (C), pressure (bar), salinity (psu PSS-78) –
  • latitude (decimal degrees), longitude (decimal degrees) –
Returns:

density (kg/m**3),

gutils.ctd.calculate_practical_salinity(time, conductivity, temperature, pressure)

Calculates practical salinity given glider conductivity, temperature, and pressure using Gibbs gsw SP_from_C function.

Parameters:conductivity (time,) –
Returns:salinity (psu PSS-78).

gutils.filters module

gutils.filters.default_filter(dataset)
gutils.filters.filter_profile_depth(dataset, below=None, reindex=True)

Filters out profiles that are not completely below a certain depth (Default: 1m). This is depth positive down.

Returns a DataFrame with a subset of profiles

gutils.filters.filter_profile_distance(dataset, distance_condition=None, reindex=True)

Filters out profiles that do not span a specified vertical distance (Default: 1m)

Returns a DataFrame with a subset of profiles

gutils.filters.filter_profile_number_of_points(dataset, points_condition=None, reindex=True)

Filters out profiles that do not have a specified number of points (Default: 5 points)

Returns a DataFrame with a subset of profiles

gutils.filters.filter_profile_timeperiod(dataset, timespan_condition=None, reindex=True)

Filters out profiles that do not span a specified number of seconds (Default: 10 seconds)

Returns a DataFrame with a subset of profiles

gutils.filters.filter_profiles(dataset, conditional, reindex=True)

Filters out profiles that do not meet some criteria

Returns the filtered set of profiles

gutils.filters.process_dataset(file, reader_class, filter_z=None, filter_points=None, filter_time=None, filter_distance=None)

gutils.nc module

gutils.nc.check_arg_parser()
gutils.nc.check_dataset(args)
gutils.nc.create_arg_parser()
gutils.nc.create_dataset(file, reader_class, config_path, output_path, subset, **filters)
gutils.nc.create_netcdf(attrs, data, output_path, mode)
gutils.nc.main_check()
gutils.nc.main_create()
gutils.nc.read_attrs(config_path)
gutils.nc.set_profile_data(ncd, profile, profile_index, method=None)
gutils.nc.set_scalar_value(value, ncvar)
gutils.nc.set_uv_data(ncd, profile)
gutils.nc.update_creation_attributes(ncd, profile)
gutils.nc.update_geographic_attributes(ncd, profile)
gutils.nc.update_temporal_attributes(ncd, profile)
gutils.nc.update_vertical_attributes(ncd, profile)

gutils.yo module

gutils.yo.assign_profiles(df, tsint=None)

Returns the start and stop timestamps for every profile indexed from the depth timeseries :param time, depth:

Returns:A Nx2 array of the start and stop timestamps indexed from the yo

Use filter_yo_extrema to remove invalid/incomplete profiles

gutils.yo.binarize_diff(data)
gutils.yo.calculate_delta_depth(interp_data)