Installation Instructions#

Setting up the Python environment#

On the UMD cluster, first load the anaconda module and create a clone environment by typing the following commands on the terminal:

module load python/3.7/anaconda
conda create -n UMD --clone=/apps/python/3.7/anaconda

On a non-UMD cluster or local machine, download and install the latest anaconda package:

wget -c https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
bash Anaconda3-2022.05-Linux-x86_64.sh
conda create --name UMD

Note

You can replace UMD with a different environment name of your choice

Next copy-paste the following commands into the terminal for both UMD and non-UMD machines:

conda activate UMD
conda install -c conda-forge logzero
conda install -c conda-forge netcdf4
conda install -c conda-forge gdal
conda install -c conda-forge rasterio
conda install -c conda-forge pyresample
conda install -c conda-forge cdsapi
conda install -c conda-forge geopandas
conda install -c conda-forge seaborn
conda install -c conda-forge xarray
conda install -c conda-forge rasterstats
conda install -c conda-forge tqdm
conda install -c conda-forge scikit-learn
conda install -c conda-forge jupyterlab
conda install -c conda-forge catboost
conda install -c conda-forge arrow
conda install -c anaconda netcdf4
conda install -c conda-forge cartopy
conda install -c conda-forge tsfresh
conda install -c conda-forge matplotlib-scalebar
pip install wget 
pip install pyModis 
pip install merf 
pip install pyshp 
pip install palettable 
pip install geopy 
pip install geocoder 
pip install palettable 
pip install --upgrade git+https://github.com/ritviksahajpal/pygeoutil.git

Creating a NASA account to download MODIS NDVI#

  1. Create an account on the NASA LAADS DAAC website

  2. Follow the instructions here to request a token for your account

    • Login by going to Profile -> Earthdata Login
      profile

    • Enter your login credentials or register
      login

    • Select Profile -> Generate Token from the top menu
      generate token

    • Copy the token from this window and store it somewhere safe and secure token

  3. On your local machine/cluster, iIf not already installed, install octvi

  4. On the command prompt type octviconfig and at the place it asks for a token, paste the token you copied earlier.

Creating a Copernicus account to download AgERA5#

  1. If not already installed, install the cdsapi python library by typing pip install cdsapi in the command prompt.

  2. Create an account on the CDS website

  3. Follow the instructions here to install the CDS API key on your local machine/cluster

  4. Follow these instructions to install the CDS API Key on your local machine/cluster

    • For Windows users:

      • Login to CDS
        CDSLogin

      • Copy a 2 line code, which shows a url and your own uid:API key details as followed:

      • For CDS users, Go to this page and copy the 2 line code displayed in the black box as shown below:
        url:https://cds.climate.copernicus.eu/api/v2
        key: {uid}:{api-key}

      • Paste the 2 line code into a %USERPROFILE%.cdsapirc file, where in your windows environment, %USERPROFILE% is

      • usually located at C:\Users\Username folder). The CDS API expects to find the .cdsapirc file in your home directory.

      • Install the CDS API client by running the following command in a command prompt window: pip install cdsapi

      • Once the CDS API client is installed, it can be used to request data from the datasets listed in the CDS and ADS catalogues. It is necessary to agree to the Terms of Use of every datasets that you intend to download. Attached to each dataset download form, the “Show API request” button displays the python code to be used.

    • For Linux users:

      • If you don’t have an account, please self register at the CDS registration page

      • If you are not logged, please login and go to the step below.

      • Copy the code displayed into HOME/.cdsapirc file (in your Unix/Linux environment).
        url:https://cds.climate.copernicus.eu/api/v2
        key: {uid}:{api-key}

      • The CDS API client is a python based library. You can install the CDS API client via the package management system pip, by running on Unix/Linux the command
        pip install cdsapi

Installing geoprepare library#

A Python library to prepare (download, extract, process input data) for GEOCIF and related models

Using PyPi (default)#

pip install --upgrade geoprepare

Using Github repository (for development)#

pip install --upgrade --no-deps --force-reinstall git+https://github.com/ritviksahajpal/geoprepare.git

Installing geocif library#

A Python library for models built to forecast and visualize crop conditions and yields

pip install git+https://github.com/ritviksahajpal/geocif.git