bopen / c3s-eqc-toolbox-template

CADS Toolbox template application
Apache License 2.0
5 stars 4 forks source link

Seamless mapping for EOBS/CERRA/ERA5 #65

Closed sandrocalmanti closed 1 year ago

sandrocalmanti commented 1 year ago

Describe the solution you'd like

Ciao @malmans2

I'm working with the C3S reanalysis CERRA and I started the quality assessment from the work done on this notebooks for EOBS.

https://github.com/bopen/c3s-eqc-toolbox-template/blob/main/notebooks/wp5/EOBS_climatology_air_temperature.ipynb

CERRA uses a Lambert Conformal projection for uniform grid spacing, instead of the rectangular LonLat grid used in other datasets. I made my tailored mapping that works with CERRA and you can find it in this notebook, as well as how the EOBS mapping would work for CERRA.

CERRA_snow-climatology.zip

It's a simple modification of the EOBS mapping. I think it's useful to have a more general mapping function works with different different grids.

For example, I would use it to seamlessy map CERRA, EOBS and ERA5 to show the differences on the native grids

Best!

S.

sandrocalmanti commented 1 year ago

Just a reminder to bring up again this one as I'm trying to finalize the notebook

sandrocalmanti commented 1 year ago

Ciao @malmans2,

I made some substantial progresses on this and I have used the so called tailored mapping developed for the initial examples in these two notebooks attached here in one zip file, one for the climatology of CERRA and one for the extremes.

The notebooks are in their quasi-final form. I'm working on the comments but in terms of output they do just what I need. As above, I started from a template on EOBS so you should find stuff that have been already reviewed.

C3S_520_D5_3_7a_NB2_CERRA.zip

I know this might be quite of a leap from a raw example to a quasi-final notebook, especially after a couple off weeks-off :-D

If needed, I'm available to talk in order to speed-up things. We need to deliver this notebook soon, anyway.

Best!

S.

malmans2 commented 1 year ago

Hi @sandrocalmanti,

I've added a template for cerra vs era5 extrema. I didn't change much, here is what I did:

  1. If you need to include more than 1 year, I'm not sure your method would have worked OK. The templates should now work OK if you need monthly extrema across many years
  2. At the moment storage is OK on the VM, the bottleneck is often downloading from the CDS. Let's cache global ERA5 row data, then we select the region of interest ourselves
  3. The template now only downloads data needed (e.g., if you only need January, we only download January data rather than all months)
  4. I removed Spain from the regions, I think it was using the same coordinates of Italy. Let me know if that was actually on purpose, or send me the correct coordinates to add to the template
  5. I used our plotting function to show spatial weighted statistics near the maps. Nothing wrong with you figure using subplots though!

Here is the template: https://github.com/bopen/c3s-eqc-toolbox-template/blob/main/notebooks/wp5/era5_cerra_extremes.ipynb

malmans2 commented 1 year ago

Hi @sandrocalmanti,

I've also added the CERRA snow-depth template, which is very similar to the era5+cerra extremes I've uploaded yesterday. I've already cached data for January, let me know if you'd like me to pre-populate the cache with other months.

Here it is: https://github.com/bopen/c3s-eqc-toolbox-template/blob/main/notebooks/wp5/cerra_snow_depth_climatology.ipynb

Let me know if everything works as expected.

sandrocalmanti commented 1 year ago

Hi @malmans2

perfetto!

Thanks.

sandrocalmanti commented 1 year ago

No sorry, that was referred to the notebook on storm tracks. Let me check this one as well. I'll let you know about caching the other months.

Cheers

sandrocalmanti commented 1 year ago
  1. Ok, yes I need to do the statistics over more years for snow-depth.
  2. Ok
  3. For the snow climatology I need at least the (extended) winter, from November to April
  4. Ok to remove Spain. In fact I will remove other large areas. I think the quality assessment on CERRA is meaningful on smaller regions
  5. That is nice. The statistics near the maps are sufficient for the quality assessment. I will recycle the spared figure to add a further case on minimum temperatures in a cold climate. Good suggestion.

Looks great and everything works as expected.

sandrocalmanti commented 1 year ago

Hi @malmans2 I have finalized this notebook for submission (deadline on friday).

Since the code is now nicely written to generalize the data retrieval and mapping, I think it is important (and it would also be a quite straightforward user request) to include ERA5-Land in the comparison, i.e. to update the request dictionary as reported below.

I've tried myself but I run out of memory. If you have a way to integrate this dataset, that would be great.

S.

requests_dict = {
    "reanalysis-cerra-single-levels": {
        "variable": "2m_temperature",
        "level_type": "surface_or_atmosphere",
        "data_type": "reanalysis",
        "product_type": "analysis",
        "time": [f"{i:02d}:00" for i in range(0, 24, 3)],
        "format": "grib",
    },
    "reanalysis-era5-single-levels": {
        "product_type": "reanalysis",
        "format": "grib",
        "variable": "2m_temperature",
        "time": [f"{i:02d}:00" for i in range(24)],
    },
    "reanalysis-era5-land": {
        "product_type": "reanalysis",
        "format": "grib",
        "variable": "2m_temperature",
        "time": [f"{i:02d}:00" for i in range(24)],
    },
} 
malmans2 commented 1 year ago

Hi @sandrocalmanti,

It should be fixed now, and I added ERA5-land in the template: https://github.com/bopen/c3s-eqc-toolbox-template/blob/main/notebooks/wp5/era5_cerra_extremes.ipynb

I'm not sure why, but for ERA-5 land we have to explicitly pass the name of the time dimension to the backend (cfgrib). You'll see that I added the backend_kwargs argument.

sandrocalmanti commented 1 year ago

Thank you @malmans2

sandrocalmanti commented 1 year ago

Ciao @malmans2

there is something wrong here.

I have executed the template, and the max temperature for ERA5 Land are unexpectedly low (see attached .zip)

In the .zip you will find also a check on a local file of ERA5-land that we have on our server. The max temperature in August 1985 for Rome is above 35 °C as it ought to be, a value which is somewhere in between ERA5 and CERRA.

Instead, what we get from the template in the approximate position of Rome (12.5E, 42N) is something below 25°C.

Isn't there anthing going on with the with the time dimension so we compute the max over the wrong period, or wrong time of the day?

Let me know if you have time to have a look at this.

era5_cerra_extremes_test.zip

malmans2 commented 1 year ago

You're right, basically we're only looking at midnight. I'm in a meeting, I'll take a look as soon as it ends.

malmans2 commented 1 year ago

I've changed a little the template and should be OK now: https://github.com/bopen/c3s-eqc-toolbox-template/blob/main/notebooks/wp5/era5_cerra_extremes.ipynb

We're not using the backend kwargs anymore and we're using the area parameter in the request to avoid memory issues (ERA-5 CDS queue is not too bad).

Let me know!

sandrocalmanti commented 1 year ago

Great!

Looks good now.

image