Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add widget for set_coreloss_edge_onset #12

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion hyperspy_gui_traitsui/hyperspy_extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ GUI:
function: microscope_parameters_EDS_SEM
hyperspy.microscope_parameters_EDS_TEM:
module: hyperspy_gui_traitsui.microscope_parameters
function: microscope_parameters_EDS_TEM
function: microscope_parameters_EDS_TEM
hyperspy.EELSModel.estimate_and_set_coreloss_edge_onset:
module: hyperspy_gui_traitsui.model
function: estimate_and_set_coreloss_edge_onset_traitsui
23 changes: 23 additions & 0 deletions hyperspy_gui_traitsui/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,26 @@ def fit_component_tratisui(obj, **kwargs):
handler=ComponentFitHandler,
)
return obj, {"view": fit_component_view}


class EstimateAndSetCorelossEdgeOnsetHandler(SpanSelectorInSignal1DHandler):

def fit(self, info):
"""Handles the **Apply** button being clicked.

"""
obj = info.object
obj._set_onset_fired()
return


@add_display_arg
def estimate_and_set_coreloss_edge_onset_traitsui(obj, **kwargs):
estimate_and_set_coreloss_edge_onset_view = tu.View(
tu.Item('percent_position', show_label=True,),
tu.Item('only_current', show_label=True,),
buttons=[OurFitButton, OurCloseButton],
title='Set edge onset',
handler=EstimateAndSetCorelossEdgeOnsetHandler,
)
return obj, {"view": estimate_and_set_coreloss_edge_onset_view}