Facilitates read-in and extraction for ocean model output. Most functions work on both structured and unstructured model output. Unstructured functionality has been tested with FVCOM and SELFE output.
In particular this package can:
- interpolate a model time series to a longitude, latitude location on a 2D grid, while bringing along the calculated z coordinates, with
select() - saves the weights of the interpolation to save time in the accessor if used, or allows user to input
- uses
xESMFfor fast interpolation that respects longitude/latitude grids - find the nearest grid point to a longitude, latitude location on a horizontal grid (structured or unstructured) in
sel2d()usingxoak xoaksaves the calculated index so that subsequent searches are faster- select a sub-region of a structured or unstructured grid in two ways with
sub_bbox()andsub_grid() - has an
xarrayaccessor for convenient access to methods - uses
cf-xarrayto understandxarrayDataset metadata and allow for generic axis and coordinate names as well as calculate vertical coordinates - can preprocess a variety of model output types (including ROMS, HYCOM, POM, and FVCOM) to improve metadata and ease of use
⚠️ If you are using Windows: Horizontal interpolation currently will not work inextract_modeluntilxESMFis installable on Windows. Other functions will work.
Project based on the cookiecutter science project template.
This will install for all operating systems:
conda install -c conda-forge extract_modelbut it includes only minimal requirements. If you want to install packages to run the example docs notebooks and to make unstructured grid subsetting faster, you can additionally install for Windows:
$ conda install --file conda-requirements-opt-win.txtFor running the example docs notebooks, horizontal interpolation (with xESMF), and to make horizontal subsetting faster, install additional packages for Mac and Linux:
$ conda install --file conda-requirements-opt.txtpip install extract_modelClone the repo:
$ git clone https://github.com/axiom-data-science/extract_model.gitIn the extract_model directory, install conda environment (for Mac or Linux):
$ conda env create -f environment.ymlor for Windows:
$ conda env create -f environment-win.ymlFor local package install, after cloning the repository, in the extract_model directory:
$ pip install -e .To also develop this package, install additional packages with:
$ conda install --file requirements-dev.txtTo then check code before committing and pushing it to github, locally run
$ pre-commit run --all-files