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

grid mapping definitions of CNRM-ALADIN64E1 #35

Open
larsbuntemeyer opened this issue Jan 25, 2025 · 3 comments
Open

grid mapping definitions of CNRM-ALADIN64E1 #35

larsbuntemeyer opened this issue Jan 25, 2025 · 3 comments

Comments

@larsbuntemeyer
Copy link
Contributor

For example:

int Lambert_Conformal ;
		Lambert_Conformal:grid_mapping_name = "latitude_longitude" ;
		Lambert_Conformal:latitude_of_projection_origin = 49.5 ;
		Lambert_Conformal:standard_parallel = 49.5 ;
		Lambert_Conformal:longitude_of_central_meridian = 10.5 ;
		Lambert_Conformal:false_easting = 0. ;
		Lambert_Conformal:false_northing = 0. ;

@pierrenabat
The grid mapping name here should be lambert_conformal_conic, not latitude_longitude. This will not work with CF compliant tools.

See also this comment

@pierrenabat
Copy link

Hello Lars, thanks for pointing out this error, indeed it should be "lambert_conformal_conic", I will correct it

@larsbuntemeyer
Copy link
Contributor Author

Thanks! It's not a big issue for the evaluation overview, the rest of the grid definition (lon/lat) and bounds seem fine.

@larsbuntemeyer
Copy link
Contributor Author

larsbuntemeyer commented Jan 29, 2025

@pierrenabat I can make a reasonable plot of CNRM-ALADIN64E1 orography with the following fix (based on HCLIM43-ALADIN grid):

import cartopy.crs as ccrs
import cartopy.feature as cf
import matplotlib.pyplot as plt

import xarray as xr

cnrm  = xr.open_dataset("/mnt/CORDEX_CMIP6_tmp/sim_data/CORDEX/CMIP6/DD/EUR-12/CNRM-MF/ERA5/evaluation/r1i1p1f1/CNRM-ALADIN64E1/v1-r1/fx/orog/v20250116/orog_EUR-12_ERA5_evaluation_r1i1p1f1_CNRM-MF_CNRM-ALADIN64E1_v1-r1_fx.nc")
smhi = xr.open_dataset("/mnt/CORDEX_CMIP6_tmp/sim_data/CORDEX/CMIP6/DD/EUR-12/HCLIMcom-SMHI/ERA5/evaluation/r1i1p1f1/HCLIM43-ALADIN/v1-r1/fx/orog/v20241205/orog_EUR-12_ERA5_evaluation_r1i1p1f1_HCLIMcom-SMHI_HCLIM43-ALADIN_v1-r1_fx.nc")

# fix coordinates, see e.g. SMHI coordinates
cnrm['x'] = cnrm.x * 1000. + 100000. 
cnrm['y'] = cnrm.y * 1000. + 100000.

transform = ccrs.LambertConformal(central_longitude=10.5, central_latitude=49.5, 
                                  false_easting=2924999.9999999995, false_northing=2924999.9999999986,
                                  standard_parallels=(49.5, 49.5),
                                  globe=None, cutoff=-30)

def plot(ds):
    plt.figure(figsize=(10,8))
    ax = plt.axes(projection=transform)
    ax.gridlines(draw_labels=True, linewidth=0.5, color='gray',
                xlocs=range(-180,180,10), ylocs=range(-90,90,5))
    ds.orog.plot(ax=ax, transform=transform, cmap="terrain", vmin=-500, vmax=3000)
    ax.coastlines(resolution='50m', color='black', linewidth=1)
    ax.add_feature(cf.BORDERS)

plot(cnrm)

Image

As you can see, i used grid mapping definitions from HCLIM43-ALADIN (it has definitions of false_easting and false_northing which are missing in CNRM-ALADIN64E1). I also had to convert coordinates to m and add a shift (like inHCLIM43-ALADIN).

@gnikulin: I'm no expert in lambert conformal grids, but to me it seems, that CNRM-ALADIN64E1 should have the same grid definitions as HCLIM43-ALADIN for EUR-12?

see, e.g.,

smhi.crs.attrs
{'grid_mapping_name': 'lambert_conformal_conic',
 'standard_parallel': np.float64(49.5),
 'longitude_of_central_meridian': np.float64(10.5),
 'latitude_of_projection_origin': np.float64(49.5),
 'false_easting': np.float64(2924999.9999999995),
 'false_northing': np.float64(2924999.9999999986),
 'earth_radius': np.float64(6371229.0),
 'proj4': '+proj=lcc +lat_1=49.500000 +lat_2=49.500000 +lat_0=49.500000 +lon_0=10.500000 +k_0=1.0 +x_0=2925000.000000 +y_0=2925000.000000 +a=6371229.000000 +b=6371229.000000'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants