-
Notifications
You must be signed in to change notification settings - Fork 3
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
C3S Fire Burned Area Pixel product not correctly readable #36
Comments
variable: short JD(time=1, lat=20880, lon=28440); This workoraound seems to be working: str_first_day_of_obs_year= '2022-01-01T00:00:00.000' |
Thank you for reporting this issue. ba_pixel_data = ek.data.from_source("file", f"{LOCAL_DATA_DIR}/ba_pixel_04_2022_europe.zip") what do you do with |
import matplotlib as mpl cmap = mpl.colors.ListedColormap([ bounds = [-2, -1, 0, 1, 25, 50, 100, 200, 300, 365] Spatial subset selectionmin_lon = 14 data_ba_pixel=ba_pixel_data.to_xarray(decode_cf=False, decode_times=False) str_first_day_of_obs_year= str(data_subset_ba_pixel.coords['time'].values[0]).split('-')[-3] + '-01-01T00:00:00.000' Set plot titletime_str= str(data_subset_ba_pixel_2D.coords['time'].values[0]).split('-')[-3] + '/' + str(data_subset_ba_pixel_2D.coords['time'].values[0]).split('-')[-2] Create the figureax = plt.axes(projection=ccrs.PlateCarree()) #show figure #save figure |
Thank you for sending the details. When calling data_ba_pixel=ba_pixel_data.to_xarray(xarray_open_mfdataset_kwargs=dict(decode_cf=False, decode_times=False)) |
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)
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
Accompanying data
No response
Organisation
No response
The text was updated successfully, but these errors were encountered: