Set CF-compliant spatial and temporal coordinates. dict[str, DataArray], dataarray_name: str) dict[str, DataArray][source]

Add declared coordinates to the dataarray if they exist. DataArray, x: str = 'x', y: str = 'y') DataArray[source]

Add relevant attributes to x, y coordinates of a geographic CRS. DataArray, x: str = 'x', y: str = 'y') DataArray[source]

Add relevant attributes to x, y coordinates of a projected CRS. DataArray) list[str][source]

Return a list with the coordinates names specified in the ‘coordinates’ attribute. dict[str, DataArray]) dict[str, bool][source] DataArray) bool[source] DataArray) bool[source]

Check if the DataArray represents the latitude or longitude coordinate. DataArray) bool[source]

Guess whether data are projected or not. DataArray) bool[source] dict[str, DataArray], coord_name: str) dict[str, DataArray][source]

Rename coordinates in the datasets. dict[str, DataArray], dataarray_name: str, coord: str) dict[str, DataArray][source]

Try to add a coordinate to the dataarray, warn if not possible. DataArray) str | None[source]

Try to retrieve coordinate x/y units. DataArray) CRS[source]

Try to get a CRS from attributes., coord_name)[source]

Warn if coordinates cannot be pretty-formatted due to non-uniqueness. dict[str, DataArray]) dict[str, DataArray][source]

Add to DataArrays the coordinates specified in the ‘coordinates’ attribute.

It deal with the ‘coordinates’ attributes indicating lat/lon coords The ‘coordinates’ attribute is dropped from each DataArray

If the coordinates attribute of a data array links to other dataarrays in the scene, for example coordinates=’lon lat’, add them as coordinates to the data array and drop that attribute.

In the final call to xr.Dataset.to_netcdf() all coordinate relations will be resolved and the coordinates attributes be set automatically. Dataset, time: str = 'time') Dataset[source]

Add time bound dimension to xr.Dataset. DataArray) DataArray[source]

Add relevant attributes to x, y coordinates. dict[str, DataArray]) None[source]

Check that all datasets share the same projection coordinates x/y. dict[str, DataArray], pretty: bool = False) dict[str, DataArray][source]

Make non-dimensional coordinates unique among all datasets.

Non-dimensional coordinates, such as scanline timestamps, may occur in multiple datasets with the same name and dimension but different values.

In order to avoid conflicts, prepend the dataset name to the coordinate name. If a non-dimensional coordinate is unique among all datasets and pretty=True, its name will not be modified.

Since all datasets must have the same projection coordinates, this is not applied to latitude and longitude.

  • data_arrays – Dictionary of (dataset name, dataset)

  • pretty – Don’t modify coordinate names, if possible. Makes the file prettier, but possibly less consistent.


Dictionary holding the updated datasets dict[str, DataArray]) bool[source]

Check if DataArray collection has a “longitude” or “latitude” DataArray. DataArray, epoch: str | None) DataArray[source]

Set CF time attributes and encoding.

It expand the DataArray with a time dimension if does not yet exists.

The function assumes

  • that x and y dimensions have at least shape > 1

  • the time coordinate has size 1