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

Make RXXpTOT indices accept both "%" (ETCCDI) and "mm" (ECA&D) as output unit. #73

Open
jackaranda opened this issue Jul 9, 2021 · 13 comments

Comments

@jackaranda
Copy link

The calculation of R90pTOT and R95pTOT use the generic function RXXpTOT defined in util/calc.py. This function calculates the sum of rainfall exceeding the percentile values provided but should calculate the ratio of this relative to the total rainfall values.

I have implemented a fix which I can contribute.

@pagecp
Copy link
Collaborator

pagecp commented Jul 9, 2021

If you look at the definition of RxxpTOT, we have:
https://www.rdocumentation.org/packages/climdex.pcic/versions/1.1-11/topics/climdex.r95ptot

This function takes a climdexInput object as input and computes the climdex index R95pTOT: the annual sum of precipitation in days where daily precipitation exceeds the 95th percentile of daily precipitation in the base period.

And from the icclim documentation:

out_unit

Percentile-based indices (TX10p, TX90p, TN10p, TN90p, TG10p, TG90p, R75p, R95p and R99p) could be returned as number of days (out_unit = “days”) or as percentage of days (out_unit = “%”).

So we should have % only in the case we have out_unit as %.

@jackaranda
Copy link
Author

jackaranda commented Jul 9, 2021

Yes, I think there are some different definitions. In https://www.ecad.eu/documents/atbd.pdf which is referenced in the icclim documentation it is definied as the precipitation fraction. But I agree, in the original http://etccdi.pacificclimate.org/list_27_indices.shtml is defined as the sum, as you describe above. Up to you which one we stick to!

R95pTOT
Precipitation fraction due to very wet days (>95th percentile) (%)

Let RRj be the sum of daily precipitation amount for period j and let RRwj be the daily precipitation amount at wet day w(RR≥1.0 mm) of period j and RRwn95 the 95th percentile of precipitation at wet days in the1961–1990 period. ThenR95pT OTjis determined as:

R95pTOTj= 100×∑Ww=1RRwj, where RRwj> RRwn95RRj

Sorry, copy from PDF doesn't work very well!

@pagecp
Copy link
Collaborator

pagecp commented Jul 9, 2021

Hmmm very good question! If I change it now it may break things for some users.
I think initially the ETCCDI definition was taken, but I should put a warning somewhere about it because it differs from ECAD...
So for now I think I would leave it as not in % unless the out_unit is %.

@jackaranda
Copy link
Author

Yes, okay, makes sense not to risk breaking things for others. Though just to note, as far as I can see, out_unit only applies to RXXp indices, not RXXpTOT. The units for RXXpTOT should be mm, which it currently is.

@pagecp
Copy link
Collaborator

pagecp commented Jul 9, 2021

Maybe I should extend that to RxxpTOT so that users can choose if they want % instead of the default mm

@jackaranda
Copy link
Author

That is a nice solution actually. Happy to have a look at implementing it.

@jackaranda jackaranda reopened this Jul 9, 2021
@pagecp
Copy link
Collaborator

pagecp commented Jul 9, 2021

Yes, if you want you can have a look at implementing it!

@bzah
Copy link
Member

bzah commented Jan 10, 2022

With icclim 5.0.0 we now follow the ECA&D definition of RxxpTot.
I think we should keep this issue open for now because it is unclear which definition will be sanctified in the end.

BTW, re-adding the ETCCDI definition would likely need a PR on xclim if we still want to have both.

@bzah bzah changed the title Error in calculation of RXXpTOT Make RXXpTOT indices accept both "%" (ETCCDI) and "mm" (ECA&D) as output unit. Jan 10, 2022
@pagecp
Copy link
Collaborator

pagecp commented Feb 18, 2022

We need to wait for the decisions that will take place within the next week with other international partners. Those standards will impact this issue.

@bzah
Copy link
Member

bzah commented May 3, 2022

Cross references

xclim: Ouranosinc/xclim#1035
clix-meta: clix-meta/clix-meta#53
climpact: ARCCSS-extremes/climpact#87

bzah added a commit that referenced this issue Sep 2, 2022
@Zeitsperre
Copy link

Hey, we were wondering what the status is with this issue. Any news?

@bzah
Copy link
Member

bzah commented Mar 13, 2024

Hi @Zeitsperre,
For now, on icclim, we only provide the ECAD equivalent of R75pTOT (or 95p, 99p) via the generic index fraction_of_total.

I don't think anyone has worked on this topic across the different packages. I have updated my "cross ref" comment above with the related issues for xclim, climpact and clix-meta.
@pagecp are you aware of something new regarding these indices ?

@pagecp
Copy link
Collaborator

pagecp commented Mar 14, 2024 via email

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

No branches or pull requests

4 participants