Open tiagoams opened 1 year ago
Thanks for reporting. For the time being, I'd like to point you to xcube's plugin for cmems: xcube-cmems. Maybe you will find it simpler to use. It will definitely take off you the hassle to download files to your local computer first.
Thanks for the pointer. I had looked at this plugin but didn't see in the example or documentation how to generate a regrided cube from a cmems data store. Could you please advise?
from https://github.com/dcs4cop/xcube-cmems/blob/main/examples/notebooks/cmems_ds_example.ipynb
cmems_store = CmemsDataStore()
ds = cmems_store.open_data('DMI-BALTIC-SST-L3S-NRT-OBS_FULL_TIME_SERIE','dataset:zarr:cmems',variable_names=['sea_surface_temperature'],time_range=('2022-01-01','2022-01-02'), bbox=[9, 53, 20, 62])
Describe the bug xcube gen fails with an error when generating a datacube from netcdf file with a single flag. The default processor is being used.
This is the structure of the offending file:
To Reproduce xcube, version 1.2.0 installed from conda-forge
ftp://my.cmems-du.eu/Core/OCEANCOLOUR_ATL_BGC_L3_MY_009_113/cmems_obs-oc_atl_bgc-optics_my_l3-multi-1km_P1D/1998/01/19980101_cmems_obs-oc_atl_bgc-optics_my_l3-multi-1km_P1D.nc
gen_cmems_009_113_optics.yml
:output_size: [3200,2304] output_region: [-15.5,42.5000000000,13,63.0000000000000]
output_path: test_optics_v2.zarr
output_writer: zarr
output_resampling: Nearest
output_variables:
processed_variables:
Expected behavior In this case, a zarr file should be created.
Additional context The cause is the flag variables with the attributes
Adding a dummy attribute so that len(flags_meanings) or len(flags_masks)>1 solves the problem: