#2460 introduced the convert module of Parcels, which hints at a new API for Parcels.
- Use (e.g.)
convert.nemo_to_sgrid to convert data from the input data format to an SGRID compliant dataset - explicitly providing what fields they want to use
- (optional) Modify the dataset
- Pass the resulting dataset to
FieldSet.from_sgrid_conventions() to ingest the rest
This allows users to have full control of the data ingestion process, as well as modify/correct the SGRID metadata before passing to the rest of Parcels.
Note that Parcels won't automatically discover metadata when it comes to fields - these need to be explicitly provided by the user. This makes our API more explicit and controllable by the user - removing some guesswork as to which variables they want to use for U and V - and also will promote users using cf_xarray more (via the ds.cf repr provided by cf_xarray).
This also means that the only metadata inspection needed by Parcels would be:
- on the dimensions
- on the coordinates
- units (on the fields, and on coords/dims)
- SGRID conventions
There won't be a need to look at standard names.
The following functions will need to be made to complete the conversion across to this conversion module:
convert.copernicusmarine_to_sgrid (and remove FieldSet.from_copernicusmarine)
convert.mitgcm_to_sgrid
convert.croco_to_sgrid
convert.mom5_to_sgrid
- ...
It's still to be decided what the final API for these conversion methods are - and whether they all have the same API (which depends on the details of the models being supported).
It's also currently not clear what the ingestion for unstructured grids look like, and whether functions like convert.fesom2_to_ugrid will be made.
#2460 introduced the
convertmodule of Parcels, which hints at a new API for Parcels.convert.nemo_to_sgridto convert data from the input data format to an SGRID compliant dataset - explicitly providing what fields they want to useFieldSet.from_sgrid_conventions()to ingest the restThis allows users to have full control of the data ingestion process, as well as modify/correct the SGRID metadata before passing to the rest of Parcels.
Note that Parcels won't automatically discover metadata when it comes to fields - these need to be explicitly provided by the user. This makes our API more explicit and controllable by the user - removing some guesswork as to which variables they want to use for U and V - and also will promote users using cf_xarray more (via the
ds.cfrepr provided bycf_xarray).This also means that the only metadata inspection needed by Parcels would be:
There won't be a need to look at standard names.
The following functions will need to be made to complete the conversion across to this conversion module:
convert.copernicusmarine_to_sgrid(and removeFieldSet.from_copernicusmarine)convert.mitgcm_to_sgridconvert.croco_to_sgridconvert.mom5_to_sgridIt's still to be decided what the final API for these conversion methods are - and whether they all have the same API (which depends on the details of the models being supported).
It's also currently not clear what the ingestion for unstructured grids look like, and whether functions like
convert.fesom2_to_ugridwill be made.