From 60334a8e10cb216a43966757d8c0e0d6eab38839 Mon Sep 17 00:00:00 2001 From: Andres Chamorro Date: Tue, 8 Oct 2024 14:44:47 -0400 Subject: [PATCH 1/2] setup instructions --- notebooks/agriculture/README.md | 38 ++++++++++++++++++++++++++++++++ reports/agriculture/report.ipynb | 4 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/notebooks/agriculture/README.md b/notebooks/agriculture/README.md index 2570312..b12c182 100644 --- a/notebooks/agriculture/README.md +++ b/notebooks/agriculture/README.md @@ -7,3 +7,41 @@ Using NASA remote sensing data, analyze changing trends in plantings. For each y Using NASA remote sensing data, prepare historical drought analysis for Niger and bordering countries. Estimate hectares of farmland where drought has occurred over the past 5 years. Combine the past 5 years of planting, drought, and conflict statistics to determine to what extent droughts and conflict may have impacted plantings. + +## Setup + +```bash +conda create -n niger python=3.10 +conda activate niger +pip install ipykernel +python -m ipykernel install --user --n niger +cd Repos # or any directory to save repositories +git clone https://github.com/andresfchamorro/phenolopy.git +cd phenolopy +git checkout -b dev +git pull origin dev +cd .. +pip install earthengine-api +python -m pip install git+https://github.com/worldbank/GEE_Zonal.git +pip install geemap +pip install xarray +pip install geojson +pip install tqdm +pip install dask[distributed] +pip install plotnine +pip install rasterstats +``` + +## Notebooks + +- **evi-reference.ipynb**: Extracts vegetation index for static crop areas, defines a baseline, and examines how the current season relate to the baseline. + +- **evi-timesat**: Seasonality analysis of EVI data. + +- **evi-classification.ipynb**: Random forest classifier to predict active crops based on seasonality parameters, based on example from https://learn.geo4.dev/Satellite%20Crop%20Mapping.html. + +- **evi-conflict.ipynb**: Overlay conflict data and EVI. + +- **crop-area-zs**: Zonal statistics of crop areas. + +- **drought.ipynb**: Drought analysis. \ No newline at end of file diff --git a/reports/agriculture/report.ipynb b/reports/agriculture/report.ipynb index b1121f9..18306e0 100644 --- a/reports/agriculture/report.ipynb +++ b/reports/agriculture/report.ipynb @@ -2192,7 +2192,7 @@ "**Accuracy of the Model**: 0.809 \n", "**R-Squared**: 0.227 \n", "\n", - "See more details in [notebook](evi-classification.ipynb)." + "See more details in [evi-classification notebook](../notebooks/evi-classification.ipynb)." ] }, { @@ -2235,7 +2235,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.10" + "version": "3.11.5" }, "metadata": { "mystnb": { From 22237d09ec0a78822f96197787fa9ad36d544546 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 18:47:16 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/ISSUE_TEMPLATE/project_setup.yaml | 3 +-- README.md | 10 +++++----- notebooks/agriculture/README.md | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/project_setup.yaml b/.github/ISSUE_TEMPLATE/project_setup.yaml index a74211c..41aa000 100644 --- a/.github/ISSUE_TEMPLATE/project_setup.yaml +++ b/.github/ISSUE_TEMPLATE/project_setup.yaml @@ -40,5 +40,4 @@ body: id: assignment-summary attributes: label: Project Assignment - description: Please provide a summary of the project and assignment and, when available, upload work plan shared with client. - + description: Please provide a summary of the project and assignment and, when available, upload work plan shared with client. diff --git a/README.md b/README.md index daac9b4..44fc719 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ## Assignment -The West Africa Prosperity Team has requested support for using alternative data to better understand economic trends in Niger following a coup and civil unrest. +The West Africa Prosperity Team has requested support for using alternative data to better understand economic trends in Niger following a coup and civil unrest. -The assignment covers analysis of crop productivity trends, conflict mapping, monitoring nighttime lights, and understanding population movement trends. +The assignment covers analysis of crop productivity trends, conflict mapping, monitoring nighttime lights, and understanding population movement trends. ## Data @@ -17,11 +17,11 @@ The following datasets are used in this assignmet. Further details about each da * [Digital Earth Africa Cropland Extent Map](https://www.digitalearthafrica.org/platform-resources/services/cropland-extent-map) - The service shows the presence or absence of crop for a 10-meter pixel resolution. -* [MODIS](https://modis.gsfc.nasa.gov/) - NASA's 'Modern Resolution Imaging Spectroradiometer' dataset, used to monitor changes in surface vegetation. +* [MODIS](https://modis.gsfc.nasa.gov/) - NASA's 'Modern Resolution Imaging Spectroradiometer' dataset, used to monitor changes in surface vegetation. * [Meta Co-Loctiaon Maps](https://dataforgood.facebook.com/dfg/tools/colocation-maps) - Colocation Maps measure the probability that two individuals from two locations are found in the same location at the same time. These maps help researchers analyze the probability that people in areas with disease outbreaks will come in contact with new populations. The data can be requested through the [Development Data Partnership](https://datapartnership.org/). - + ## Reusable Data Science Products @@ -36,7 +36,7 @@ The following data products are included in this project: * [Co-Location Analytics](https://datapartnership.org/niger-economic-monitoring/notebooks/movement/README.html) - + ## License diff --git a/notebooks/agriculture/README.md b/notebooks/agriculture/README.md index b12c182..30d72f5 100644 --- a/notebooks/agriculture/README.md +++ b/notebooks/agriculture/README.md @@ -44,4 +44,4 @@ pip install rasterstats - **crop-area-zs**: Zonal statistics of crop areas. -- **drought.ipynb**: Drought analysis. \ No newline at end of file +- **drought.ipynb**: Drought analysis.