8000 remove diagram (moved to docs) and update text · xarray-contrib/xarray-tutorial@57acd92 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

8000
Appearance settings

Commit 57acd92

Browse files
committed
remove diagram (moved to docs) and update text
1 parent 382a532 commit 57acd92

File tree

1 file changed

+7
-65
lines changed

1 file changed

+7
-65
lines changed

advanced/backends/backends.md

Lines changed: 7 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,72 +9,14 @@ import xarray as xr
99
xr.open_dataset("my_file.grib" , engine="cfgrib")
1010
```
1111

12-
The "engine" provides a set of instructions that tells xarray how to read the data and pack them into a `dataset` (or `dataarray`).
13-
These instructions are stored in an underlying "backend".
12+
Navigating Xarray backends can be confusing,
13+
so we recommend checking out [this flow chart](https://docs.xarray.dev/en/stable/user-guide/io.html)
14+
to help you figure out which engine you need and how to use it.
1415

15-
Xarray comes with several backends that cover many common data formats.
16-
Many more backends are available via external libraries, or you can write your own.
17-
This diagram aims to help you determine - based on the format of the file you'd like to read -
18-
which type of backend you're using and how to use it.
19-
The rectangular boxes are clickable with more information.
16+
You can see what backends are currently available in your working environment
17+
with `xarray.backends.list_engines()`.
2018

21-
```{mermaid}
22-
---
23-
title: "Xarray Engines: Opening Your Data with xr.open_dataset()"
24-
---
25-
26-
27-
flowchart TD
28-
built-in-eng[Is your data stored in one of these formats?
29-
netCDF4 (**netcdf4**)
30-
netCDF3 (**scipy**)
31-
Zarr (**zarr**)
32-
DODS/OPeNDAP (**pydap**)
33-
HDF5 (**h5netcdf**)
34-
]
35-
36-
built-in("`You're in luck! Xarray bundles a backend for this format.
37-
Open data using *xr.open_dataset()*. We recommend
38-
always setting the engine you want to use.`")
39-
40-
installed-eng["`One of these formats (this list is not inclusive)?
41-
GRIB (**cfgrib**)
42-
TileDB (**tiledb**)
43-
GeoTIFF, JPEG-2000, ESRI-hdf (**rioxarray**, via GDAL)
44-
Sentinel-1 SAFE (**xarray-sentinel**)
45-
...
46-
`"]
47-
48-
installed("`Install the package indicated in parentheses
49-
to your Python environment. Restart the kernel
50-
and use *xr.open_dataset(files, engine='rioxarray')*`")
51-
52-
other("`Ask around to see if someone in your data community
53-
has created an Xarray backend for your data type.
54-
If not, you may need to create your own or consider
55-
exporting your data to a more common format.`")
56-
57-
built-in-eng -->|Yes| built-in
58-
built-in-eng -->|No| installed-eng
59-
60-
installed-eng -->|Yes| installed
61-
installed-eng -->|No| other
62-
63-
click built-in-eng "https://docs.xarray.dev/en/stable/getting-started-guide/faq.html#how-do-i-open-format-x-file-as-an-xarray-dataset"
64-
click installed-eng "https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html#rioxarray"
65-
click other "https://docs.xarray.dev/en/stable/internals/how-to-add-new-backend.html"
66-
67-
classDef quesNodefmt fill:#9DEEF4,stroke:#206C89
68-
class built-in-eng,installed-eng quesNodefmt
69-
70-
classDef ansNodefmt fill:#FFAA05,stroke:#E37F17
71-
class built-in,installed,other ansNodefmt
72-
73-
linkStyle default font-size:20pt,color:#206C89
74-
75-
```
76-
77-
## Why use the Xarray backend API?
19+
## Why use the Xarray backend API to write your own backend?
7820

7921
- Your users don't need to learn a new interface; they can use `xr.open_dataset` with the `engine` kwarg.
8022
- With little extra effort you can have lazy loading with Dask. Simply implement a function for reading blocks and Xarray will manage lazy loading with Dask for you.
@@ -93,7 +35,7 @@ Follow the tutorials on creating a new backend for binary files.
9335
### Links to internal backends
9436

9537
- [netcdf4](https://pypi.org/project/netCDF4/) - netCDF4
96-
- [scipy]https://scipy.org/) - netCDF3
38+
- [scipy](https://scipy.org/) - netCDF3
9739
- [zarr](https://pypi.org/project/zarr/) - Zarr
9840
- [pydap](https://pydap.github.io/pydap/) - Data Access Protocol (DAP/DODS/OPeNDAP)
9941

0 commit comments

Comments
 (0)
0