Skip to content

Commit

Permalink
set default iteration count for #280
Browse files Browse the repository at this point in the history
automatically update step, spread and PE count based on length changes
set default ATL03 version to 006
  • Loading branch information
tsutterley committed Jul 11, 2023
1 parent b59ba9d commit 90a044a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions clients/python/sliderule/ipysliderule.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def __init__(self, **kwargs):

# dropdown menu for setting data release
self.release = ipywidgets.Dropdown(
options=['003', '004', '005'],
value='005',
options=['003', '004', '005', '006'],
value='006',
description='Release:',
description_tooltip="Release: ICESat-2 data release",
disabled=False,
Expand Down Expand Up @@ -351,7 +351,7 @@ def __init__(self, **kwargs):
# slider for setting maximum number of iterations
# (not including initial least-squares-fit selection)
self.iteration = ipywidgets.IntSlider(
value=1,
value=6,
min=0,
max=20,
step=1,
Expand Down Expand Up @@ -432,6 +432,9 @@ def __init__(self, **kwargs):
style=self.style,
)

# watch widgets for changes
self.length.observe(self.set_default_values_from_length)

# dropdown menu for setting map projection
# Global: Web Mercator (EPSG:3857)
# North: Alaska Polar Stereographic (EPSG:5936)
Expand Down Expand Up @@ -732,6 +735,14 @@ def time_end(self):
"""
return self.end_date.value.isoformat()

# function for setting default values when segment length changes
def set_default_values_from_length(self, sender):
"""function for setting default values when segment length changes
"""
self.step.value = int(self.length.value//2)
self.spread.value = self.length.value/2.0
self.count.value = np.maximum(5, self.length.value//4)

# function for setting available map layers
def set_layers(self, sender):
"""function for updating available map layers
Expand Down

0 comments on commit 90a044a

Please sign in to comment.