Skip to content

Add radar precipitation datasets overview notebook#29

Draft
leifdenby wants to merge 4 commits intomainfrom
feat/radar-overview-notebook
Draft

Add radar precipitation datasets overview notebook#29
leifdenby wants to merge 4 commits intomainfrom
feat/radar-overview-notebook

Conversation

@leifdenby
Copy link
Copy Markdown
Member

Describe your changes

Now that we have more than one dataset in the catalog I thought might be nice to introduce an overview notebook where we can render the spatial and temporal extent of the domains we've got.

The motivation for this is to give people a quick overview of the available data, and then from that overview be able to link them to the dataset to use.

NB: There is currently an issue with DMI dataset where NaNs are being used within the domain interior which we're working out on slack.

Here's the current domain overview:

output

No change of dependencies needed.

@franchg @arjj8

Issue Link

< Link to the relevant issue or task. > (e.g. closes #00 or solves #00)

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality, e.g. adding a new dataset)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected, e.g. removing or moving a dataset in the catalog)
  • 📖 Documentation (Addition or improvements to documentation)

Checklist before requesting a review

  • My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
  • I have performed a self-review of my code
  • For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
  • I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
  • I have updated the documentation to cover introduced code changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have given the PR a name that clearly describes the change, written in imperative form (context).
  • I have requested a reviewer and an assignee (assignee is responsible for merging)

Checklist for reviewers

Each PR comes with its own improvements and flaws. The reviewer should check the following:

  • the code is readable
  • the code is well tested
  • the code is documented (including return types and parameters)
  • the code is easy to maintain

Author checklist after completed review

  • I have added a line to the CHANGELOG describing this change, in a section
    reflecting type of change (add section where missing):
    • added: when you have added new functionality
    • changed: when default behaviour of the code has been changed
    • fixes: when your contribution fixes a bug

Checklist for assignee

  • PR is up to date with the base branch
  • the tests pass
  • author has added an entry to the changelog (and designated the change as added, changed or fixed)
  • Once the PR is ready to be merged, squash commits and merge the PR.

@franchg
Copy link
Copy Markdown
Member

franchg commented Feb 13, 2026

You may want to sample mutiple timestep at random and do an .any() over time to get the full coverage. Expecially fo the italian datacube many radars have been added/removed over time so to get the full domain it a good idea to merge multiple random timesteps over the years :)

@franchg
Copy link
Copy Markdown
Member

franchg commented Feb 13, 2026

In cell nr.7. Instead of:

    # Use first timestep to define the dataset spatial domain via non-NaN points.
    da0 = ds[var_name].isel(time=0)
    domain_mask = da0.notnull().astype(float).where(da0.notnull())

You can do:

    # select 20 random timesteps and do the union of their valid data points to get a more complete domain mask
    time_indices = np.random.choice(ds[var_name].shape[0], size=20, replace=False)
    domain_mask = None
    for t in time_indices:
        da = ds[var_name].isel(time=t)
        valid_mask = da.notnull()
        if domain_mask is None:
            domain_mask = valid_mask
        else:
            domain_mask = domain_mask | valid_mask

@leifdenby leifdenby modified the milestones: v0.3.0, v0.4.0 Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants