text
stringlengths 0
828
|
---|
length=200) |
self.singlecolorvar.set(self.config.products_map[self.config.default['single']]) |
self.singlecolorpower.set(self.config.default['single_power']) |
self.singlecolormin.set(0) |
self.singlecolormax.set(100) |
self.singlecolordropdown.config(bg=self.single_color_theme, width=10) |
self.singlecolorlabel.pack(side=tk.LEFT) |
self.singlecolorscale.pack(side=tk.RIGHT) |
self.singlecolormaxscale.pack(side=tk.RIGHT) |
self.singlecolorminscale.pack(side=tk.RIGHT) |
self.singlecolordropdown.pack() |
self.singlecolorframe.grid(row=4, columnspan=5, rowspan=1)" |
136,"def setup_multicolor(self): |
"""""" initial setup of multicolor options and variables"""""" |
# Setup the options for multicolor |
multicolormasterframe = tk.Frame(self.tab_configure) |
channel_choices = sorted(list(self.data.keys())) |
rgb = ['red', 'green', 'blue'] |
self.multicolorframes = {color: tk.Frame(multicolormasterframe, bg=color) for color in rgb} |
self.multicolorlabels = {color: tk.Label(self.multicolorframes[color], text=color, bg=color, width=10) for color |
in rgb} |
self.multicolorvars = {color: tk.StringVar() for color in rgb} |
self.multicolorpower = {color: tk.DoubleVar() for color in rgb} |
self.multicolormin = {color: tk.DoubleVar() for color in rgb} |
self.multicolormax = {color: tk.DoubleVar() for color in rgb} |
self.multicolordropdowns = {color: tk.OptionMenu(self.multicolorframes[color], |
self.multicolorvars[color], |
*channel_choices) for color in rgb} |
self.multicolorscales = {color: tk.Scale(self.multicolorframes[color], |
variable=self.multicolorpower[color], |
orient=tk.HORIZONTAL, |
from_=self.config.ranges['multi_color_power_min'], |
to_=self.config.ranges['multi_color_power_max'], bg=color, |
resolution=self.config.ranges['multi_color_power_resolution'], |
length=200) for color in rgb} |
self.multicolorminscale = {color: tk.Scale(self.multicolorframes[color], |
variable=self.multicolormin[color], |
orient=tk.HORIZONTAL, from_=0, |
to_=self.config.ranges['multi_color_vmin'], bg=color, |
resolution=self.config.ranges['multi_color_vresolution'], |
length=200) for color in rgb} |
self.multicolormaxscale = {color: tk.Scale(self.multicolorframes[color], |
variable=self.multicolormax[color], |
orient=tk.HORIZONTAL, from_=self.config.ranges['multi_color_vmax'], |
to_=100, bg=color, |
resolution=self.config.ranges['multi_color_vresolution'], |
length=200) for color in rgb} |
for color in rgb: |
self.multicolorvars[color].set(self.config.products_map[self.config.default[color]]) |
self.multicolorpower[color].set(self.config.default[color + ""_power""]) |
self.multicolormin[color].set(0) |
self.multicolormax[color].set(100) |
self.multicolordropdowns[color].config(bg=color, width=10) |
self.multicolorlabels[color].pack(side=tk.LEFT) |
self.multicolorscales[color].pack(side=tk.RIGHT) |
self.multicolormaxscale[color].pack(side=tk.RIGHT) |
self.multicolorminscale[color].pack(side=tk.RIGHT) |
self.multicolordropdowns[color].pack() |
self.multicolorframes[color].pack(fill=tk.BOTH) |
multicolormasterframe.grid(row=1, column=0, columnspan=5, rowspan=3)" |
137,"def undobutton_action(self): |
"""""" when undo is clicked, revert the thematic map to the previous state"""""" |
if len(self.history) > 1: |
old = self.history.pop(-1) |
self.selection_array = old |
self.mask.set_data(old) |
self.fig.canvas.draw_idle()" |
138,"def change_class(self): |
"""""" ""on changing the classification label, update the ""draw"" text """""" |
self.toolbarcenterframe.config(text=""Draw: {}"".format(self.config.solar_class_name[self.solar_class_var.get()]))" |
139,"def draw_circle(self, center, radius, array, value, mode=""set""): |
"""""" |
Draws a circle of specified radius on the input array and fills it with specified value |
:param center: a tuple for the center of the circle |
:type center: tuple (x,y) |
:param radius: how many pixels in radius the circle is |
:type radius: int |
:param array: image to draw circle on |
:type array: size (m,n) numpy array |
:param value: what value to fill the circle with |
:type value: float |
:param mode: if ""set"" will assign the circle interior value, if ""add"" will add the value to the circle interior, |
throws exception otherwise |
:type mode: string, either ""set"" or ""add"" |
:return: updates input array |
"""""" |
ri, ci = draw.circle(center[0], center[1], |
radius=radius, |
shape=array.shape) |
if mode == ""add"": |
array[ri, ci] += value |
elif mode == ""set"": |
array[ri, ci] = value |
else: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.