cf.InteriorRing


class cf.InteriorRing(*args, **kwargs)[source]

An interior ring array with properties.

If a cell is composed of multiple polygon parts, an individual polygon may define an “interior ring”, i.e. a region that is to be omitted from, as opposed to included in, the cell extent. In this case an interior ring array is required that records whether each polygon is to be included or excluded from the cell, and is supplied by an interior ring variable in CF-netCDF. The interior ring array spans the same domain axis constructs as its coordinate array, with the addition of an extra dimension that indexes the parts for each cell. For example, a cell describing the land area surrounding a lake would require two polygon parts: one defines the outer boundary of the land area; the other, recorded as an interior ring, is the lake boundary, defining the inner boundary of the land area.

NetCDF interface

The netCDF variable name may be accessed with the nc_set_variable, nc_get_variable, nc_del_variable, and nc_has_variable methods.

The netCDF variable group structure may be accessed with the nc_set_variable, nc_get_variable, nc_variable_groups, nc_clear_variable_groups, and nc_set_variable_groups methods.

The dataset chunks may be accessed with the nc_dataset_chunksizes, nc_set_dataset_chunksizes, and nc_clear_datset_chunksizes methods.

The name of the netCDF dimension spanned by the interior ring variable’s data (which does not correspond to a domain axis construct) may be accessed with the nc_set_dimension, nc_get_dimension, nc_del_dimension, and nc_has_dimension methods.

Added in version (cfdm): 1.8.0

Initialisation

Parameters:
properties: dict, optional

Set descriptive properties. The dictionary keys are property names, with corresponding values.

Properties may also be set after initialisation with the set_properties and set_property methods.

Parameter example:

properties={'standard_name': 'altitude'}

data: data_like, optional

Set the data.

A data_like object is any object that can be converted to a Data object, i.e. numpy array_like objects, Data objects, and cf instances that contain Data objects.

The data also may be set after initialisation with the set_data method.

source: optional

Convert source, which can be any type of object, to a InteriorRing instance.

All other parameters, apart from copy, are ignored and their values are instead inferred from source by assuming that it has the InteriorRing API. Any parameters that can not be retrieved from source in this way are assumed to have their default value.

Note that if x is also a InteriorRing instance then cf.InteriorRing(source=x) is equivalent to x.copy().

copy: bool, optional

If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.

Methods

Methods

Data

Deprecated at version 3.0.0, use data attribute or get_data method instead.

T

True if and only if the data are coordinates for a CF 'T' axis.

Units

The cf.Units object containing the units of the data array.

X

Always False.

Y

Always False.

Z

Always False.

add_offset

The add_offset CF property.

all

Test whether all data elements evaluate to True.

allclose

Test whether all data are element-wise equal to other, broadcastable data.

any

Test whether any data elements evaluate to True.

apply_masking

Apply masking as defined by the CF conventions.

arccos

Take the trigonometric inverse cosine of the data element- wise.

arccosh

Take the inverse hyperbolic cosine of the data element-wise.

arcsin

Take the trigonometric inverse sine of the data element-wise.

arcsinh

Take the inverse hyperbolic sine of the data element-wise.

arctan

Take the trigonometric inverse tangent of the data element- wise.

arctanh

Take the inverse hyperbolic tangent of the data element-wise.

array

A numpy array deep copy of the data.

asdatetime

Deprecated at version 3.0.0.

asreftime

Deprecated at version 3.0.0.

attributes

Deprecated at version 3.0.0.

binary_mask

A binary (0 and 1) missing data mask of the data array.

calendar

The calendar CF property.

ceil

The ceiling of the data, element-wise.

chunk

Partition the data array.

clear_properties

Remove all properties.

clip

Limit the values in the data.

close

Close all files referenced by the construct.

comment

The comment CF property.

concatenate

Join a together sequence of InteriorRing.

convert_reference_time

Convert reference time data values to have new units.

copy

Return a deep copy.

cos

Take the trigonometric cosine of the data element-wise.

cosh

Take the hyperbolic cosine of the data element-wise.

count

Count the non-masked elements of the data.

count_masked

Count the masked elements of the data.

creation_commands

Return the commands that would create the construct.

cyclic

Get or set the cyclicity of an axis.

data

The Data object containing the data array.

datetime_array

An independent numpy array of date-time objects.

datum

Return an element of the data array as a standard Python scalar.

day

The day of each date-time data array element.

del_data

Remove the data.

del_properties

Remove properties.

del_property

Remove a property.

delprop

Deprecated at version 3.0.0, use method del_property instead.

dtarray

Alias for datetime_array.

dtvarray

Deprecated at version 3.0.0.

dtype

The numpy data type of the data array.

dump

A full description of the interior ring variable.

equals

Whether two instances are the same.

equivalent

True if two constructs are equal, False otherwise.

exp

The exponential of the data, element-wise.

expand_dims

Deprecated at version 3.0.0, use insert_dimension method instead.

file_directories

The directories of files containing parts of the data.

fill_value

Return the data array missing data value.

filled

Replace masked elements with a fill value.

flatten

Flatten axes of the data.

flip

Flip (reverse the direction of) data dimensions.

floor

Floor the data array, element-wise.

get_data

Return the data.

get_filenames

Return the name of the file or files containing the data.

get_original_filenames

The names of files containing the original data and metadata.

get_property

Get a CF property.

get_quantization

Get quantization metadata.

get_quantize_on_write

Get a quantize-on-write instruction.

getprop

Deprecated at version 3.0.0, use method get_property instead.

halo

Expand the data by adding a halo.

hardmask

Whether the mask is hard (True) or soft (False).

has_bounds

Whether or not there are cell bounds.

has_data

Whether or not the construct has data.

has_property

Whether a property has been set.

hasbounds

