Skip to content

Commit 9d742fb

Browse files
committed
fix merging issue
1 parent 72da4dc commit 9d742fb

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

odc/stats/plugins/ls_ndvi_median.py

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
from typing import Sequence, Tuple
1010
from datacube.utils.masking import mask_invalid_data
1111
from odc.stats.plugins._registry import register, StatsPluginInterface
12-
from odc.algo._masking import (
13-
erase_bad,
14-
enum_to_bool
15-
)
16-
12+
from odc.algo._masking import erase_bad, enum_to_bool
1713

1814
class StatsNDVI(StatsPluginInterface):
1915
"""
@@ -42,13 +38,8 @@ def __init__(
4238
self.contiguity_band = contiguity_band
4339
self.group_by = group_by
4440

45-
<<<<<<< HEAD
46-
# These params get passed to the upstream
47-
# base class StatsPluginInterface
48-
=======
49-
## These params get passed to the upstream
41+
# These params get passed to the upstream
5042
# base StatsPluginInterface class
51-
>>>>>>> refs/remotes/origin/plugin_documentation
5243
super().__init__(
5344
input_bands=tuple(input_bands) + (mask_band,) + (contiguity_band,), **kwargs
5445
)
@@ -86,13 +77,8 @@ def native_transform(self, xx):
8677

8778
# drop masking bands
8879
xx = xx.drop_vars([self.mask_band] + [self.contiguity_band])
89-
<<<<<<< HEAD
90-
91-
# Mask the bad data (clouds etc)
92-
=======
9380

94-
## Mask the bad data (clouds etc)
95-
>>>>>>> refs/remotes/origin/plugin_documentation
81+
# Mask the bad data (clouds etc)
9682
xx = erase_bad(xx, bad)
9783

9884
return xx
@@ -104,21 +90,12 @@ def reduce(self, xx: xr.Dataset) -> xr.Dataset:
10490
# convert to float by and convert nodata to NaN
10591
xx = mask_invalid_data(xx)
10692

107-
<<<<<<< HEAD
108-
# calculate temporal median NDVI. Note that we use
109-
# 'spec' and not 'time', this is an odc-stats thing
110-
ndvi = ndvi.median('spec').rename(self.output_bands)
111-
112-
=======
11393
ndvi = (xx["nbart_nir"] - xx["nbart_red"]) / (xx["nbart_nir"] + xx["nbart_red"])
11494

115-
# calculate temporal median NDVI.
116-
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!
117-
# Note that we use 'spec' and not 'time', this is an odc-stats thing
118-
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!
95+
# calculate temporal median NDVI. Note that we use
96+
# 'spec' and not 'time', this is an odc-stats thing
11997
ndvi = ndvi.median("spec").rename(self.output_bands)
12098

121-
>>>>>>> refs/remotes/origin/plugin_documentation
12299
return ndvi.to_dataset()
123100

124101

0 commit comments

Comments
 (0)