本文整理汇总了Python中ipywidgets.BoundedFloatText方法的典型用法代码示例。如果您正苦于以下问题:Python ipywidgets.BoundedFloatText方法的具体用法?Python ipywidgets.BoundedFloatText怎么用?Python ipywidgets.BoundedFloatText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipywidgets
的用法示例。
在下文中一共展示了ipywidgets.BoundedFloatText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: define_site_description_time_series
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def define_site_description_time_series(self):
'''Widgets for site description parameters'''
self.w_lat = widgets.BoundedFloatText(
value=self.lat, min=-90, max=90, description='Lat.', width=100)
self.w_lon = widgets.BoundedFloatText(
value=self.lon, min=-180, max=180, description='Lon.', width=100)
self.w_alt = widgets.FloatText(
value=self.alt, description='Alt.', width=100)
self.w_stdlon = widgets.BoundedFloatText(
value=self.stdlon, min=-180, max=180, description='Std. Lon.', width=100)
self.w_z_u = widgets.BoundedFloatText(
value=self.zu,
min=0.001,
description='Wind meas. height',
width=100)
self.w_z_T = widgets.BoundedFloatText(
value=self.zt, min=0.001, description='T meas. height', width=100)
self.site_page = widgets.VBox([widgets.HBox([self.w_lat,
self.w_lon,
self.w_alt,
self.w_stdlon]),
widgets.HBox([self.w_z_u,
self.w_z_T])],
background_color='#EEE')
示例2: spectral_properties_time_series
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def spectral_properties_time_series(self):
'''Widgets for site spectral properties'''
self.w_rho_vis_C = widgets.BoundedFloatText(
value=self.rho_vis_C, min=0, max=1, description='Leaf refl. PAR', width=80)
self.w_tau_vis_C = widgets.BoundedFloatText(
value=self.tau_vis_C, min=0, max=1, description='Leaf trans. PAR', width=80)
self.w_rho_nir_C = widgets.BoundedFloatText(
value=self.rho_nir_C, min=0, max=1, description='Leaf refl. NIR', width=80)
self.w_tau_nir_C = widgets.BoundedFloatText(
value=self.tau_nir_C, min=0, max=1, description='Leaf trans. NIR', width=80)
self.w_rho_vis_S = widgets.BoundedFloatText(
value=self.rho_vis_S, min=0, max=1, description='Soil refl. PAR', width=80)
self.w_rho_nir_S = widgets.BoundedFloatText(
value=self.rho_nir_S, min=0, max=1, description='Soil refl. NIR', width=80)
self.w_emis_C = widgets.BoundedFloatText(
value=self.emis_C, min=0, max=1, description='Leaf emissivity', width=80)
self.w_emis_S = widgets.BoundedFloatText(
value=self.emis_S, min=0, max=1, description='Soil emissivity', width=80)
self.spec_page = widgets.VBox([widgets.HBox([self.w_rho_vis_C, self.w_tau_vis_C, self.w_rho_nir_C, self.w_tau_nir_C]), widgets.HBox(
[self.w_rho_vis_S, self.w_rho_nir_S, self.w_emis_C, self.w_emis_S])], background_color='#EEE')
示例3: resistances_time_series
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def resistances_time_series(self):
'''Widgets for resistance model selection'''
self.w_res = widgets.ToggleButtons(
description='Select TSEB model to run:',
options={
'Kustas & Norman 1999': 0,
'Choudhury & Monteith 1988': 1,
'McNaughton & Van der Hurk': 2},
value=self.res,
width=300)
self.w_KN_b = widgets.BoundedFloatText(
value=self.KN_b, min=0, description='KN99 b', width=80)
self.w_KN_c = widgets.BoundedFloatText(
value=self.KN_c, min=0, description='KN99 c', width=80)
self.w_KN_C_dash = widgets.BoundedFloatText(
value=self.KN_C_dash, min=0, max=9999, description="KN99 C'", width=80)
self.KN_params_box = widgets.HBox([self.w_KN_b, self.w_KN_c, self.w_KN_C_dash])
self.res_page = widgets.VBox([self.w_res, self.KN_params_box], background_color='#EEE')
示例4: calc_row_options
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def calc_row_options(self):
'''Widgets for canopy in rows'''
self.w_row = widgets.Checkbox(
description='Canopy in rows?', value=self.row)
self.w_rowaz = widgets.BoundedFloatText(
value=self.row_az,
min=0,
max=360,
description='Row orientation',
width=80)
self.w_rowaz.visible = False
示例5: _widget
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def _widget(self):
import ipywidgets
if self.min is None and self.max is None:
return ipywidgets.FloatText(value=self.value)
else:
return ipywidgets.BoundedFloatText(
value=self.value,
min=self.min or float("-inf"),
max=self.max or float("inf"),
)
示例6: surface_properties_time_series
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def surface_properties_time_series(self):
'''Widgets for canopy properties'''
self.w_PT = widgets.BoundedFloatText(
value=self.max_PT, min=0, description="Max. alphaPT", width=80)
self.w_LAD = widgets.BoundedFloatText(
value=self.x_LAD, min=0, description="LIDF param.", width=80)
self.w_LAD.visible = False
self.w_leafwidth = widgets.BoundedFloatText(
value=self.leaf_width, min=0.001, description="Leaf width", width=80)
self.w_zsoil = widgets.BoundedFloatText(
value=self.z0soil, min=0, description="soil roughness", width=80)
# Landcover classes and values come from IGBP Land Cover Type Classification
self.w_lc = widgets.Dropdown(
options={
'WATER': 0,
'CONIFER EVERGREEN': 1,
'BROADLEAVED EVERGREEN': 2,
'CONIFER DECIDUOUS': 3,
'BROADLEAVED DECIDUOUS': 4,
'FOREST MIXED': 5,
'SHRUB CLOSED': 6,
'SHRUB OPEN': 7,
'SAVANNA WOODY': 8,
'SAVANNA': 9,
'GRASS': 10,
'WETLAND': 11,
'CROP': 12,
'URBAN': 13,
'CROP MOSAIC': 14,
'SNOW': 15,
'BARREN': 16
},
value=self.landcover,
description="Land Cover Type",
width=200)
lcText = widgets.HTML(value='''Land cover information is used to estimate roughness. <BR>
For shrubs, conifers and broadleaves we use the model of <BR>
Schaudt & Dickinson (2000) Agricultural and Forest Meteorology. <BR>
For crops and grasses we use a fixed ratio of canopy heigh''', width=100)
self.calc_row_options()
self.veg_page = widgets.VBox([widgets.HBox([self.w_PT, self.w_LAD, self.w_leafwidth]),
widgets.HBox([self.w_zsoil, self.w_lc, lcText]),
widgets.HBox([self.w_row, self.w_rowaz])],
background_color='#EEE')
示例7: component_viewer
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def component_viewer(output, tr=2.0):
''' This a function to interactively view the results of a decomposition analysis
Args:
output: (dict) output dictionary from running Brain_data.decompose()
tr: (float) repetition time of data
'''
if ipywidgets is None:
raise ImportError(
"ipywidgets is required for interactive plotting. Please install this package manually or install nltools with optional arguments: pip install 'nltools[interactive_plots]'"
)
def component_inspector(component, threshold):
'''This a function to be used with ipywidgets to interactively view a decomposition analysis
Make sure you have tr and output assigned to variables.
Example:
from ipywidgets import BoundedFloatText, BoundedIntText
from ipywidgets import interact
tr = 2.4
output = data_filtered_smoothed.decompose(algorithm='ica', n_components=30, axis='images', whiten=True)
interact(component_inspector, component=BoundedIntText(description='Component', value=0, min=0, max=len(output['components'])-1),
threshold=BoundedFloatText(description='Threshold', value=2.0, min=0, max=4, step=.1))
'''
_, ax = plt.subplots(nrows=3, figsize=(12,8))
thresholded = (output['components'][component] - output['components'][component].mean())*(1/output['components'][component].std())
thresholded.data[np.abs(thresholded.data) <= threshold] = 0
plot_stat_map(thresholded.to_nifti(), cut_coords=range(-40, 70, 10),
display_mode='z', black_bg=True, colorbar=True, annotate=False,
draw_cross=False, axes=ax[0])
if isinstance(output['decomposition_object'], (sklearn.decomposition.PCA)):
var_exp = output['decomposition_object'].explained_variance_ratio_[component]
ax[0].set_title(f"Component: {component}/{len(output['components'])}, Variance Explained: {var_exp:2.2}", fontsize=18)
else:
ax[0].set_title(f"Component: {component}/{len(output['components'])}", fontsize=18)
ax[1].plot(output['weights'][:, component], linewidth=2, color='red')
ax[1].set_ylabel('Intensity (AU)', fontsize=18)
ax[1].set_title(f'Timecourse (TR={tr})', fontsize=16)
y = fft(output['weights'][:, component])
f = fftfreq(len(y), d=tr)
ax[2].plot(f[f > 0], np.abs(y)[f > 0]**2)
ax[2].set_ylabel('Power', fontsize=18)
ax[2].set_xlabel('Frequency (Hz)', fontsize=16)
ipywidgets.interact(component_inspector, component=ipywidgets.BoundedIntText(description='Component', value=0, min=0, max=len(output['components'])-1),
threshold=ipywidgets.BoundedFloatText(description='Threshold', value=2.0, min=0, max=4, step=.1))
示例8: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import BoundedFloatText [as 别名]
def __init__(self, mol):
self._current_shapes = []
self.mol = mol
self.tolerance = 0.3 * u.angstrom
self.original_coords = mol.positions.copy()
self.showing = ipy.HTML()
self.viewer = mol.draw3d(width='650px')
""":type viewer: moldesign.viewer.GeometryViewer"""
self.description = ipy.HTML()
self.symm_selector = ipy.Select()
self.symm_selector.observe(self.show_symmetry, names='value')
self.apply_button = ipy.Button(description='Symmetrize')
self.apply_button.on_click(self.apply_selected_symmetry)
self.reset_button = ipy.Button(description='Reset')
self.reset_button.on_click(self.reset_coords)
self.apply_all_button = ipy.Button(description='Apply all',
layout=ipy.Layout(padding='10px'))
self.apply_all_button.on_click(self.set_highest_symmetry)
self.tolerance_descrip = ipy.HTML(u'<small>tolerance/\u212B</small>',)
self.tolerance_chooser = ipy.BoundedFloatText(value=self.tolerance.value_in(u.angstrom),
min=0.0)
self.recalculate_button = ipy.Button(description='Recalculate')
self.recalculate_button.on_click(self.coords_changed)
self.symm_pane = VBox([self.description,
self.symm_selector,
HBox([self.apply_button, self.reset_button]),
self.apply_all_button,
HBox([self.tolerance_chooser, self.recalculate_button]),
self.tolerance_descrip],
layout=ipy.Layout(width='325px'))
self.symmetry = None
self.coords_changed()
self.hbox = HBox([VBox([self.viewer, self.showing]), self.symm_pane])
super().__init__([self.hbox])