Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 74d1915

Browse files
committed
update doc
1 parent 2fdc18f commit 74d1915

File tree

4 files changed

+60
-21
lines changed

4 files changed

+60
-21
lines changed

docs/building/operations.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ each providing a different period.
3333
pipe
3434
******
3535

36-
The pipe is the process of transforming fields using filters. The first
37-
step of a pipe is typically a source, a join or another pipe. The
38-
following steps are filters.
36+
The pipe is the process of transforming fields using :ref:`filters
37+
<filters>`. The first step of a pipe is typically a source, a join or
38+
another pipe. The following steps are filters.
3939

4040
.. literalinclude:: pipe.yaml
4141
:language: yaml

docs/using/grids.rst

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,37 @@
88
thinning
99
**********
1010

11+
You can thin a dataset by specifying the ``thinning`` parameter in the
12+
``open_dataset`` function. The ``thinning`` parameter depends on the
13+
``method`` select. The default (and only) method is "every-nth", which
14+
will mask out all but every Nth point, with N specified by the
15+
``thinning`` parameter.
16+
1117
.. code:: python
1218
13-
open_dataset(dataset, thinning=..., method="every-nth")
19+
ds = open_dataset(dataset, thinning=N, method="every-nth")
20+
21+
Please note that the thinning will apply to all dimension of the fields.
22+
So for 2D fields, the thinning will apply to both the latitude and
23+
longitude dimensions. For 1D fields, such as reduced Gaussian grids, the
24+
thinning will apply to the only dimension.
1425

1526
******
1627
area
1728
******
29+
30+
You can crop a dataset to a specific area by specifying the area in the
31+
``open_dataset`` function. The area is specified as a list of four
32+
numbers in the order ``(north, west, south, east)``. For example, to
33+
crop a dataset to the area
34+
35+
.. code:: python
36+
37+
ds = open_dataset(dataset, area=(60, 10, 50, 20))
38+
39+
Alternatively, you can specific another dataset as the area. In this
40+
case, the bounding box of the dataset will be used.
41+
42+
.. code:: python
43+
44+
ds = open_dataset(dataset1, area=dataset2)

docs/using/other.rst

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,35 @@
44
Other operations
55
##################
66

7-
.. warning:: The operations described in this section are do not check that their inputs are compatible.
7+
.. warning::
88

9+
The operations described in this section are do not check that their
10+
inputs are compatible.
911

1012
*****
1113
zip
1214
*****
1315

14-
The `zip` operation is used to combine multiple datasets into a single dataset.
16+
The `zip` operation is used to combine multiple datasets into a single
17+
dataset.
1518

1619
.. code:: python
1720
1821
ds = open_dataset(zip=[dataset1, dataset2, ...])
1922
20-
# This will return tuples
23+
This operation is similar to the Python's :py:func:`zip` function, but
24+
it returns tuples of the selected indices instead of the values:
2125

22-
print(ds[0])
23-
24-
print(ds[3, 4])
26+
.. code:: python
2527
28+
print(ds[0])
29+
# (dataset1[0], dataset2[0], ...)
2630
31+
print(ds[0, 1])
32+
# (dataset1[0, 1], dataset2[0, 1], ...)
2733
28-
This operation is identical to the Python's :py:func:`zip` function.
34+
print(ds[0:2])
35+
# (dataset1[0:2], dataset2[0:2], ...)
2936
3037
*******
3138
chain
@@ -35,19 +42,23 @@ This operation is identical to the Python's :py:func:`zip` function.
3542
3643
ds = open_dataset(chain=[dataset1, dataset2, ...])
3744
45+
The `chain` operation is used to combine multiple datasets into a single
46+
dataset. The datasets are combined by concatenating the data arrays
47+
along the first dimension (dates). This is similar to the :ref:`concat`
48+
operation, but no check are done to see if the datasets are compatible,
49+
this means that the shape of the arrays returned when iterating or
50+
indexing may be different.
3851

39-
The `chain` operation is used to combine multiple datasets into a single dataset.
40-
The datasets are combined by concatenating the data arrays along the first dimension (dates).
41-
This is similar to the :ref:`concat` operation, but no check are done to see if the datasets are compatible,
42-
this means that the shape of the arrays returned when iterating or indexing may be different.
52+
This operation is identical to the Python's :py:func:`itertools.chain`
53+
function.
4354

44-
This operation is identical to the Python's :py:func:`itertools.chain` function.
45-
46-
47-
********
55+
*********
4856
shuffle
49-
********
57+
*********
5058

5159
.. code:: python
5260
5361
ds = open_dataset(dataset, shuffle=True)
62+
63+
The `shuffle` operation is used to shuffle the data in the dataset along
64+
the first dimension (dates).

docs/using/subsetting.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ You can change the frequency of the dataset by passing a string with the
3838

3939
.. code:: python
4040
41-
ds = open_dataset("aifs-ea-an-oper-0001-mars-o96-1979-2022-1h-v2", frequency="6h")
41+
ds = open_dataset("aifs-ea-an-oper-0001-mars-o96-1979-2022-1h-v2",
42+
frequency="6h")

0 commit comments

Comments
 (0)