malcolmSQ commited on
Commit
60f987e
·
1 Parent(s): 2ce627e

WIP: update files before testing hugging-er build

Browse files
README.md CHANGED
@@ -98,6 +98,3 @@ er-chapman-richards/
98
  - Jimenez, J.A. & Lugo, A.E. (1985, 1987)
99
  - Zanvo et al. (2023) for allometric equations
100
  - Field data from Nigeria mangrove sites (2024)
101
-
102
- ## License
103
- [License details to be added]
 
98
  - Jimenez, J.A. & Lugo, A.E. (1985, 1987)
99
  - Zanvo et al. (2023) for allometric equations
100
  - Field data from Nigeria mangrove sites (2024)
 
 
 
configs/linear.yaml DELETED
@@ -1,74 +0,0 @@
1
- growth_model: linear
2
-
3
- species:
4
- - name: "species_A" # Rhizophora spp.
5
- planting_density: 4000 # trees/ha
6
- mortality_rates:
7
- year_1: 15 # %
8
- year_2: 12 # %
9
- year_3: 6 # %
10
- year_4: 5 # %
11
- year_5: 5 # %
12
- year_6: 5 # %
13
- year_7: 5 # %
14
- year_8: 5 # %
15
- year_9: 5 # %
16
- year_10: 5 # %
17
- subsequent: 1.5 # % (years 11-30)
18
- linear:
19
- dbh:
20
- r: 1.83 # cm/yr
21
- height:
22
- r: 0.61 # m/yr
23
- allometry:
24
- equation: "Zanvo et al. 2023: Total = 1.938 × (DBH² H)^0.67628"
25
- initial_values:
26
- dbh: 1.0 # cm
27
- height: 0.5 # m
28
-
29
- - name: "species_B" # Avicennia germinans
30
- planting_density: 444 # trees/ha
31
- mortality_rates:
32
- year_1: 15 # %
33
- year_2: 12 # %
34
- year_3: 6 # %
35
- year_4: 5 # %
36
- year_5: 5 # %
37
- year_6: 5 # %
38
- year_7: 5 # %
39
- year_8: 5 # %
40
- year_9: 5 # %
41
- year_10: 5 # %
42
- subsequent: 1.5 # % (years 11-30)
43
- linear:
44
- dbh:
45
- r: 1.2 # cm/yr (example, adjust as needed)
46
- height:
47
- r: 0.4 # m/yr (example, adjust as needed)
48
- allometry:
49
- equation: "Zanvo et al. 2023: Total = 1.486 × (DBH² H)^0.55864"
50
- initial_values:
51
- dbh: 1.0 # cm
52
- height: 0.5 # m
53
-
54
- project:
55
- duration_years: 30 # matches project_years
56
- planting_schedule:
57
- year_1: 2500 # ha
58
- year_2: 2500 # ha
59
- year_3: 0 # ha
60
- year_4: 0 # ha
61
- year_5: 0 # ha
62
-
63
- carbon:
64
- biomass_to_carbon: 0.47 # IPCC default
65
- carbon_to_co2: 3.67 # molecular weight ratio
66
- buffer_percentage: 20 # risk buffer
67
- leakage_percentage: 0 # no leakage assumed
68
- baseline_emissions: 0 # tCO2/ha/year
69
-
70
- scenarios:
71
- area: 1000.0 # ha
72
- dbh_range: [1.0, 25.0] # cm
73
- height_range: [0.5, 15.0] # m
74
- growth_rate_factor: 1.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
configs/linear_plateau.yaml DELETED
@@ -1,82 +0,0 @@
1
- growth_model: linear_plateau
2
-
3
- species:
4
- - name: "species_A" # Rhizophora spp.
5
- planting_density: 4000 # trees/ha
6
- mortality_rates:
7
- year_1: 15 # %
8
- year_2: 12 # %
9
- year_3: 6 # %
10
- year_4: 5 # %
11
- year_5: 5 # %
12
- year_6: 5 # %
13
- year_7: 5 # %
14
- year_8: 5 # %
15
- year_9: 5 # %
16
- year_10: 5 # %
17
- subsequent: 1.5 # % (years 11-30)
18
- linear_plateau:
19
- dbh:
20
- r: 1.83 # cm/yr
21
- T_p: 30 # plateau at 30 years
22
- a: 11.07 # asymptote from params.yaml
23
- height:
24
- r: 0.61 # m/yr
25
- T_p: 12 # plateau at 12 years
26
- a: 11.58 # asymptote from params.yaml
27
- allometry:
28
- equation: "Zanvo et al. 2023: Total = 1.938 × (DBH² H)^0.67628"
29
- initial_values:
30
- dbh: 1.0 # cm
31
- height: 0.5 # m
32
-
33
- - name: "species_B" # Avicennia germinans
34
- planting_density: 444 # trees/ha
35
- mortality_rates:
36
- year_1: 15 # %
37
- year_2: 12 # %
38
- year_3: 6 # %
39
- year_4: 5 # %
40
- year_5: 5 # %
41
- year_6: 5 # %
42
- year_7: 5 # %
43
- year_8: 5 # %
44
- year_9: 5 # %
45
- year_10: 5 # %
46
- subsequent: 1.5 # % (years 11-30)
47
- linear_plateau:
48
- dbh:
49
- r: 1.2 # cm/yr (example, adjust as needed)
50
- T_p: 30
51
- a: 17.0
52
- height:
53
- r: 0.4 # m/yr (example, adjust as needed)
54
- T_p: 12
55
- a: 8.8
56
- allometry:
57
- equation: "Zanvo et al. 2023: Total = 1.486 × (DBH² H)^0.55864"
58
- initial_values:
59
- dbh: 1.0 # cm
60
- height: 0.5 # m
61
-
62
- project:
63
- duration_years: 30 # matches project_years
64
- planting_schedule:
65
- year_1: 2500 # ha
66
- year_2: 2500 # ha
67
- year_3: 0 # ha
68
- year_4: 0 # ha
69
- year_5: 0 # ha
70
-
71
- carbon:
72
- biomass_to_carbon: 0.47 # IPCC default
73
- carbon_to_co2: 3.67 # molecular weight ratio
74
- buffer_percentage: 20 # risk buffer
75
- leakage_percentage: 0 # no leakage assumed
76
- baseline_emissions: 0 # tCO2/ha/year
77
-
78
- scenarios:
79
- area: 1000.0 # ha
80
- dbh_range: [1.0, 25.0] # cm
81
- height_range: [0.5, 15.0] # m
82
- growth_rate_factor: 1.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
configs/params.yaml DELETED
@@ -1,86 +0,0 @@
1
- species:
2
- - name: "species_A" # Rhizophora spp.
3
- planting_density: 4000 # trees/ha
4
- mortality_rates:
5
- year_1: 15 # %
6
- year_2: 12 # %
7
- year_3: 6 # %
8
- year_4: 5 # %
9
- year_5: 5 # %
10
- year_6: 5 # %
11
- year_7: 5 # %
12
- year_8: 5 # %
13
- year_9: 5 # %
14
- year_10: 5 # %
15
- subsequent: 1.5 # % (years 11-30)
16
- chapman_richards:
17
- dbh:
18
- a: 11.07 # asymptotic maximum DBH (cm)
19
- b: 0.4736 # growth rate parameter (yr^-1), back-solved from Aug 2024 data
20
- c: 2.1 # shape parameter
21
- height:
22
- a: 11.58 # asymptotic maximum height (m)
23
- b: 0.1335 # growth rate parameter (yr^-1), back-solved from Aug 2024 data
24
- c: 1.5 # shape parameter
25
- allometry:
26
- equation: "Zanvo et al. 2023: Total = 1.938 × (DBH² H)^0.67628"
27
- initial_values:
28
- dbh: 1.0 # cm
29
- height: 0.5 # m
30
-
31
- - name: "species_B" # Avicennia germinans
32
- planting_density: 444 # trees/ha
33
- mortality_rates:
34
- year_1: 15 # %
35
- year_2: 12 # %
36
- year_3: 6 # %
37
- year_4: 5 # %
38
- year_5: 5 # %
39
- year_6: 5 # %
40
- year_7: 5 # %
41
- year_8: 5 # %
42
- year_9: 5 # %
43
- year_10: 5 # %
44
- subsequent: 1.5 # % (years 11-30)
45
- chapman_richards:
46
- dbh:
47
- a: 17.0 # asymptotic maximum DBH (cm)
48
- b: 0.4736 # growth rate parameter (yr^-1), back-solved from Aug 2024 data
49
- c: 2.1 # shape parameter
50
- height:
51
- a: 8.8 # asymptotic maximum height (m)
52
- b: 0.1335 # growth rate parameter (yr^-1), back-solved from Aug 2024 data
53
- c: 1.5 # shape parameter
54
- allometry:
55
- equation: "Zanvo et al. 2023: Total = 1.486 × (DBH² H)^0.55864"
56
- initial_values:
57
- dbh: 1.0 # cm
58
- height: 0.5 # m
59
-
60
- project:
61
- duration_years: 30 # matches project_years
62
- planting_schedule:
63
- year_1: 2500 # ha
64
- year_2: 2500 # ha
65
- year_3: 0 # ha
66
- year_4: 0 # ha
67
- year_5: 0 # ha
68
-
69
- carbon:
70
- biomass_to_carbon: 0.47 # IPCC default
71
- carbon_to_co2: 3.67 # molecular weight ratio
72
- buffer_percentage: 20 # risk buffer
73
- leakage_percentage: 0 # no leakage assumed
74
- baseline_emissions: 0 # tCO2/ha/year
75
-
76
- # Note: b parameter is calculated using b = ln(c) / Tm
77
- # For both species:
78
- # - Tm = 6 years
79
- # - c = 2.1
80
- # Therefore: b = ln(2.1) / 6 ≈ 0.35
81
-
82
- scenarios:
83
- area: 1000.0 # ha
84
- dbh_range: [1.0, 25.0] # cm
85
- height_range: [0.5, 15.0] # m
86
- growth_rate_factor: 1.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dashboard/plots/__init__.py CHANGED
@@ -103,7 +103,7 @@ def create_all_plots(results, species_results, config):
103
  check_complex(arr, "annual_ers")
