Skip to content

Commit d98b02e

Browse files
committed
feat: add index type to response meta; correct unit for MSAVI meta
1 parent 128650b commit d98b02e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

backend/src/routes/sat_index_router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async def get_msavi_data(
118118
"endDate": int(rounded_end_date.timestamp()),
119119
"temporalResolution": TemporalResolution[temporalResolution].value,
120120
"aggregation": AggregationMethod[aggregation].value,
121-
"unit": Unit.NORMALIZED_DIFFERENCE.value,
121+
"unit": Unit.DIMENSIONLESS.value,
122122
},
123123
"data": data,
124124
}

backend/src/validation/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pydantic import BaseModel
44

5-
from src.constants import AggregationMethod, LocationName, TemporalResolution, Unit
5+
from src.constants import AggregationMethod, LocationName, TemporalResolution, Unit, IndexType
66

77

88
class DataPoint(BaseModel):
@@ -28,6 +28,7 @@ class TemperatureResponse(BaseModel):
2828

2929

3030
class NDVIMetaResponse(BaseMeta):
31+
indexType: IndexType = IndexType.NDVI
3132
unit: Unit = Unit.NORMALIZED_DIFFERENCE
3233

3334

@@ -36,6 +37,7 @@ class NDVIResponse(BaseMeta):
3637
data: List[DataPoint]
3738

3839
class MSAVIMetaResponse(BaseMeta):
40+
indexType: IndexType = IndexType.MSAVI
3941
unit: Unit = Unit.DIMENSIONLESS
4042

4143
class MSAVIResponse(BaseMeta):

0 commit comments

Comments
 (0)