ecmwf / cfgrib

A Python interface to map GRIB files to the NetCDF Common Data Model following the CF Convention using ecCodes
Apache License 2.0
407 stars 77 forks source link

Longitude values greater than 360 #388

Closed malmans2 closed 4 months ago

malmans2 commented 4 months ago

What happened?

When cfgrib is used with eccodes >= 2.35.0, the snippet below returns longitude values greater that 360. I'm not sure whether this is an issue to fix in eccodes or cfgrib, so I'm opening a ticket for both libraries.

What are the steps to reproduce the bug?

import cdsapi
import xarray as xr

client = cdsapi.Client()

collection_id = "reanalysis-carra-single-levels"
request = {
    "level_type": "surface_or_atmosphere",
    "variable": "2m_temperature",
    "product_type": "analysis",
    "time": ["00:00"],
    "domain": "east_domain",
    "month": "12",
    "day": ["01"],
    "year": ["1990"],
}

filepath = client.retrieve(collection_id, request).download()
ds = xr.open_dataset(filepath)

assert (ds["longitude"] <= 360).all()

Version

0.9.13.0

Platform (OS and architecture)

Darwin MacBook-Pro-3.local 22.6.0 Darwin Kernel Version 22.6.0: Mon Apr 22 20:54:28 PDT 2024; root:xnu-8796.141.3.705.2~1/RELEASE_X86_64 x86_64

Relevant log output

No response

Accompanying data

No response

Organisation

B-Open / CADS-EQC

shahramn commented 4 months ago

This is a bug in the ecCodes Geoiterator for the Lambert Conformal grid. I will fix it in the next release. Many thanks