NCAS-CMS / NCAS-CMS/cf-python

Converting field(s) to & from CF-compliant `xarray.Dataset`

Open
#773 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API review (4.0.0) documentation enhancement question
Dominant language
Python
Stars
150
Forks
23
Avg merge
1d 11h
Merged PRs (30d)
2

Description

A common way to work with weather and climate datasets is of course the xarray library, so it would be nice to have a means to convert to and from an xarray.Dataset if it has sufficient and conformant-enough CF metadata and suitable structure, for which the xarray.decode_cf function may be able to assist on the xarray-side.

Ideally we can have a method for such a conversion and/or at least a recipe in the documentation showing how this can be done, for both a trivially-convertible case and for a case of a field and/or Dataset that needs some tweaks to get the right structure before the conversion can be made.

Note in #706 we considered and supported input of xarray arrays, so that helps towards this.

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

Start by reviewing issue #706 and the linked xarray Dataset, weather-and-climate, and decode_cf documentation. Determine the required CF metadata and structure for conversion in both directions, including a direct case and one needing structural tweaks; done means the conversion method or documented recipe covers both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.