Cfutil (compliance_checker.cfutil)#

compliance_checker/cfutil.py

Functions

attr_membership(attr_val, value_set[, ...])

Helper function passed to netCDF4.Dataset.get_attributes_by_value Checks that attr_val exists, has the same type as attr_type, and is contained in value_set attr_val: The value of the attribute being checked attr_type: A type object that the attr_val is expected to have the same type as. If the type is not the same, a warning is issued and the code attempts to cast attr_val to the expected type. value_set: The set against which membership for attr_val is tested modifier_fn: A function to apply to attr_val prior to applying the set membership test.

coordinate_dimension_matrix(nc)

Returns a dictionary of coordinates mapped to their dimensions

get_auxiliary_coordinate_variables(ds)

Returns a list of auxiliary coordinate variables

get_axis_map(ds, variable)

Returns an axis_map dictionary that contains an axis key and the coordinate names as values.

get_axis_variables(ds)

Returns a list of variables that define an axis of the dataset

get_bounds_variables(ds)

get_cell_boundary_map(ds)

Returns a dictionary mapping a variable to its boundary variable.

get_cell_boundary_variables(ds)

Returns a list of variable names for variables that represent cell boundaries through the bounds attribute

get_climatology_variable(ds)

Returns the variable describing climatology bounds if it exists.

get_coordinate_variables(ds)

Returns a list of variable names that identify as coordinate variables.

get_flag_variables(ds)

Returns a list of variables that are defined as flag variables

get_forecast_metadata_variables(ds)

Returns a list of variables that represent forecast reference time metadata.

get_geophysical_variables(ds)

Returns a list of variable names for the variables detected as geophysical variables.

get_grid_mapping_variables(ds)

Returns a list of grid mapping variables

get_instrument_variables(ds)

Returns a list of instrument variables

get_lat_variable(nc)

Returns the first variable matching latitude

get_latitude_variables(nc)

Returns a list of all variables matching definitions for latitude

get_lon_variable(nc)

Returns the variable for longitude

get_longitude_variables(nc)

Returns a list of all variables matching definitions for longitude

get_platform_variables(ds)

Returns a list of platform variable NAMES

get_sea_names()

Returns a list of NODC sea names

get_time_variable(ds)

Returns the likeliest variable to be the time coordinate variable

get_time_variables(ds)

Returns a list of variables describing the time coordinate

get_true_latitude_variables(nc)

Returns a list of variables defining true latitude.

get_true_longitude_variables(nc)

Returns a list of variables defining true longitude.

get_z_variable(nc)

Returns the name of the variable that defines the Z axis or height/depth

get_z_variables(nc)

Returns a list of all variables matching definitions for Z

guess_feature_type(nc, variable)

Returns a string describing the feature type for this variable

isProfile(nc, variable)

Per Ch 9 of the CF spec, profiles are a part of the CF Discrete Sampling Geometries.

isTimeSeries(nc, variable)

Attempt to consolidate all of the disparate timeseries checks.

isTimeSeriesProfile(nc, variable)

Wrapper method.

isTrajectory(nc, variable)

Wrapper method for checking if a variable is detected as a trajectory featureType.

isTrajectoryProfile(nc, variable)

Wrapper method

is_2d_regular_grid(nc, variable)

Returns True if the variable is a 2D Regular grid.

is_2d_static_grid(nc, variable)

Returns True if the variable is a 2D Regular grid that does not vary with time.

is_3d_regular_grid(nc, variable)

Returns True if the variable is a 3D Regular grid.

is_3d_static_grid(nc, variable)

Returns True if the variable is a 2D Regular grid that does not vary with time.

is_cf_trajectory(nc, variable)

Returns true if the variable is a CF trajectory feature type

is_compression_coordinate(ds, variable)

Returns True if the variable is a coordinate variable that defines a compression scheme.

is_coordinate_variable(ds, variable)

Returns True if the variable is a coordinate variable

is_dataset_valid_ragged_array_repr_featureType(nc, ...)

Check if a data set is a valid representation of a ragged array structure.

is_dimensionless_standard_name(...)

Returns True if the units for the associated standard name are dimensionless.

is_geophysical(ds, variable)

Returns true if the dataset's variable is likely a geophysical variable

is_mapped_grid(nc, variable)

Returns true if the feature-type of variable corresponds to a mapped grid type.

is_multi_timeseries_incomplete(nc, variable)

Returns true if the variable is an incomplete multidimensional array representation of time series.

is_multi_timeseries_orthogonal(nc, variable)

Returns true if the variable is a orthogonal multidimensional array representation of time series.

is_point(nc, variable)

Returns true if the variable is a point feature type

is_profile_incomplete(nc, variable)

Returns true if the variable is a incomplete profile feature type

is_profile_orthogonal(nc, variable)

Returns true if the variable is a orthogonal profile feature type

is_reduced_grid(nc, variable)

Returns True if the feature-type of the variable corresponds to a reduced horizontal grid.

is_single_trajectory(nc, variable)

Returns true if the variable is a single trajectory feature

is_timeseries(nc, variable)

Returns true if the variable is a time series feature type.

is_timeseries_profile_incomplete(nc, variable)

Returns true if the variable is a time-series profile incomplete depth and incomplete time.

is_timeseries_profile_multi_ortho_time(nc, ...)

Returns true if the variable is a time-series profile that represents a multi station with orthogonal time only.

is_timeseries_profile_multi_station(nc, variable)

Returns true if the variable is a time-series profile that represents multiple stations with orthogonal time and depth

is_timeseries_profile_ortho_depth(nc, variable)

Returns true if the variable is a time-series profile with orthogonal depth only.

is_timeseries_profile_single_ortho_time(nc, ...)

Returns true if the variable is a time-series profile that represents a single station with orthogonal time only.

is_timeseries_profile_single_station(nc, ...)

Returns true if the variable is a time-series profile that represents a single station and each profile is the same length.

is_trajectory_profile_incomplete(nc, variable)

Returns true if the variable is a trajectory profile with incomplete depths.

is_trajectory_profile_orthogonal(nc, variable)

Returns true if the variable is a trajectory profile with orthogonal depths.

is_unitless(ds, variable)

Returns true if the variable is unitless

is_variable_valid_ragged_array_repr_featureType(nc, ...)

This method returns a boolean indicating whether the variable is a valid member of a contiguous ragged array representation or indexed ragged array representation of any of the three singular CF featureType types.

units_convertible(units1, units2[, ...])

Return True if a Unit representing the string units1 can be converted to a Unit representing the string units2, else False.