Skip to content

continued dist new dw - #15

Open
conordoremus wants to merge 5 commits into
initial_dist_analysisfrom
continued_dist_new_dw
Open

continued dist new dw#15
conordoremus wants to merge 5 commits into
initial_dist_analysisfrom
continued_dist_new_dw

Conversation

@conordoremus

@conordoremus conordoremus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Created the disturbance/ directory which includes modules for functions used in DIST_ALERT.ipynb for both DIST and Dynamic World analysis

src/disturbance

  • moved all modules to the disturbance directory

DIST_ALERT.ipynb

  • performs same analysis as prior state, now calling functions from disturbance directory rather than declaring them within the notebook
  • final section is first draft at using the disturbance rate within propensity score matching
    • this section gets moved to the archive later

Code cleanup:

  • moved function declaration from within the notebook to a directory

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 bands
  • DIST_STATUS.py: functions calculating disturbance rates using the dist - status band
  • dist_visualization.py: functions that visualize both AC and status disturbance on a map of given PA
  • DW_analysis.py: functions for both calculating the land cover change for PAs and loading the resulting CSVs
  • dw_builders.py: functions that build pre and post disturbance date composites used in land cover change analysis
  • dw_results.py: functions that parse results CSVs and create a transition data frame or transition mask
  • DW_visualization.py: functions used to visualize dynamic world composites on a map and display land cover change results
  • notebooks/DIST_ALERT.ipynb
  • dist_variables: file where variables like palettes, legend dictionaries, and visualization parameters are stored for dist and dynamic world analysis

Notes 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 CLIGive Feedback 💬

@alanalutz
alanalutz force-pushed the continued_dist_new_dw branch from 0e5b5a7 to 59dcd8d Compare September 9, 2026 15:45
@alanalutz
alanalutz marked this pull request as ready for review September 9, 2026 15:46

@alanalutz alanalutz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants