Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion landingpage/shared-sources.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[source.shared]
repo = "freva-org/grid-doctor"
ref = "main"
commit = "6d891de1176a075c426f41a20776ec5d94ffd3eb"
commit = "a96e532b799df46e86542c1491a96f607cddc1e7"
source_dir = "docs/shared"
target_dir = "shared"

Expand Down
6 changes: 3 additions & 3 deletions landingpage/shared.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# tell a hand edit from a sync without going to the network.

[shared]
commit = "6d891de1176a075c426f41a20776ec5d94ffd3eb"
commit = "a96e532b799df46e86542c1491a96f607cddc1e7"

[shared.files]
"high-level-access.md" = "0ab36941e00f9fca3f36c2e0ca286cc760bff9910d8fa55c21e1e2b5cce6bc1d"
"technical-decisions.md" = "e2ef22035790186b2bb22177275f7f8d329e73fe8e65231b2e1ec33010411757"
"high-level-access.md" = "9dda1b30221272bd71247b61f0a420763d81502176feec4c2028e9c008d02469"
"technical-decisions.md" = "415aab02d8dda8ba1636f48c4ad06f916c5cc1db91c956157eeb495572e5931c"
19 changes: 15 additions & 4 deletions landingpage/shared/high-level-access.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- Vendored from freva-org/grid-doctor@6d891de1 (docs/shared/high-level-access.md).
<!-- Vendored from freva-org/grid-doctor@a96e532b (docs/shared/high-level-access.md).
Do not edit here: changes belong upstream and will be overwritten
by scripts/sync_shared.py. -->

# Accessing High-Resolution Regional Data

Some datasets in the hub cover a small area (a city, an island, a
Some datasets cover a small area (a city, an island, a
catchment) at very high HEALPix levels (16 is roughly 100 m, 20 roughly
6 m cells). These stores look different from the global pyramids in
two ways, and both change how you load them:
Expand Down Expand Up @@ -143,6 +143,17 @@ coordinates and the global HEALPix indices in `berlin["cell"]`:
berlin["t2m"].mean()
```

!!! note "Fields with missing values"
For variables with NaNs (ocean-only fields, observation gaps), cells
on coarser levels can be only partly valid, and a plain mean over
cells is biased. If the store has a `<name>_valid_fraction`
variable, use it as the weight:

```python
ds.sst.weighted(ds.sst_valid_fraction.fillna(0)).mean("cell")
```


### Circular regions

Select a bounding box around the centre as above, then mask by
Expand Down Expand Up @@ -206,15 +217,15 @@ era5_region = era5_level9.isel(
```

No interpolation, no index join. The hierarchies coincide by
construction, which is one of the reasons the hub uses nested ordering
construction, which is one of the reasons to use nested ordering
everywhere.

## Coarser overview levels

High-level stores are still pyramids. For a quick overview, open a
coarse level of the *same* store. Levels at or below the coordinate
threshold are written with materialised coordinates and behave exactly
like every other dataset in the hub, including in the browser viewer:
like every other global pyramid, including in the browser viewer:

```python
overview = xr.open_zarr(".../city-example.zarr/level_8.zarr", chunks=None)
Expand Down
Loading
Loading