When I regrid, the mask resets, and I lose my land mask! I'm using a target grid and area-weighted regridding, and it looks like I'm using an outdated version of iris (3.6.1 instead of 3.15). I'm a little bit lost when looking at the ESMValCore code; could someone give advice or guidance? Do we expect Iris to update the land mask when regridding? Would this be fixed by using a more recent version of Iris? Or should ESMValCore be taking care of it? In what step in the ESMValCore code was the land mask supposed to be regridded?
I have checked that in the canonical ordering, regridding comes after masking, so masking information should be saved. I have also now checked that ESMValCore accepts any version of Iris, so if updating iris would fix this, then the required version should be updated to reflect that.
Cell measures and ancillary variables get dropped as well!
We have seen such issues for other iris (SciTools/iris#5804) functions affecting preprocessor functions (#2166) before. Again, I'm not sure where the problem originates for this function.
I'm able to hack my way around losing the cell area in the context of a jupyter notebook because it can be re-calculated, but I don't know how to handle losing the land_area_fraction ancillary variable because I don't know how to regrid it (it isn't a cube) and don't know how to get it again on the regridded cube (I only see how to add it when first loading the cube). Furthermore, I don't know if I can preserve these hacks when trying to re-formulate my notebook as a recipe. Help appreciated.
@valeriupredoi ? 🍺
Thanks!
Before regridding:

After calling pp.regrid with area_weighted and a target grid:

ESMValCore/esmvalcore/preprocessor/_regrid.py
Line 781 in eb15017
When I regrid, the mask resets, and I lose my land mask! I'm using a target grid and area-weighted regridding, and it looks like I'm using an outdated version of iris (3.6.1 instead of 3.15). I'm a little bit lost when looking at the ESMValCore code; could someone give advice or guidance? Do we expect Iris to update the land mask when regridding? Would this be fixed by using a more recent version of Iris? Or should ESMValCore be taking care of it? In what step in the ESMValCore code was the land mask supposed to be regridded?
I have checked that in the canonical ordering, regridding comes after masking, so masking information should be saved. I have also now checked that ESMValCore accepts any version of Iris, so if updating iris would fix this, then the required version should be updated to reflect that.
Cell measures and ancillary variables get dropped as well!
We have seen such issues for other iris (SciTools/iris#5804) functions affecting preprocessor functions (#2166) before. Again, I'm not sure where the problem originates for this function.
I'm able to hack my way around losing the cell area in the context of a jupyter notebook because it can be re-calculated, but I don't know how to handle losing the
land_area_fractionancillary variable because I don't know how to regrid it (it isn't a cube) and don't know how to get it again on the regridded cube (I only see how to add it when first loading the cube). Furthermore, I don't know if I can preserve these hacks when trying to re-formulate my notebook as a recipe. Help appreciated.@valeriupredoi ? 🍺
Thanks!
Before regridding:

After calling

pp.regridwitharea_weightedand a target grid: