satpy.cf.data_array module
Utility to generate a CF-compliant DataArray.
- satpy.cf.data_array._preprocess_data_array_name(dataarray, numeric_name_prefix, include_orig_name)[source]
Change the DataArray name by prepending numeric_name_prefix if the name is a digit.
- satpy.cf.data_array.make_cf_data_array(dataarray, epoch=None, flatten_attrs=False, exclude_attrs=None, include_orig_name=True, numeric_name_prefix='CHANNEL_')[source]
Make the xr.DataArray CF-compliant.
- Parameters:
dataarray (xr.DataArray) – The data array to be made CF-compliant.
epoch (str, optional) – Reference time for encoding of time coordinates. If None, the default reference time is defined using from satpy.cf.coords import EPOCH.
flatten_attrs (bool, optional) – If True, flatten dict-type attributes. Defaults to False.
exclude_attrs (list, optional) – List of dataset attributes to be excluded. Defaults to None.
include_orig_name (bool, optional) – Include the original dataset name in the netcdf variable attributes. Defaults to True.
numeric_name_prefix (str, optional) – Prepend dataset name with this if starting with a digit. Defaults to
"CHANNEL_"
.
- Returns:
A CF-compliant xr.DataArray.
- Return type:
xr.DataArray