GithubHelp home page GithubHelp logo

Comments (13)

LisaBock avatar LisaBock commented on July 24, 2024 1

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?)

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

@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!

from esmvalcore.

ledm avatar ledm commented on July 24, 2024

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?

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

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

from esmvalcore.

mattiarighi avatar mattiarighi commented on July 24, 2024

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.

from esmvalcore.

LisaBock avatar LisaBock commented on July 24, 2024

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.

from esmvalcore.

bouweandela avatar bouweandela commented on July 24, 2024

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.

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

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

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

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

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

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

from esmvalcore.

mattiarighi avatar mattiarighi commented on July 24, 2024

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

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

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

from esmvalcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.