Getting Started
Contents
Getting Started#
Prerequisites#
Familiarity with
xarray, since this package is an extension of itPlease visit the xarray documentation to get started.
2. xCDAT is distributed through conda, which is available through Anaconda and Miniconda. The instruction to install conda from Miniconda is provided as follows:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
Then follow the instructions for installation. To have conda added to
your path you will need to type yes in response to “Do you wish the
installer to initialize Miniconda3 by running conda init?” (we recommend
that you do this). Note that this will modify your shell profile (e.g.,
~/.bashrc) to add conda to your path.
Note: After installation completes you may need to type bash to
restart your shell (if you use bash). Alternatively, you can log out and
log back in.
Installation#
Create a conda environment from scratch with
xcdat(conda create)We recommend using the Conda environment creation procedure to install
xcdat. The advantage with following this approach is that Conda will attempt to resolve dependencies (e.g.python >= 3.8) for compatibility.To create an
xcdatconda environment withxesmf(a recommended dependency), run:>>> conda create -n <ENV_NAME> -c conda-forge xcdat xesmf >>> conda activate <ENV_NAME>
Note that
xesmfis an optional dependency, which is required for usingxesmfbased horizontal regridding APIs inxcdat.xesmfis not currently supported on osx-arm64 or windows becauseesmpyis not yet available on these platforms. Windows users can try WSL2 as a workaround.
Install
xcdatin an existing conda environment (conda install)You can also install
xcdatin an existing Conda environment, granted that Conda is able to resolve the compatible dependencies.>>> conda activate <ENV_NAME> >>> conda install -c conda-forge xcdat xesmf
Note: As above,
xesmfis an optional dependency.[Optional] Some packages that are commonly used with
xcdatcan be installed either in step 1 or step 2 above:jupyterlab: a web-based interactive development environment for notebooks, code, and data. This package also includesipykernel.matplotlib: a library for creating visualizations in Python.cartopy: an add-on package formatplotliband specialized for geospatial data processing.