Skip to content

2. Getting Started

Ivan Zvonkov edited this page Mar 8, 2023 · 1 revision

The page presents a checklist for everything needed to begin contributing to the crop-mask project.

Tools Checklist

Github - where the code lives

Github

What you need:

  • Github account - for accessing code

Resources:

Git - tool for version control

Git

What you need:

  • git installed locally - for making updates to code

Resources:

Python - programming language used in crop-mask

Python

What you need:

  • Anaconda installed locally (run conda --version once downloaded to verify install)

Resources:

  • An Intro to Python from Dr. Hannah Kerner's CSE572 course: Open In Colab
Google Colab - executing Python code

Google Colab

What you need:

  • Google/Gmail account

Resources:

Google Cloud - scalable storage and compute

Google Cloud

What you need:

  • Requested access to crop-mask Google Cloud Project
  • Install gcloud CLI

Resources:

Data Version Control (dvc) - data and model versioning

Data Version Control (dvc)

Will be installed as part of project setup.

Resources:

Visual Studio Code - code editor

Visual Studio Code

Resources:

Project Setup

1. Clone the project

git clone the crop-mask repository to your local machine

git clone git@github.com:nasaharvest/crop-mask.git 

2. Set up the Python environment (using anaconda)

conda install mamba -n base -c conda-forge  # Install mamba
mamba env create -f environment-dev.yml     # Create environment with mamba (faster)
conda activate landcover-mapping            # Activate environment (has to run each time new command line is opened)

Installing the environment on a Windows machine may present issues with fiona, geopandas, netcdf4, pyproj. To address these run the following:

pip uninstall geopandas 
pip install pipwin
pipwin install gdal fiona
pip install geopandas
pip uninstall netcdf4 pyproj
pip install netcdf4 pyproj

3. Pull the data and models locally using dvc

gcloud auth application-default login    # Login to Google Cloud
dvc pull                                 # Pull latest data (should see new folders in data/ directory)