104
  fig2 = go.Figure()
105
  fig2.add_trace(go.Bar(x=results["year"], y=annual_ers, name="Annual Buffer ERs", marker_color="#2ecc71", opacity=0.7))
106
- fig2.update_layout(title="Annual Emission Reductions (Buffer)", xaxis_title="Year", yaxis_title="Annual Buffer ERs (tCO2)", hovermode="x unified", template="plotly_white")
107
 
108
  # 3. Biomass per tree for all species (refactored to use model.species_metrics)
109
  years = results["year"]
 
103
  check_complex(arr, "annual_ers")
104
  fig2 = go.Figure()
105
  fig2.add_trace(go.Bar(x=results["year"], y=annual_ers, name="Annual Buffer ERs", marker_color="#2ecc71", opacity=0.7))
106
+ fig2.update_layout(title="Annual Emission Reductions (Post Buffer)", xaxis_title="Year", yaxis_title="Annual Buffer ERs (tCO2)", hovermode="x unified", template="plotly_white")
107
 
108
  # 3. Biomass per tree for all species (refactored to use model.species_metrics)
109
  years = results["year"]
models/jimenez_lugo/README.md DELETED
@@ -1,9 +0,0 @@
1
- # Jimenez-Lugo Model
2
-
3
- This folder is reserved for the Jimenez-Lugo growth model and related files.
4
-
5
- - **Growth Model:** Jimenez-Lugo (alternative parameterization)
6
- - **Purpose:** For comparison with Chapman-Richards and other models; may be used for specific species or regions where this parameterization is justified.
7
- - **Status:** Deprecated/not currently used in the dashboard tabs. All references have been removed from the main app, but this folder is retained for archival and reproducibility purposes.
8
-
9
- If you wish to re-enable this model, add its config to `configs/` and update `MODEL_CONFIGS` in `dashboard/app.py`.
 
 
 
 
 
 
 
 
 
 
models/linear/README.md DELETED
@@ -1,10 +0,0 @@
1
- # Simple Linear Model
2
-
3
- This folder documents the **Simple Linear** growth model used in the Mangrove ER Dashboard.
4
-
5
- - **Growth Model:** Linear (constant annual increment)
6
- - **Parameters:** See `configs/linear.yaml`
7
- - **Purpose:** For comparison with other models; may be appropriate for young plantations or where growth is approximately linear.
8
- - **Usage:** Available as a tab in the dashboard for side-by-side comparison.
9
-
10
- This model is best used for demonstration or for species/sites where linear growth is justified by data.
 
 
 
 
 
 
 
 
 
 
 
