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

Extract odd-shaped (irregular) regions #44

Closed
LisaBock opened this issue Mar 7, 2019 · 13 comments
Closed

Extract odd-shaped (irregular) regions #44

LisaBock opened this issue Mar 7, 2019 · 13 comments
Assignees
Labels
preprocessor Related to the preprocessor

Comments

@LisaBock
Copy link
Contributor

LisaBock commented Mar 7, 2019

I would like to extract regions in the preprocessor of the ESMValTool which are not rectangular but as they are defined in the IPCC AR5 or AR6. For example to create the panels for a figure like this:

image

Is there a possibility to include this in the preprocessor functions?

At the moment I do not have the specific region definitions but I could share them when I received them.

@valeriupredoi
Copy link
Contributor

@LisaBock it is very important from the implementation point of view to know which file format your regions are stored in - netCDF/Natural Earth/txt etc and what are the actual parameters of the region ie how it is defined in the file: like a mask of 0s and 1s, like a percentage that we apply a threshold on etc. Without this information I can not implement anything just yet. Cheers!

@ledm
Copy link
Contributor

ledm commented Mar 7, 2019

With regards to the Natural Earth Shapefiles, I can't see anything that names specific marine regions. The closest dataset I can find is the marine indicators, but I suspect that this is simply the national sea boundaries at 200 nautical miles.

I think that the best way to define the oceans right now would be to regrid CMIP models to a standard resolution in the preprocessor, then use an older regional definition mask file in the diagnostic. Do we have a definition file anywhere?

@valeriupredoi
Copy link
Contributor

sftof is used for seas/oceans selection, that is available for most models, for the ones that dont have it we currently use Natural Earth low-res oceans shapefiles; the seas/oceans are not a problem - the problem is continents (and Russia? from the figure above) - we can use shapefiles for those as well but I thought @LisaBock already has a set of region-defining files at hand

@mattiarighi
Copy link
Contributor

I think @LisaBock simply needs to extract regions which are not rectangular, but more generally quadrilateral.

No shapefiles should be required here, but only the possibility of specifying the coordinates of the four (or more) vertices which define the region.

@LisaBock
Copy link
Contributor Author

LisaBock commented Mar 7, 2019

Indeed, for the continental regions it should look like this (polygons with four or five corners):

image

But for the most diagnostics I would need a combination of this subregions.

And for the oceanic regions, I do not know if they are polygons. I asked already for the definitions but have not received them yet.

@bouweandela
Copy link
Member

We already have the preprocessor function extract_region which is able to extract rectangular regions, so I think that should be able to extract most regions.

We also have a recipe that extracts regions based on shapefiles, recipe_shapeselect.yml. This could be used for the more complicated shapes, you will just need to define the shapefiles. You can then run this diagnostic before your own diagnostic, using the ancestors key in the recipe.

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Mar 8, 2019 via email

@valeriupredoi
Copy link
Contributor

actually here's how I see a least-effort/maximum-outcome path to solve this:

  • provide the corners of the rough rectangular approximation of your region in the preprocessor, apply select_region to that to minimize the amount of data that is passed on to the next preproc steps;
  • in diagnostic, use the masking with shp from _mask.py to select your refined region;
    All we'd need in this case is to have the region defined in a shp file and store it somewhere where the diagnostic can see it.

what say you @LisaBock

@LisaBock
Copy link
Contributor Author

LisaBock commented Mar 8, 2019

Okay, I will try it like this. Thanks!

(Just for clarification @valeriupredoi: you mean extract_region instead of select_region, don't you? Or is this a function I do not know?)

@valeriupredoi
Copy link
Contributor

yes that one sorry, I am starting to pull function names out my arse 😁

@valeriupredoi
Copy link
Contributor

hi @LisaBock - is this been done (by you) or you need any help implementing it? 🍺

@mattiarighi mattiarighi transferred this issue from ESMValGroup/ESMValTool Jun 11, 2019
@mattiarighi mattiarighi added the preprocessor Related to the preprocessor label Jun 11, 2019
@mattiarighi
Copy link
Contributor

@LisaBock is this solved? If yes, please close.

@valeriupredoi
Copy link
Contributor

closing since it looks to be solved, please re-open if need be 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preprocessor Related to the preprocessor
Projects
None yet
Development

No branches or pull requests

5 participants