Spaces:
Build error
Build error
pgzmnk
commited on
Commit
·
613a516
1
Parent(s):
fe79a15
Format.
Browse files- utils/indicators.py +5 -3
utils/indicators.py
CHANGED
|
@@ -85,7 +85,9 @@ class IndexGenerator:
|
|
| 85 |
daterange = [start_date, end_date]
|
| 86 |
|
| 87 |
# Calculate index based on type
|
| 88 |
-
logging.info(
|
|
|
|
|
|
|
| 89 |
match index_config["gee_type"]:
|
| 90 |
case "image":
|
| 91 |
dataset = ee.Image(index_config["gee_path"]).clip(self.roi)
|
|
@@ -140,7 +142,7 @@ class IndexGenerator:
|
|
| 140 |
|
| 141 |
if index_config.get("bandname"):
|
| 142 |
return out[index_config.get("bandname")]
|
| 143 |
-
|
| 144 |
logging.info(f"Calculated zonal mean for {index_key}.")
|
| 145 |
return out
|
| 146 |
|
|
@@ -152,7 +154,7 @@ class IndexGenerator:
|
|
| 152 |
"project_name": "",
|
| 153 |
"value": list(map(self.zonal_mean_index, indices, repeat(year))),
|
| 154 |
# to-do: calculate with duckdb; also, should be part of project table instead
|
| 155 |
-
"area": self.roi.area().getInfo(), # m^2
|
| 156 |
"geojson": "",
|
| 157 |
# to-do: coefficient
|
| 158 |
}
|
|
|
|
| 85 |
daterange = [start_date, end_date]
|
| 86 |
|
| 87 |
# Calculate index based on type
|
| 88 |
+
logging.info(
|
| 89 |
+
f"Generating index: {index_config['name']} of type {index_config['gee_type']}"
|
| 90 |
+
)
|
| 91 |
match index_config["gee_type"]:
|
| 92 |
case "image":
|
| 93 |
dataset = ee.Image(index_config["gee_path"]).clip(self.roi)
|
|
|
|
| 142 |
|
| 143 |
if index_config.get("bandname"):
|
| 144 |
return out[index_config.get("bandname")]
|
| 145 |
+
|
| 146 |
logging.info(f"Calculated zonal mean for {index_key}.")
|
| 147 |
return out
|
| 148 |
|
|
|
|
| 154 |
"project_name": "",
|
| 155 |
"value": list(map(self.zonal_mean_index, indices, repeat(year))),
|
| 156 |
# to-do: calculate with duckdb; also, should be part of project table instead
|
| 157 |
+
"area": self.roi.area().getInfo(), # m^2
|
| 158 |
"geojson": "",
|
| 159 |
# to-do: coefficient
|
| 160 |
}
|