earthkit icon indicating copy to clipboard operation
earthkit copied to clipboard

C3S Fire Burned Area Pixel product not correctly readable

Open gritk opened this issue 2 months ago • 4 comments

What happened?

The function should also have the option of specifying arguments such as decode_cf, decode_times:

ba_pixel_data = ek.data.from_source("file", f"{LOCAL_DATA_DIR}/ba_pixel_04_2022_europe.zip", decode_cf=False, decode_times=False)

I am not able to read the data (C3S Fire Burned Area Pixel Products) correctly with this function. The image shows the content (opened in PANOPLY). With EARTHKIT the data has been interpreted as datetime[ns], but in this case it is not correct because the variable also contains values of 0,-1,-2.

Do you have any idea how to solve the problem without the arguments?

Translated with DeepL.com (free version)

grafik

Data request: c = cdsapi.Client() if DOWNLOAD_FROM_CDS: c.retrieve( 'satellite-fire-burned-area', { 'format': 'zip', 'origin': 'c3s', 'sensor': 'olci', 'version': '1_1', 'year': '2022', 'month': '04', 'nominal_day': '01', 'variable': 'pixel_variables', 'region': 'europe', }, f"{LOCAL_DATA_DIR}/ba_pixel_04_2022_europe.zip")

What are the steps to reproduce the bug?

If you are using the pre-downloaded data then please set DOWNLOAD_FROM_CDS to False

and set the LOCAL_DATA_DIR to where you stored the data.

import cdsapi DOWNLOAD_FROM_CDS = False #True

LOCAL_DATA_DIR = "../data_ba/data/"

Downloading ba-pixel product over Europe

c = cdsapi.Client() if DOWNLOAD_FROM_CDS: c.retrieve( 'satellite-fire-burned-area', { 'format': 'zip', 'origin': 'c3s', 'sensor': 'olci', 'version': '1_1', 'year': '2022', 'month': '04', 'nominal_day': '01', 'variable': 'pixel_variables', 'region': 'europe', }, f"{LOCAL_DATA_DIR}/ba_pixel_04_2022_europe.zip")
# # This command was used to save the data files in our managed storage, # # they are not required for the notebook to run, and your computer will cache the # # results so you don't have to download again ba_pixel_data = ek.data.from_source("file", f"{LOCAL_DATA_DIR}/ba_pixel_04_2022_europe.zip", decode_cf=False, decode_times=False) else: ba_pixel_data = ek.data.from_source("file", f"{LOCAL_DATA_DIR}/ba_pixel_04_2022_europe.zip", decode_cf=False, decode_times=False) ba_pixel_data

Version

earthkit ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/earthkit'] 0.4.2 numpy ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/numpy'] 1.26.4 xarray ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/xarray'] 2024.2.0 pandas ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/pandas'] 2.2.1 geopandas ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/geopandas'] 0.14.3 matplotlib ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/matplotlib'] 3.7.1 cartopy ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/cartopy'] 0.22.0 rasterio ['/home/jovyan/.conda-libs/earthkit/lib/python3.10/site-packages/rasterio'] 1.3.9 cdsapi 0.6.1

Platform (OS and architecture)

Windows 11 Pro

Relevant log output

<xarray.Dataset> Size: 6GB
Dimensions:      (time: 1, lat: 20880, lon: 28440, bounds: 2)
Coordinates:
  * lon          (lon) float64 228kB -26.0 -26.0 -25.99 ... 52.99 53.0 53.0
  * lat          (lat) float64 167kB 83.0 83.0 82.99 82.99 ... 25.01 25.0 25.0
  * time         (time) datetime64[ns] 8B 2022-04-01
Dimensions without coordinates: bounds
Data variables:
    JD           (time, lat, lon) datetime64[ns] 5GB dask.array<chunksize=(1, 1200, 1200), meta=np.ndarray>
    CL           (time, lat, lon) int8 594MB dask.array<chunksize=(1, 1200, 1200), meta=np.ndarray>
    LC           (time, lat, lon) uint8 594MB dask.array<chunksize=(1, 1200, 1200), meta=np.ndarray>
    lon_bounds   (lon, bounds) float64 455kB dask.array<chunksize=(16384, 2), meta=np.ndarray>
    lat_bounds   (lat, bounds) float64 334kB dask.array<chunksize=(16384, 2), meta=np.ndarray>
    time_bounds  (time, bounds) datetime64[ns] 16B dask.array<chunksize=(1, 2), meta=np.ndarray>
    crs          int32 4B ...
Attributes: (12/38)
    title:                      ECMWF C3S Pixel OLCI Burned Area product
    institution:                University of Alcala
    source:                     Sentinel-3 A+B OLCI FR, MODIS MCD14ML Collect...
    history:                    Created on 2022-11-12 06:35:08
    references:                 https://climate.copernicus.eu/
    tracking_id:                cfc08ed4-b87d-4e95-bb14-960378a53ccb
    ...                         ...
    geospatial_lon_units:       degrees_east
    geospatial_lat_units:       degrees_north
    geospatial_lon_resolution:  0.00277778
    geospatial_lat_resolution:  0.00277778
    product_version:            v1.1
    id:                         20220401-C3S-L3S_FIRE-BA-OLCI-AREA_3-fv1.1.nc

Accompanying data

No response

Organisation

No response

gritk avatar Apr 12 '24 14:04 gritk