continued dist new dw - #15
Conversation
…to utils, modified DIST_ALERT ipynb
0e5b5a7 to
59dcd8d
Compare
alanalutz
left a comment
There was a problem hiding this comment.
Just a couple of small nitpicks and a methods question. I didn't review any of the dw code since it is archived later; we can always come back to it.
| VEGDISTSTATUS = ee.ImageCollection(FOLDERSET[year] + "/VEG-DIST-STATUS").mosaic() | ||
|
|
||
| mask_from = [0, 3, 6, 7, 8, 9, 10] | ||
| mask_to = [0, 0, 1, 0, 1, 0, 1] |
There was a problem hiding this comment.
Should it count as disturbance if it is >50% but from the previous year?
| ).getInfo()['b1'] | ||
|
|
||
| total_pixels = VEGDISTSTATUS.reduceRegion( | ||
| reducer=ee.Reducer.count(), geometry=site_geom, scale=30, maxPixels=1e9 |
There was a problem hiding this comment.
If you want to, you can un-hardcode scale and maxPixels by putting them in dist_variables.py since they are repeated and always the same, but not necessary.
| Map.addLayer(site_geom, {"color": "red"}, f"{site_name} Boundary") | ||
| Map.centerObject(site) | ||
|
|
||
| Map.addLayer(site_DIST.select('anom'), {"min": 0, "max": 100, "palette": palette}, f"DIST {year} - {site_name}") |
There was a problem hiding this comment.
Add something to the map layer name to differentiate from map layers that were added by the previous function. (e.g. If the map has two layers they are called "DIST 2024 Status - Densu" and "DIST 2024 AC - Densu" or something like that instead of having the same name
Description
Created the
disturbance/directory which includes modules for functions used inDIST_ALERT.ipynbfor both DIST and Dynamic World analysissrc/disturbanceDIST_ALERT.ipynbCode cleanup:
Created, updated, or replaced Files and/or tables
src/disturbance: directory that includes all DIST and dynamic world related .py files (functions)DIST_ANOM_CONF.py: functions calculating disturbance rates using the anomaly max and confidence bandsDIST_STATUS.py: functions calculating disturbance rates using the dist - status banddist_visualization.py: functions that visualize both AC and status disturbance on a map of given PADW_analysis.py: functions for both calculating the land cover change for PAs and loading the resulting CSVsdw_builders.py: functions that build pre and post disturbance date composites used in land cover change analysisdw_results.py: functions that parse results CSVs and create a transition data frame or transition maskDW_visualization.py: functions used to visualize dynamic world composites on a map and display land cover change resultsnotebooks/DIST_ALERT.ipynbdist_variables: file where variables like palettes, legend dictionaries, and visualization parameters are stored for dist and dynamic world analysisNotes for reviewers
All files labeled DW_ are moved to the archive in the later PRs. Feedback on the "dist_" files and functions would be very helpful and they should remain mostly the same in the following PRs.
Stack created with GitHub Stacks CLI • Give Feedback 💬