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

How to select a geographical area #3

Open
sgana1 opened this issue Jul 27, 2023 · 1 comment
Open

How to select a geographical area #3

sgana1 opened this issue Jul 27, 2023 · 1 comment

Comments

@sgana1
Copy link

sgana1 commented Jul 27, 2023

Dear Guido,
I would like to download and display ICON-EU forecasts on a given area of the Mediterranean, e.g. Spain.
What should I change in your code to specify an area of interest limited by lat_min, lat_max, long_min, long_max?
Thank you.

@guidocioni
Copy link
Owner

Hey @sgana1, first of all be advised this project is not polished at all so you'll have to probably go through some steps in order to make it work for you.

Anyhow, the projections are defined here

proj_defs = {
'euratl':
{
'projection': 'mill',
'llcrnrlon': -23.5,
'llcrnrlat': 29.5,
'urcrnrlon': 45,
'urcrnrlat': 70.5,
'resolution': 'l',
'epsg': 4269
},
'euratl_merc':
{
'resolution': 'l',
'llcrnrlon': -23.5,
'llcrnrlat': 29.5,
'urcrnrlon': 45,
'urcrnrlat': 70.5,
'epsg': 3857
},
'it':
{
'projection': 'mill',
'llcrnrlon': 6,
'llcrnrlat': 36,
'urcrnrlon': 19,
'urcrnrlat': 48,
'resolution': 'i',
'epsg': 4269
},
'south_it':
{
'projection': 'mill',
'llcrnrlon': 11,
'llcrnrlat': 36,
'urcrnrlon': 19,
'urcrnrlat': 43,
'resolution': 'i',
'epsg': 4269
},
'de':
{
'projection': 'cyl',
'llcrnrlon': 4.5,
'llcrnrlat': 46.5,
'urcrnrlon': 16,
'urcrnrlat': 56,
'resolution': 'i',
'epsg': 4269
},
'spain_france':
{
'projection': 'mill',
'llcrnrlon': -10,
'llcrnrlat': 34,
'urcrnrlon': 10,
'urcrnrlat': 53,
'resolution': 'i',
'epsg': 4269
},
'western_europe':
{
'projection': 'mill',
'llcrnrlon': -23.5,
'llcrnrlat': 45,
'urcrnrlon': 13,
'urcrnrlat': 70.5,
'resolution': 'i',
'epsg': 4269
},
}

You can add your own projection with custom extents there.

Unfortunately the code expects also an output folder per projection so make sure to add a line here

subfolder_images = {
'euratl': folder_images,
'it': folder_images+'it',
'de': folder_images+'de',
'euratl_merc': folder_images,
'nh_polar': folder_images+'nh_polar',
'south_it': '/tmp',
'spain_france': '/tmp',
'western_europe': folder_images
}

Once you do that you can use your own projection (for example spain) when calling the plotting scripts,

python plot_rain_acc.py spain

Note that I have done some customization for Italy and Germany only; it's up to you to add shapefiles or other stuff in get_projection function here

def get_projection(dset, projection="euratl", countries=True, labels=True, color_borders='black'):

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