You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now, Argopy has focused on accessing/reading/loading Argo data as xarray datasets.
But for operators who modify the content of a dataset, by adding calibration information for instance, there is a need to be able export these updated/augmented xarray datasets to netcdf files, following the Argo conventions for variables encoding.
This should requires a static dictionary asset with all possible Argo variables and the corresponding encoding information.
One tricky part is for string variables.
For instance:DATA_TYPE is encoded as an array of dtype('S1') with length 16, along a STRING16 dimensions, in netcdf files
Hence, when decoded abruptly with xarray, it is returned as 16 values with dtype=|S1], along a STRING16 dimensions of length 16.
But after variable casting by argopy, this variable is more appropriately returned as 1 value with dtype=<U16
A possible API could be:
# Load raw data (but appropriately casted by argopy):ds=ArgoFloat(WMO).open_dataset('prof')
# [...] Do some stuff on ds # Export dataset as a clean Argo netcdf file:ds.argo.to_netcdf('updated.nc', convention='Argo-3.1 CF-1.6')
The goal would be for the new netcdf to pass the Argo file checker and be valid for submission to a DAC
The text was updated successfully, but these errors were encountered:
As of now, Argopy has focused on accessing/reading/loading Argo data as xarray datasets.
But for operators who modify the content of a dataset, by adding calibration information for instance, there is a need to be able export these updated/augmented xarray datasets to netcdf files, following the Argo conventions for variables encoding.
This should requires a static dictionary asset with all possible Argo variables and the corresponding encoding information.
One tricky part is for string variables.
For instance:
DATA_TYPE
is encoded as an array ofdtype('S1')
with length 16, along aSTRING16
dimensions, in netcdf filesHence, when decoded abruptly with xarray, it is returned as 16 values with
dtype=|S1]
, along aSTRING16
dimensions of length 16.But after variable casting by argopy, this variable is more appropriately returned as 1 value with
dtype=<U16
A possible API could be:
The goal would be for the new netcdf to pass the Argo file checker and be valid for submission to a DAC
The text was updated successfully, but these errors were encountered: