earthkit.data.readers.xarray.coordinates¶
Classes¶
Base class for coordinates. |
|
Coordinate class for date. |
|
Coordinate class for ensemble. |
|
Coordinate class for latitude. |
|
Coordinate class for level. |
|
Coordinate class for longitude. |
|
Coordinate class for point data. |
|
Coordinate class for scalar. |
|
Coordinate class for step. |
|
Coordinate class for time. |
|
Coordinate class for unsupported coordinates. |
|
Coordinate class for X. |
|
Coordinate class for Y. |
Functions¶
|
Extract a single value from the variable. |
|
Check if the variable is scalar. |
Module Contents¶
- class earthkit.data.readers.xarray.coordinates.Coordinate(variable)¶
Base class for coordinates.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.DateCoordinate(variable)¶
Bases:
CoordinateCoordinate class for date.
- index(date)¶
Return the index of the date in the coordinate.
- Parameters:
date (
datetime.datetime) – The date to search for.- Returns:
The index of the date in the coordinate, or None if not found.
- Return type:
Optional[int]
- is_date = True¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- mars_names = ('date',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.EnsembleCoordinate(variable)¶
Bases:
CoordinateCoordinate class for ensemble.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = True¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- mars_names = ('number',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the ensemble coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.LatitudeCoordinate(variable)¶
Bases:
CoordinateCoordinate class for latitude.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = True¶
- is_lat = True¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- mars_names = ('latitude',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.LevelCoordinate(variable, levtype)¶
Bases:
CoordinateCoordinate class for level.
- Parameters:
variable (
Any) – The variable representing the coordinate.levtype (
str) – The type of level.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- kwargs¶
- levtype¶
- mars_names = ('level', 'levelist')¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the level coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.LongitudeCoordinate(variable)¶
Bases:
CoordinateCoordinate class for longitude.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = True¶
- is_lat = False¶
- is_lon = True¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- mars_names = ('longitude',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.PointCoordinate(variable)¶
Bases:
CoordinateCoordinate class for point data.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = True¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- mars_names = ('point',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.ScalarCoordinate(variable)¶
Bases:
CoordinateCoordinate class for scalar.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- property mars_names: Tuple[str, Ellipsis]¶
Get the MARS names for the coordinate.
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.StepCoordinate(variable)¶
Bases:
CoordinateCoordinate class for step.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = True¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- mars_names = ('step',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.TimeCoordinate(variable)¶
Bases:
CoordinateCoordinate class for time.
- index(time)¶
Return the index of the time in the coordinate.
- Parameters:
time (
datetime.datetime) – The time to search for.- Returns:
The index of the time in the coordinate, or None if not found.
- Return type:
Optional[int]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = True¶
- is_x = False¶
- is_y = False¶
- mars_names = ('valid_datetime',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.UnsupportedCoordinate(variable)¶
Bases:
CoordinateCoordinate class for unsupported coordinates.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = False¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = False¶
- property mars_names: tuple¶
Get the MARS names for the coordinate.
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.XCoordinate(variable)¶
Bases:
CoordinateCoordinate class for X.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = True¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = True¶
- is_y = False¶
- mars_names = ('x',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- class earthkit.data.readers.xarray.coordinates.YCoordinate(variable)¶
Bases:
CoordinateCoordinate class for Y.
- index(value)¶
Return the index of the value in the coordinate.
- Parameters:
value (
Union[Any,list,tuple]) – The value to search for.- Returns:
The index or indices of the value in the coordinate, or None if not found.
- Return type:
Optional[Union[int,list]]
- is_date = False¶
- is_dim = True¶
- is_grid = True¶
- is_lat = False¶
- is_lon = False¶
- is_member = False¶
- is_point = False¶
- is_step = False¶
- is_time = False¶
- is_x = False¶
- is_y = True¶
- mars_names = ('y',)¶
- property name: str¶
Get the name of the coordinate.
- normalise(value)¶
Normalize the value for the coordinate.
- Parameters:
value (
Any) – The value to normalise.- Returns:
The normalised value.
- Return type:
Any
- reduced(i)¶
Create a new coordinate with a single value.
- Parameters:
i (
int) – The index of the value to select.- Returns:
A new coordinate with the selected value.
- Return type:
- scalar = True¶
- variable¶
- earthkit.data.readers.xarray.coordinates.extract_single_value(variable)¶
Extract a single value from the variable.
- Parameters:
variable (
Any) – The variable to extract the value from.- Returns:
The extracted single value.
- Return type:
Any
- earthkit.data.readers.xarray.coordinates.is_scalar(variable)¶
Check if the variable is scalar.
- Parameters:
variable (
Any) – The variable to check.- Returns:
True if the variable is scalar, False otherwise.
- Return type:
bool