diff --git a/_modules/riskmapjnr/defrate_per_cat.html b/_modules/riskmapjnr/defrate_per_cat.html index abdb70a..3c8e686 100644 --- a/_modules/riskmapjnr/defrate_per_cat.html +++ b/_modules/riskmapjnr/defrate_per_cat.html @@ -195,8 +195,7 @@
cat = [c + 1 for c in range(n_cat)]
# Create a table to save the results
- data = {"cat": cat, "nfor": 0, "ndefor": 0,
- "rate_obs": 0.0, "rate_mod": 0.0}
+ data = {"cat": cat, "nfor": 0, "ndefor": 0}
df = pd.DataFrame(data)
# Loop on blocks of data
@@ -228,6 +227,9 @@ Source code for riskmapjnr.defrate_per_cat
cat_defor = pd.Categorical(data_defor.flatten(), categories=cat)
df["ndefor"] += cat_defor.value_counts().values
+ # Time interval
+ df["time_interval"] = time_interval
+
# Annual deforestation rates per category
df["rate_obs"] = 1 - (1 - df["ndefor"] / df["nfor"]) ** (1 / time_interval)
@@ -245,9 +247,6 @@ Source code for riskmapjnr.defrate_per_cat
# Absolute deforestation probability
df["rate_abs"] = df["rate_mod"] * correction_factor
- # Time interval
- df["time_interval"] = time_interval
-
# Pixel area
pixel_area = xres * yres / 10000
df["pixel_area"] = pixel_area