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

Is it possible to use cell methods for percentiles statistics estimated for more than 2 axes (25 axes) ? #342

Closed
DikraK opened this issue Oct 8, 2021 · 4 comments

Comments

@DikraK
Copy link

DikraK commented Oct 8, 2021

I have to create a netcdf for an ensemble of precipitation accumulation (standard_name = precipitation_amount).

An ensemble is composed of what we call members, in my case 25 members, for a given time step.

Here is an extract of structure of my file looks like:

 float time(time) ;
                time:long_name = "time" ;
                time:units = "2021-10-07 12:00:00" ;
                time:calendar = "gregorian" ;
                time:standard_name = "time" ;
                time:axis = "T" ;

float pr000(time, rlon, rlat) ;
                pr000:grid_mapping_name = "latitude_longitude" ;
                pr000:coordinates = "lon lat" ;
                pr000:shortname = "Quantity of precipitation for member 000" ;
                ...
                pr000:standard_name = "precipitation_amount" ;

float pr001(time, rlon, rlat) ;
                pr001:grid_mapping_name = "latitude_longitude" ;
                pr001:coordinates = "lon lat" ;
                pr001:shortname = "Quantity of precipitation for member 001" ;
                ...
                pr001:standard_name = "precipitation_amount" ;

float pr024(time, rlon, rlat) ;
                pr024:grid_mapping_name = "latitude_longitude" ;
                pr024:coordinates = "lon lat" ;
                pr024:shortname = "Quantity of precipitation for member 024" ;
                ...
                pr024:standard_name = "precipitation_amount" ;

I was wondering if it was possible to add a new variable (in the same file) named for example q25pr that represents for example the 25th percentiles estimated across all precipitation fields (pr000, pr001, pr024), using the cell method ?
I cannot find a way to add statistics for more than two axes.

Thanks!

@DikraK DikraK added the question label Oct 8, 2021
@DikraK DikraK changed the title Is it possible to use cell methods for percentiles statistics estimated for more than 2 axis (25 axis) ? Is it possible to use cell methods for percentiles statistics estimated for more than 2 axes (25 axes) ? Oct 8, 2021
@zklaus
Copy link

zklaus commented Oct 11, 2021

@DikraK, I think you are not calculating statistics over 25 axes, but rather really over only one: the axis of the ensemble. The problem is that this information is not apparent in your current encoding. IMHO, the best way to add this information would be to combine your current 25 variables into a single variable with an additional coordinate, i.e.

dimensions:
  time=UNLIMITED;
  ensemble=25;
variables:
 float time(time) ;
                time:long_name = "time" ;
                time:units = "2021-10-07 12:00:00" ;
                time:calendar = "gregorian" ;
                time:standard_name = "time" ;
                time:axis = "T" ;

float pr(ensemble, time, rlon, rlat) ;
                pr:grid_mapping_name = "latitude_longitude" ;
                pr:coordinates = "lon lat" ;
                pr:shortname = "Quantity of precipitation" ;
                ...
                pr:standard_name = "precipitation_amount" ;

Then it is easy to see that you can add the percentile information using something like cell_methods="ensemble: sum".
Note that sum in cell_methods does not necessary mean "sum", but rather some form of "sum or accumulation", see CF Conventions 1.9, Appendix E.

Allow me also to comment that your use of rlon and rlat suggests the use of a rotated grid as is common for example in CORDEX. If this is indeed the case, you probably don't want to use the latitude_longitude grid mapping and might want to review CF Conventions 1.9, Section 5.6 and Appendix F here and here.

@DikraK
Copy link
Author

DikraK commented Oct 12, 2021

Hi @zklaus, thanks a lot for all the valuable information you provided.

I may have missed something but I still cannot find how to add the information on the percentile values across the 25 fields. In Appendix E, I can't find a function related to percentile estimates.

I take note of the advice related to the grid and indeed I use a rotated grid, so I'll modify that according to your comment.

@zklaus
Copy link

zklaus commented Oct 12, 2021

@DikraK you are correct that this information can at the moment not be encoded in the cell methods. Your request is rather timely since we are discussing similar issues in cf-convention/vocabularies#19, but no consensus on how to add this to the conventions has been reached yet.

If you want to put that information into your files already now, you might take inspiration from the (still evolving) Example 3 in cf-convention/vocabularies#19.

@DikraK
Copy link
Author

DikraK commented Oct 12, 2021

Thanks I'll follow this discussion then.

@DikraK DikraK closed this as completed Oct 12, 2021
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

2 participants