Skip to content

Commit

Permalink
Put workflow into 3-step workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
szwiep committed Aug 26, 2024
1 parent d6ac6d3 commit df17d35
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions docs/notebooks/MEE_worked_example_32.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"\n",
"The workflow can be broken down into 4 steps:\n",
"\n",
"1. Read timeseries data/compute indices\n",
"2. Define the restoration site\n",
"3. Compute a recovery target\n",
"4. Compute recovery metrics"
"0. Read input data (timeseries and restoration site)\n",
"1. Compute spectral indices\n",
"2. Compute a recovery target\n",
"3. Compute recovery metrics"
]
},
{
Expand Down Expand Up @@ -39,12 +39,15 @@
"metadata": {},
"outputs": [],
"source": [
"# 1. Read in the timeseries data and compute indices\n",
"# 0. Read input data (timeseries and restoration site)\n",
"ts = sr.read_timeseries(\n",
" path_to_tifs=data.bc06_wildfire_landsat_bap_timeseries(),\n",
" band_names={1: \"blue\", 2: \"green\", 3: \"red\", 4: \"nir\", 5: \"swir16\", 6: \"swir22\"},\n",
")\n",
"indices = sr.compute_indices(ts, indices=[\"NBR\"])"
"rest_site = sr.read_restoration_sites(\n",
" path=data.bc06_wildfire_restoration_site(),\n",
" dist_rest_years={0: [2005, 2006]}\n",
")\n"
]
},
{
Expand All @@ -53,11 +56,8 @@
"metadata": {},
"outputs": [],
"source": [
"# 2. Define the restoration site\n",
"rest_site = sr.read_restoration_sites(\n",
" path=data.bc06_wildfire_restoration_site(),\n",
" dist_rest_years={0: [2005, 2006]}\n",
")"
"# 1. Compute spectral indices\n",
"indices = sr.compute_indices(ts, indices=[\"NBR\"])"
]
},
{
Expand Down Expand Up @@ -104,7 +104,7 @@
"metadata": {},
"outputs": [],
"source": [
"# 3. Compute a historic median recovery target\n",
"# 2. Compute a historic median recovery target\n",
"target = sr.targets.historic.median(\n",
" restoration_sites=rest_site,\n",
" timeseries_data=indices,\n",
Expand All @@ -120,7 +120,7 @@
"metadata": {},
"outputs": [],
"source": [
"# 4. Compute R80P and Y2R recovery metrics \n",
"# 3. Compute R80P and Y2R recovery metrics \n",
"metrics = sr.compute_metrics(\n",
" metrics=[\"deltaIR\", \"R80P\", \"YrYr\", \"Y2R\"],\n",
" restoration_sites=rest_site,\n",
Expand Down

0 comments on commit df17d35

Please sign in to comment.