Skip to content

Commit

Permalink
work on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Mar 25, 2024
1 parent 05c7429 commit c79cc76
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
8 changes: 6 additions & 2 deletions anemoi/datasets/data/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def check_same_grid(self, d1, d2):
# We don't check the grid, because we want to be able to combine
pass

def check_same_resolution(self, d1, d2):
# We don't check the resolution, because we want to be able to combine
pass


class ConcatGrids(Grids):
# TODO: select the statistics of the most global grid?
Expand All @@ -125,7 +129,7 @@ def tree(self):

class CutoutGrids(Grids):
def __init__(self, datasets, axis):
from anemoi.grids import cutout_mask
from anemoi.datasets.grids import cutout_mask

super().__init__(datasets, axis)
assert len(datasets) == 2, "CutoutGrids requires two datasets"
Expand All @@ -140,7 +144,7 @@ def __init__(self, datasets, axis):
self.lam.longitudes,
self.globe.latitudes,
self.globe.longitudes,
plot="cutout",
# plot="cutout",
)
assert len(self.mask) == self.globe.shape[3], (
len(self.mask),
Expand Down
1 change: 1 addition & 0 deletions anemoi/datasets/data/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Subset(Forwards):
def __init__(self, dataset, indices, reason):
while isinstance(dataset, Subset):
indices = [dataset.indices[i] for i in indices]
reason = {**reason, **dataset.reason}
dataset = dataset.dataset

self.dataset = dataset
Expand Down
10 changes: 10 additions & 0 deletions docs/using/grids.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ So for 2D fields, the thinning will apply to both the latitude and
longitude dimensions. For 1D fields, such as reduced Gaussian grids, the
thinning will apply to the only dimension.

The following example shows the effect of thinning a dataset with a 1 degree
resolution:

.. image:: thinning-before.png

Thinning the dataset with ``thinning=4`` will result in the following dataset:

.. image:: thinning-after.png


******
area
******
Expand Down
Binary file added docs/using/thinning-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/using/thinning-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.png

0 comments on commit c79cc76

Please sign in to comment.