Python API
xarray_eopf.backend.EopfBackend
Bases: BackendEntrypoint
Backend for EOPF Data Products using the Zarr format.
Note, that the chunks
parameter passed to xarray top level functions
xr.open_datatree()
and xr.open_dataset()
is not passed to
backend. Instead, xarray uses them to (re)chunk the results
from calling the backend equivalents, hence, after backend code.
Source code in xarray_eopf/backend.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|
open_datatree(filename_or_obj, *, op_mode=OP_MODE_ANALYSIS, product_type=None, protocol=None, storage_options=None, drop_variables=None, decode_timedelta=False)
Backend implementation delegated to by
xarray.open_datatree()
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename_or_obj
|
str | PathLike[Any] | ReadBuffer | AbstractDataStore
|
File path, or URL, a path-like string, or a Zarr store, or other key to object mapping. |
required |
op_mode
|
OpMode
|
Mode of operation, either "analysis" or "native". Defaults to "analysis". |
OP_MODE_ANALYSIS
|
product_type
|
str | None
|
Optional product type name, such as |
None
|
protocol
|
str | None
|
If |
None
|
storage_options
|
Mapping[str, Any] | None
|
If |
None
|
drop_variables
|
str | Iterable[str] | None
|
Variable name or iterable of variable names to drop from the underlying file. See xarray documentation. |
None
|
decode_timedelta
|
bool | CFTimedeltaCoder | Mapping[str, bool | CFTimedeltaCoder] | None
|
How to decode time-delta units. See xarray documentation. |
False
|
Returns:
Type | Description |
---|---|
DataTree
|
A new data-tree instance. |
Source code in xarray_eopf/backend.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
open_dataset(filename_or_obj, *, op_mode=OP_MODE_ANALYSIS, protocol=None, storage_options=None, group_sep='_', variables=None, product_type=None, resolution=None, spline_order=None, drop_variables=None, decode_timedelta=False)
Backend implementation delegated to by
xarray.open_dataset()
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename_or_obj
|
str | PathLike[Any] | ReadBuffer | AbstractDataStore
|
File path, or URL, or path-like string. |
required |
op_mode
|
OpMode
|
Mode of operation, either "analysis" or "native". Defaults to "analysis". |
OP_MODE_ANALYSIS
|
product_type
|
str | None
|
Optional product type name, such as |
None
|
protocol
|
str | None
|
If |
None
|
storage_options
|
Mapping[str, Any] | None
|
If |
None
|
group_sep
|
str
|
Separator string used to concatenate groups names
to create prefixes for unique variable and dimension names.
Defaults to the underscore character ( |
'_'
|
resolution
|
int | float | None
|
Target resolution for all spatial data variables / bands.
Must be one of |
None
|
spline_order
|
int | None
|
Spline order to be used for resampling
spatial data variables / bands.
Must be one of |
None
|
variables
|
str | Iterable[str] | None
|
Variables to include in the dataset. Can be a name or regex pattern or iterable of the latter. |
None
|
drop_variables
|
str | Iterable[str] | None
|
Variable name or iterable of variable names to drop from the underlying file. See xarray documentation. |
None
|
decode_timedelta
|
bool | CFTimedeltaCoder | Mapping[str, bool | CFTimedeltaCoder] | None
|
How to decode time-delta units. See xarray documentation. |
False
|
Returns:
Type | Description |
---|---|
Dataset
|
A new dataset instance. |
Source code in xarray_eopf/backend.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
guess_can_open(filename_or_obj)
Check if the given filename_or_obj
refers to an object that
can be opened by this backend.
The function returns False
to indicate that this backend should
only be used when specified by passing engine="eopf-zarr"
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename_or_obj
|
str | PathLike[Any] | ReadBuffer | AbstractDataStore
|
File path, or URL, or path-like string. |
required |
Returns:
Type | Description |
---|---|
bool
|
Always |
Source code in xarray_eopf/backend.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|