Skip to content

Commit

Permalink
Merge pull request #325 from OCHA-DAP/tcd-quick-update
Browse files Browse the repository at this point in the history
TCD biomass update
  • Loading branch information
caldwellst authored Oct 12, 2023
2 parents 341cf5c + 6aab748 commit d17031d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
8 changes: 5 additions & 3 deletions analyses/ner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

[![Generic badge](https://img.shields.io/badge/STATUS-ENDORSED-%231EBFB3)](https://shields.io/)

Endorsed in 2021. Did not activate in 2021.
Last updated: Sep 2021
Endorsed in Dec 2021 and July 2022. The observational trigger was met and the framework was activated in August 2022.
Last updated: Sep 2022

## Background information

Anticipatory action in Niger aims to preemptively respond to drought. The trigger was defined to reflect a 1 in 3 year event. It is evaluated once monthly between January and June, inclusively. It is monitored by IRI/WFP (through their tool Maproom) and uses analysis developed specifically for this purpose. CHD provided guidance but did not perform data analysis for this project. Forecasts, groundtruth dataset, impact data: presented by the IRI/WFP collaboration.
Anticipatory action in Niger aims to preemptively respond to drought. The triggers are precipitation-focused and were defined to reflect a 1 in 3 year event. A forecast-based trigger (forecasting July-August-September) is evaluated once monthly between January and June, inclusively. An observational trigger is evaluated once in early August based on the SPI for June - July.

It is monitored by IRI (through their tool Maproom) with data shared by the Direction de la météorologie nationale du Niger. and uses forecasts developed specifically for this purpose. CHD provided guidance but did not perform data analysis for this project. Forecasts, groundtruth dataset, impact data: provided by a collaboration between Direction de la météorologie nationale, AGRHYMET, IRI, WFP.
15 changes: 12 additions & 3 deletions analyses/tcd/notebooks/observations/tcd_biomasse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from pathlib import Path
import sys
import os

# quick fix for changing env variables from AA to OAP
os.environ["AA_DATA_DIR"] = os.environ["OAP_DATA_DIR"]
import geopandas as gpd

path_mod = f"{Path(os.path.dirname(os.path.abspath(''))).parents[2]}/"
Expand All @@ -30,12 +31,20 @@ import src.indicators.drought.biomasse as bm
This is just the code for downloading and procesing the Biomasse data, then aggregating to a specific set of admin codes (our region of interest in Chad. Additional analysis and exploration is done within `biomasse_exploration.R`.

```python
# bm.download_dmp()
# dmp = bm.calculate_biomasse(admin_level="ADM2")
bm.download_dmp()
dmp = bm.calculate_biomasse(admin_level="ADM2")
gdf_adm2 = gpd.read_file(adm2_bound_path)
gdf_reg = gdf_adm2[gdf_adm2.area_of_interest == True]
bm_df = bm.aggregate_biomasse(
admin_pcodes = gdf_reg.admin2Pcod,
iso3 = "tcd"
)
```

We are activating if the `biomasse_anomaly` is below 80 in the 24th dekad of 2023. We can quickly check that below.

```python
bm_df
```


8 changes: 4 additions & 4 deletions src/indicators/drought/biomasse.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
from src.utils_general.utils import download_ftp

_BASE_URL = (
"http://80.69.76.253:8080/geoserver"
"http://213.206.230.89:8080/geoserver"
"/Biomass/wfs?&REQUEST="
"GetFeature&SERVICE=wfs&VERSION=1.1.0"
"&TYPENAME=WA_DMP_{admin_level}_ef_v0&"
"outputformat=CSV&srsName=EPSG:4326"
"&TYPENAME=WA_DMP_{admin_level}_ef_v1&"
"outputformat=csv&srsName=EPSG:4326"
)

_RAW_FILENAME = "WA_DMP_{admin_level}_ef_v0.csv"
Expand Down Expand Up @@ -78,7 +78,7 @@ def download_dmp(admin_level: AdminArgument = "ADM2") -> None:
None
"""
_check_admin(admin_level)
url = _BASE_URL.format(admin=admin_level)
url = _BASE_URL.format(admin_level=admin_level)
raw_path = _get_raw_path(admin_level)
download_ftp(url=url, save_path=raw_path)

Expand Down

0 comments on commit d17031d

Please sign in to comment.