read_netcdf.py

class pycovjson.read_netcdf.NetCDFReader(dataset_path)[source]
convert_time(t_variable)[source]

Formats time objects to CovJSON compliant strings.

Parameters:t_variable – Time Variable
Returns:list of formatted datetime strings
extract_var_data(var_names)[source]

Returns dictionary containing the values in each variable specified in the variable list.

Parameters:var_names (String) –

:return variable_dict - Dictionary containing key-val pairs

get_description(variable)[source]
Parameters:variable – input variable
Returns:long_name
get_dimensions(variable)[source]

Return dimension of specified variable.

Parameters:variable – Input variable
Returns:Tuple - Array dimension of specified variable
get_metadata(variable)[source]

Returns metadata for a specified variable.

Parameters:variable – Name of specified
Returns:dset[variable]
get_name(variable)[source]
Parameters:variable – input variable
Returns:name - string
get_shape(variable)[source]

Get shape of specifed variable, as list :param variable: String specifying variable name :return: shape_list - List containing shape of specified variable

get_std_name(variable)[source]

Return standard name of variable.

Parameters:variable – input variable
Returns:standard_name
get_type(variable)[source]
Parameters:
  • dset – NetCDF dataset object
  • variable – Specified
Returns:

var_type with digits stripped

get_units(variable)[source]

Return units of specified variable. :param variable: :return: units

get_values(variable)[source]
Parameters:variable
Returns:variable values as ndarray
get_var_group(variable)[source]

Return group which specified variable belongs to.

Parameters:variable
Returns:group as string

:type string

is_x(var)[source]

Detect whether or not specified variable is an x coord :param var: :return: Boolean value

is_y(var)[source]

Detect whether or not specified variable is a y coord :param var: :return: Boolean value