-
Notifications
You must be signed in to change notification settings - Fork 39
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
Zonal and meridional statistics preprocessor #24
Comments
I think that the absence of In the zonal direction, the weighting is less of a problem. |
One thing I'm working on here is adding When ESMValTool is unable to locate |
if the masking is done in the preprocessor, if fx files are not found, the code defaults to applying Natural Earth masks instead |
It doesn't work like this in the Should the error message be added in the |
So i guess the problem I'm seeing right now is: Why can't ESMValTool find the FX files anymore? Another point is that none of the preprocessor tests include fx files. How can we write tests that include fx files? |
Help @valeriupredoi! None of my recipes are able to find the fx_files anymore on my local desktop! Can anyone else test a recipe that requires an fx_file to be loaded? @schlunma - have you had this problem? |
@ledm I literally just ran a recipe with fx files grabbed from a local repo, all fine, are you using CMIP6? If so, there are missing input structures for fx files in |
Which recipe? Are you 100% sure that it did actually load and use the fx files? Several of the preprocessors have a fall-back option if they can't find the fx_files. Also, in my case, I'm clearly seeing that ESMValTool can see the fx files, but the preprocessor can not find them! |
well they are needed in the diagnostic so that'd fail if there was no fx file in the metadata file. I ran the |
cheers, will test now with that |
on the branch now, it finds the fx files and it says it's using them but I am running in this before anything else is done diagnostic-wise:
|
Yes, I'm working on that preprocessor in branch |
If you want to look at the same Core branch, it's in |
So, my conclusion to this is that there's been a change in the way that recipes work. Edit: Either that or fx_files have never worked as I thought they did! In order to get the recipe to work, I needed to move the |
What about observational datasets? The function should work for those too I think. |
Load a variable of interest + fx variable from file using iris, slice both cubes so they are small (i.e no more than a couple of points) and look at the data and coordinates. You can use this to create the cubes needed for the tests. Does that help? |
Note that there are two ways in which the recipe uses fx_files:
|
How should we differentiate in the preprocessor whether a preprocessor requires an fx file or not? I think it should fail for model data when no FX file is available. Especially when the model uses irregular grids. There's an argument that regular grids are easier for Iris to calculate - however Bill Little mentioned that the
Sort of. Will the new sliced data and fx file need to be added to the git repository in testing data or something?
I just spoke with V and I think it would be worth shelving this part of the work until #21 has completed. |
I think this is something we could implement in _recipe.py, because we know what dataset we are building a preprocessor for there. Can you make a separate issue for it?
I would just create the iris cube in code and save it to a temporary file if you need to read it from file for your test. |
Created issue #103. |
@ledm your mysteriously vanishing fx files are behaving like this because you need to specify the
the
so that the block reads:
with that in all you fx ducks are in line (if the files actually exist on ESGF or your local DB). There is however, some bad coding in the stats functions themselves because I get this (after some running):
which suggests to me that you are applying a 2d mask on 3d data 🍺 |
Thanks V! Did we always have to specify the fx_file in the preprocessor - or is that a new thing? So far, I've always been specifying it in the diagnostics. Perhaps my recipes have been wrong all along (There was no documentation or examples at the time so I refuse to feel too guilty about that!) I can't tell for sure whats happening with your shapes not matching - as I can't tell which preprocessor/diagnostic you're running. However, this may be a problem if the grid fx does not receive the same preprocessing as the dataset. For instance, if the extract_region preprocessor reduces the grid from Perhaps the solution is for |
I dunno, may be a mistake in my recipe, I added No, there was no documentation and in fact it is the first time I see myself the addition of |
well actually here's the bugger:
you are applying a (216, 360) mask on a (48, 10, 96, 21) cube and the catcher in the
so yeah, you need to extract the area and levels the same way for the fx mask as for the data |
Exactly, that's what I've been saying! The preprocessor needs to be applied to the fx files as well as the actual dataset. This doesn't happen if the |
Use
|
ah I shed a tear everytime I see |
I'm back to work on this issue, starting from @valeriupredoi's new PR #170. I'm slowing coming to the conclusion that we can not sensibly produce zonal or meridional statistics for irregular grids. This is because iris can't apply iris.analysis functions along one dimension of an irregular grid. It simply does not work at the moment. The iris.analysis functions can only be applied along the x-y axis of an array, not along an arbitrary This means that if we want to calculate zonal or meridional statistics for irregular grids, we need to regrid the data to a regular grid, then apply the zonal or meridional statistics to that regular grid. This requires ESMValTool to regrid the fx_files ( So, I propose that we do not support zonal or meridional statistics for irregular grids. Any thoughts? |
fix in #214 now 🍺 |
Nope! these changes are obsolete, all is done up in |
I'm not sure that this issue was ever resolved. As @mattiarighi just pointed out to me in an email, the |
Apparently it's just about renaming |
To summarise where this issue got to, we encountered 3 main problems with zonal and meridional statistics:
Looks like there's been progres with issues 1 and 3 here, but what about issue 2? |
For consistency with the other |
This is an extension of Issue #1117 and PR #1123.
The following jobs need to be completed for the documentation paper (Table 1).
zonal_means
preprocesor function into two functions:zonal_statistics
andmeridional_statistics
.mean_type
tooperator
, like in the newarea_statistics
fx_files
.get_iris_analysis_operation
function in a new file,_shared.py
in the preprocesor folder.volume_statistics
function, and add documentation to the header of that function.The text was updated successfully, but these errors were encountered: