NCAS-CMS / NCAS-CMS/cf-python

Docs: new recipe to illustrate masking area shapefile

Open
#848 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
150
Forks
23
Avg merge
1d 11h
Merged PRs (30d)
2

Description

A user has requested a means to mask certain areas on a plot as defined by a shapefile to outline them.

This is certainly possible via cf-python and cf-plot with some extra logic, potentially including some Cartopy use to facilitate it, but because it is a rather niche request we agreed that instead of adding in-built support this, it would be netter to provide a recipe which showcases how to do it in the former way. (We can mask out land from ocean already by built-in cf-plot funcitonality, but this is for some arbitrary user-provided shape.)

So, we want a new code recipe for the docs which takes a field and a shapefile and applies the shapefile to mask out the shape in the field data, ultimately showing this as a plot.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the documentation's existing code-recipe entry point and read how recipes handle fields and plotting. Build the requested recipe around a field and shapefile, using cf-python and cf-plot with Cartopy if needed; it is done when the recipe masks the selected shape and displays the resulting plot.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.