models/linear_plateau/README.md DELETED
@@ -1,10 +0,0 @@
1
- # Linear Plateau Model
2
-
3
- This folder documents the **Linear Plateau** growth model used in the Mangrove ER Dashboard.
4
-
5
- - **Growth Model:** Linear Plateau (linear growth up to a plateau, then constant)
6
- - **Parameters:** See `configs/linear_plateau.yaml`
7
- - **Purpose:** For comparison with other models; may be appropriate for species or sites where growth levels off after a certain age.
8
- - **Usage:** Available as a tab in the dashboard for side-by-side comparison.
9
-
10
- This model is useful for scenarios where trees grow rapidly at first, then reach a maximum size.
 
 
 
 
 
 
 
 
 
 
 
models/original/README.md DELETED
@@ -1,41 +0,0 @@
1
- # Original Model (Chapman-Richards)
2
-
3
- **This is the default model and the only one with an editable planting schedule in the dashboard.**
4
-
5
- This folder contains reference files and documentation for the **Original Model** used in the Mangrove ER Dashboard.
6
-
7
- - **Growth Model:** Chapman-Richards (flexible sigmoidal growth)
8
- - **Purpose:** Baseline/reference for all comparisons
9
- - **Parameters:** See `configs/params.yaml`
10
- - **Usage:** Used in the 'Original Model' tab of the dashboard, with editable planting schedule.
11
-
12
- This is the default model for the project and is recommended for most mangrove species unless otherwise justified.
13
-
14
- ## Model Overview
15
- This is the default Chapman-Richards-based mangrove growth and carbon model for the project. It uses species-specific growth curves and DBH-dependent mortality to estimate carbon sequestration and tree survival over time.
16
-
17
- ## Growth & Mortality Logic
18
- - **Growth:**
19
- - Uses Chapman-Richards equations for both DBH and height for each species.
20
- - Parameters are derived from field data and literature.
21
- - **Mortality:**
22
- - Applies a DBH-dependent mortality rate, where annual mortality is a function of tree size (DBH) and its increment.
23
- - This dynamic approach reflects higher mortality when trees are small, leveling off as they mature.
24
-
25
- ## Parameters
26
- - See `configs/params.yaml` for all parameter values, including:
27
- - Chapman-Richards parameters for DBH and height
28
- - Initial values for DBH and height
29
- - Planting density
30
- - Mortality parameters (m_ref, DBH_ref, p)
31
- - Allometric equations for biomass
32
-
33
- ## References
34
- - Chapman-Richards growth model literature
35
- - Zanvo et al. (2023) for allometric equations
36
- - Field data from Nigeria mangrove sites (2024)
37
-
38
- ## Usage
39
- - This model is available as the "Original Model" tab in the dashboard.
40
- - To modify parameters, edit `configs/params.yaml`.
41
- - For more details on running the dashboard, see the top-level README.