Deprecated at version 3.0.0, use has_bounds method instead.

hasdata

Deprecated at version 3.0.0, use has_data method instead.

hasprop

Deprecated at version 3.0.0, use method has_property instead.

history

The history CF property.

hour

The hour of each date-time data array element.

id

An identity for the InteriorRing object.

identities

Return all possible identities.

identity

Return the canonical identity.

insert_data

Deprecated at version 3.0.0, use set_data method instead.

insert_dimension

Expand the shape of the data array.

inspect

Inspect the object for debugging.

isauxiliary

Deprecated at version 3.7.0, use construct_type attribute instead.

iscyclic

Whether or not a given axis is cyclic.

isdimension

Deprecated at version 3.7.0, use construct_type attribute instead.

isdomainancillary

Deprecated at version 3.7.0, use construct_type attribute instead.

isfieldancillary

Deprecated at version 3.7.0, use construct_type attribute instead.

ismeasure

Deprecated at version 3.7.0, use construct_type attribute instead.

isperiodic

True if a given axis is periodic.

isscalar

True if the data array is scalar.

leap_month

The leap_month CF property.

leap_year

The leap_year CF property.

log

The logarithm of the data array.

long_name

The long_name CF property.

mask

The mask of the data array.

mask_invalid

Mask the array where invalid values occur.

masked_invalid

Mask the array where invalid values occur (NaN or inf).

match

Alias for match_by_identity.

match_by_identity

Whether or not the construct identity satisfies conditions.

match_by_naxes

Whether or not the data has a given dimensionality.

match_by_ncvar

Whether or not the netCDF variable name satisfies conditions.

match_by_property

Whether or not properties satisfy conditions.

match_by_units

Whether or not the construct has given units.

max

Alias for maximum.

maximum

The maximum of the data array.

mean

The unweighted mean the data array.

mid_range

The unweighted average of the maximum and minimum of the data array.

min

Alias for minimum.

minimum

The minimum of the data array.

minute

The minute of each date-time data array element.

missing_value

The missing_value CF property.

month

The month of each date-time data array element.

month_lengths

The month_lengths CF property.

name

Deprecated at version 3.0.0, use method 'identity' instead.

nc_clear_dataset_chunksizes

Clear the dataset chunking strategy for the data.

nc_clear_dimension_groups

Remove the netCDF dimension group hierarchy.

nc_clear_hdf5_chunksizes

Clear the HDF5 chunking strategy for the data.

nc_clear_variable_groups

Remove the netCDF variable group hierarchy.

nc_dataset_chunksizes

Get the dataset chunking strategy for the data.

nc_del_dimension

Remove the netCDF dimension name.

nc_del_variable

Remove the netCDF variable name.

nc_dimension_groups

Return the netCDF dimension group hierarchy.

nc_get_dimension

Return the netCDF dimension name.

nc_get_variable

Return the netCDF variable name.

nc_has_dimension

Whether the netCDF dimension name has been set.

nc_has_variable

Whether the netCDF variable name has been set.

nc_hdf5_chunksizes

Get the HDF5 chunking strategy for the data.

nc_set_dataset_chunksizes

Set the dataset chunking strategy.

nc_set_dimension

Set the netCDF dimension name.

nc_set_dimension_groups

Set the netCDF dimension group hierarchy.

nc_set_hdf5_chunksizes

Set the HDF5 chunking strategy.

nc_set_variable

Set the netCDF variable name.

nc_set_variable_groups

Set the netCDF variable group hierarchy.

nc_variable_groups

Return the netCDF variable group hierarchy.

ndim

The number of data dimensions.

override_calendar

Override the calendar of date-time units.

override_units

Override the units.

pad_missing

Pad an axis with missing data.

period

Return or set the period of the data.

persist

Persist data into memory.

properties

Return all properties.

range

The absolute difference between the maximum and minimum of the data array.

rechunk

Change the chunk structure of the data.

reference_datetime

The reference date-time of units of elapsed time.

remove_data

Deprecated at version 3.0.0, use method del_data instead.

replace_directory

Replace a file directory in-place.

rint

Round the data to the nearest integer, element-wise.

roll

Roll the data along one or more axes.

round

Round the data to the given number of decimals.

sample_size

The number of non-missing data elements in the data array.

scale_factor

The scale_factor CF property.

sd

Alias for standard_deviation

second

The second of each date-time data array element.

select

Deprecated at version 3.0.0.

set_data

Set the data.

set_properties

Set properties.

set_property

Set a property.

setprop

Deprecated at version 3.0.0, use method set_property instead.

shape

A tuple of the data array's dimension sizes.

sin

Take the trigonometric sine of the data element-wise.

sinh

Take the hyperbolic sine of the data element-wise.

size

The number elements in the data.

squeeze

Remove size one axes from the data array.

standard_deviation

The unweighted sample standard deviation of the data array.

standard_name

The standard_name CF property.

subspace

Return a new variable whose data is subspaced.

sum

The sum of the data array.

swapaxes

Interchange two axes of an array.

tan

Take the trigonometric tangent of the data element-wise.

tanh

Take the hyperbolic tangent of the data array.

to_dask_array

Convert the data to a dask array.

to_memory

Bring data on disk into memory.

to_units

Change the data array units.

transpose

Permute the axes of the data array.

trunc

Truncate the data, element-wise.

uncompress

Uncompress the construct.

unique

The unique elements of the data.

units

The units CF property.

unsafe_array

Deprecated at version 3.0.0, use array attribute instead.

valid_max

The valid_max CF property.

valid_min

The valid_min CF property.

valid_range

The valid_range CF property.

var

Alias for variance

variance

The unweighted sample variance of the data array.

varray

A numpy array view of the data.

where

Set data array elements depending on a condition.

year

The year of each date-time data array element.