How to group by actual winter season
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 150
- Forks
- 23
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 2
Description
I recently discovered the function
field.collapse('T: mean',group=cf.djf())
However, I've discovered that rather than grouping by actual winter season, I think what it's doing is grouping by the Jan, Feb and Dec of the same calendar year. Or at least, what it's producing is definitely not right!
Is there a way of doing this so that it actually gets the D,J,F from the same season?
What I've always done in the past is something along the lines of:
field_dec = field.subspace(time = cf.month(12))
field_jan = field.subspace(time = cf.month(1))
field_feb = field.subspace(time = cf.month(2))
field_djf = field_dec.copy()
field_djf.data[:-1] = (field_dec.data[:-1]+field_jan.data[1:]+field_feb.data[1:])/3.
But I'm wondering if there is a more efficient way of doing this, without manipulating the data itself?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with field.collapse('T: mean', group=cf.djf()) and compare its grouping with the explicit December, January and February subspace example. Trace the seasonal grouping behavior from cf.djf() through field.collapse; done means December is paired with the following January and February without directly manipulating field.data. The issue names no files or tests, so those entry points are the starting scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100