Closed forman closed 3 years ago
You can now provide your Python code for customization of the datasets read and written. (#16)
input/custom_preprocessor: "module:function"
process/custom_processor: "module:function"
Both "function"s are expected to receive an xarray.Dataset object as only argument and return the same or modified xarray.Dataset object.
"function"
xarray.Dataset
Note: to let Python import "module" that is not a user package, you can extend the PYTHONPATH environment variable before calling nc2zarr:
"module"
PYTHONPATH
nc2zarr
export PYTHONPATH=${PYTHONPATH}:path/to/my/modules nc2zarr ...
This PR has is already used for producing the CCI GHG CO2 Zarr dataset and seems to work as expected.
You can now provide your Python code for customization of the datasets read and written. (#16)
input/custom_preprocessor: "module:function"
is called on each input after optional variable selection.process/custom_processor: "module:function"
is called after optional renaming and before optional rechunking.Both
"function"
s are expected to receive anxarray.Dataset
object as only argument and return the same or modifiedxarray.Dataset
object.Note: to let Python import
"module"
that is not a user package, you can extend thePYTHONPATH
environment variable before callingnc2zarr
:This PR has is already used for producing the CCI GHG CO2 Zarr dataset and seems to work as expected.