bcdev / nc2zarr

A Python tool that converts NetCDF files to Zarr format
MIT License
9 stars 3 forks source link

Custom Python processors #18

Closed forman closed 3 years ago

forman commented 3 years ago

You can now provide your Python code for customization of the datasets read and written. (#16)

Both "function"s are expected to receive an xarray.Dataset object as only argument and return the same or modified xarray.Dataset object.

Note: to let Python import "module" that is not a user package, you can extend the PYTHONPATH environment variable before calling 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.