Skip to content

Commit

Permalink
Merge pull request #1 from BuddyVolly/main
Browse files Browse the repository at this point in the history
Remove area threshold
  • Loading branch information
BuddyVolly authored Jul 26, 2021
2 parents 6dba748 + c96965b commit 76e8004
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
3 changes: 2 additions & 1 deletion component/message/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"period": {
"label": "Period of change analysis (subset):",
"no_dates": "No range of monitoring have been provided",
"bad_order": "The provided date does not respect the chronological order: start of period must be before end of period."
"bad_order": "The provided date does not respect the chronological order: start of period must be before end of period.",
"too_short": "The period is too short for analysis."
},
"bstraps": {
"label": "Number of bootstraps for confidence measure:",
Expand Down
2 changes: 1 addition & 1 deletion component/parameter/cumsum.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# minimum number of images in the historical period to give accurate results
min_images = 10
min_images = 5
4 changes: 1 addition & 3 deletions component/scripts/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def main(args_list):

# get confidence from bootstrap procedure
confidences = bootstrap(residuals, s_diff, nr_bootstraps).numpy()
confidences[confidences<threshold_change] = 0
confidences[s_diff==0] = 0
# set change pixels with 0 confidence to 0
change[confidences<threshold_change] = 0
Expand Down Expand Up @@ -196,9 +197,6 @@ def run_cumsum(ts_folder, outdir, tiles, period, bstraps, area_thld, conf_thld,
max_workers=os.cpu_count()
) as executor:
executor.map(main, args_list)
#for args in args_list:

# main(args)

out.add_live_msg('Merging tiles to final result file.')
# merge tiles as vrt
Expand Down
9 changes: 2 additions & 7 deletions component/tile/cumsum_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ def __init__(self):
self.out_dir = cw.OutDirSelect()
self.tiles = cw.TilesSelect()
self.bstraps = v.Slider(label=cm.widget.bstraps.label, v_model=1000, min=10, max=1000, thumb_label="always", class_='mt-5')
self.area_thld = v.Slider(
label=cm.widget.area_thld.label, v_model=50, step=1, min=0, max=95, thumb_label="always", class_='mt-5'
)
self.conf_thld = v.Slider(
label=cm.widget.conf_thld.label, v_model=.25, step=.05, min=0, max=.95, thumb_label="always", class_='mt-5'
label=cm.widget.conf_thld.label, v_model=.15, step=.05, min=0, max=.95, thumb_label="always", class_='mt-5'
)
self.period = cw.DateRangeSlider(label=cm.widget.period.label)

Expand All @@ -34,7 +31,6 @@ def __init__(self):
v.ExpansionPanelHeader(children=[cm.widget.advance_params]),
v.ExpansionPanelContent(children=[
v.Flex(xs12=True, children=[self.bstraps]),
v.Flex(xs12=True, children=[self.area_thld]),
v.Flex(xs12=True, children=[self.conf_thld])
])
])
Expand Down Expand Up @@ -70,7 +66,7 @@ def _start_process(self, widget, event, data):
out_dir = self.out_dir.v_model
tiles = self.tiles.v_model
bstraps = self.bstraps.v_model
area_thld = self.area_thld.v_model
area_thld = 0
conf_thld = self.conf_thld.v_model
period = self.period.v_model

Expand All @@ -80,7 +76,6 @@ def _start_process(self, widget, event, data):
if not self.alert.check_input(tiles, cm.widget.tiles.no_tiles): return
if not self.alert.check_input(period, cm.widget.period.no_dates): return
if not self.alert.check_input(bstraps, cm.widget.bstraps.no_bstraps): return
if not self.alert.check_input(area_thld, cm.widget.area_thld.no_area_thld): return
if not self.alert.check_input(conf_thld, cm.widget.conf_thld.no_conf_thld): return

# run the cumsum process
Expand Down
6 changes: 3 additions & 3 deletions ui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
"\n",
"# !!! not mandatory !!! \n",
"# Add the links to the code, wiki and issue tracker of your \n",
"code_link = 'https://github.com/12rambau/bfast_gpu'\n",
"wiki_link = 'https://docs.sepal.io/en/latest/modules/dwn/bfast_gpu.html'\n",
"issue_link = 'https://github.com/12rambau/bfast_gpu/issues/new'\n",
"code_link = 'https://github.com/BuddyVolly/cumsum_change'\n",
"wiki_link = 'https://docs.sepal.io/en/latest/modules/dwn/cumsum.html'\n",
"issue_link = 'https://github.com/BuddyVolly/cumsum_change/issues/new'\n",
"\n",
"# Create the side drawer with all its components \n",
"# The display_drawer() method link the drawer with the app bar\n",
Expand Down

0 comments on commit 76e8004

Please sign in to comment.