ProjectionsΒΆ

[1]:
import earthkit.data as ekd
[2]:
efas = ekd.from_source("sample", "efas.grib").to_fieldlist()
efas.ls()
ECCODES WARNING :  g2date:unpack_long: Date is not valid! year=0 month=0 day=0
[2]:
parameter.variable time.valid_datetime time.base_datetime time.step vertical.level vertical.level_type ensemble.member geography.grid_type
0 dis06 2022-10-08 18:00:00 2022-10-08 12:00:00 0 days 06:00:00 0 surface 0 lambert_azimuthal_equal_area
[3]:
projection = efas[0].geography.projection()
print(projection)
+proj=laea +lon_0=10.000000 +lat_0=52.000000 +a=6378137.000000 +b=6356752.314000
[4]:
projection.to_proj_string()
[4]:
'+proj=laea +lon_0=10.000000 +lat_0=52.000000 +a=6378137.000000 +b=6356752.314000'
[5]:
projection.to_cartopy_crs()
[5]:
2026-03-13T19:27:07.321321 image/svg+xml Matplotlib v3.10.7, https://matplotlib.org/
<cartopy.crs.LambertAzimuthalEqualArea object at 0x111be02f0>
[6]:
print(projection.parameters)
print(projection.globe)
{'central_longitude': 10.0, 'central_latitude': 52.0}
{'semimajor_axis': 6378137.0, 'semiminor_axis': 6356752.314}
[7]:
era5 = ekd.from_source("sample", "test.grib").to_fieldlist()
era5.ls()
[7]:
parameter.variable time.valid_datetime time.base_datetime time.step vertical.level vertical.level_type ensemble.member geography.grid_type
0 2t 2020-05-13 12:00:00 2020-05-13 12:00:00 0 days 0 surface 0 regular_ll
1 msl 2020-05-13 12:00:00 2020-05-13 12:00:00 0 days 0 surface 0 regular_ll
[8]:
projection = era5[0].geography.projection()
print(projection)
+proj=longlat +datum=WGS84 +no_defs +type=crs
[9]:
projection.to_proj_string()
[9]:
'+proj=longlat +datum=WGS84 +no_defs +type=crs'
[10]:
projection.to_cartopy_crs()
[10]:
2026-03-13T19:27:07.731876 image/svg+xml Matplotlib v3.10.7, https://matplotlib.org/
<cartopy.crs.PlateCarree object at 0x1321c6550>
[11]:
print(projection.parameters)
{}