Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using anomalies preprocessor with the reference period outside of time range of interest #2308

Open
malininae opened this issue Jan 22, 2024 · 4 comments
Assignees
Labels
bear at a dinner party Something very unexpected bug Something isn't working preprocessor Related to the preprocessor

Comments

@malininae
Copy link
Contributor

Partially related to #1915, but not related to dask usage. Partially related to #2304.

By using this recipe there are issues with anomalies preprocessor. For example, in that case I'm interested in three different periods 1850-1900, 2011-2030 and 2081-2100, however, I'm interested not in the absolute values, but rather in the anomalies with the reference period from 1940 to 1969. Since currently the anomalies preprocessor extracts the reference period from the provided cube (see here) one needs to load the full 1850-1969, 1940-2020 and 1940-2100 cubes; and after the anomalies are calculated, use extract_timerange for 1850-1900, 2011-2030 and 2081-2100 respectively. While it worked OK for that particular recipe, it is getting unnecessarily computationally expensive, if using for example daily HighResMIP. Furthermore, one can't use start_year/end_year/timerange keywords from cfg since they apply for the full timeseries.

I can even help fixing it, but don't know what would be the best tactic to solve that issue, change anomalies that way that it is OK to load two partial cubes? Not to use the preprocessor anomaly and do like I've done here by creating a separate group and subtracting anomalies in the diagnostic? If the latter than I would suggest raising a warning in the anomalies preprocessor. Tagging @bouweandela since we touched on that issue in the above mentioned issues.

@malininae malininae added bug Something isn't working preprocessor Related to the preprocessor bear at a dinner party Something very unexpected labels Jan 22, 2024
@bouweandela
Copy link
Member

bouweandela commented Jan 23, 2024

If I understand the issue here correctly, the most efficient way to compute this would probably be to only compute the reference and the periods of interest using variable groups in the recipe and then do the final anomaly computation in the diagnostic. To facilitate that, we could consider making it possible to pass an cube representing the reference as the reference argument to the anomalies preprocessor function. That should also solve #2016. @schlunma Do you think this could work?

@schlunma
Copy link
Contributor

Yeah, I think that's a good idea! I did something similar to the bias preprocessor in #2183.

@malininae
Copy link
Contributor Author

Thanks all for the comments, I will look at what @schlunma did and will try to implement passing a cube as a reference (not earlier than within a month in the best case scenario). I'm also proposing to add mentioning to the anomalies documentation that the anomalies are calculated from the time period within the cube. It's not obvious for the outsider in particular if one expects it to be used even more in CMIP7.

@bouweandela
Copy link
Member

A pull request to add that would be very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bear at a dinner party Something very unexpected bug Something isn't working preprocessor Related to the preprocessor
Projects
None yet
Development

No branches or pull requests

3 participants