NeuXtalViz.presenters package#
Submodules#
NeuXtalVizPresenter: Presenter class for connecting the view and model in NeuXtalViz.
This module defines the NeuXtalVizPresenter class, which acts as the mediator between the user interface (view) and the underlying data/model logic. It handles user actions, updates the view based on model state, and manages status/progress reporting for the main visualization window.
Classes#
- NeuXtalVizPresenter
Presenter for the main visualization window, connecting view events to model logic and updating the UI accordingly.
- class NeuXtalVizPresenter(view, model)[source]#
Bases:
objectPresenter for the main visualization window in NeuXtalViz.
Connects user interface events to model logic, updates the view based on model state, and manages status and progress reporting.
Methods
Enable or disable reciprocal lattice display in the view.
Save a screenshot of the current view to a file.
update_complete([status])Indicate completion to the user and reset progress.
Indicate invalid parameters to the user and reset progress.
Update the oriented lattice parameter display in the view.
update_processing([status, progress])Indicate processing state to the user and update progress.
update_progress(progress)Update progress step in the view.
update_status(status)Update status information in the view.
view_ab()Set the view to the c* direction (real lattice).
Set the view to the c-axis direction (reciprocal lattice).
view_bc()Set the view to the a* direction (real lattice).
Set the view to the a-axis direction (reciprocal lattice).
view_ca()Set the view to the b* direction (real lattice).
Set the view to the b-axis direction (reciprocal lattice).
Set the view to a manually specified axis direction.
Set the view's up direction to a manually specified axis.
- update_complete(status='Complete!')[source]#
Indicate completion to the user and reset progress.
- Parameters:
- statusstr, optional
Completion message (default is “Complete!”).
- update_processing(status='Processing...', progress=1)[source]#
Indicate processing state to the user and update progress.
- Parameters:
- statusstr, optional
Processing message (default is “Processing…”).
- progressint, optional
Progress step or value (default is 1).
- update_progress(progress)[source]#
Update progress step in the view.
- Parameters:
- progressint, str
Progress step or value.
- class CrystalStructure(view, model)[source]#
Bases:
NeuXtalVizPresenterMethods
Start calculation of F2 factors using a worker thread.
calculate_F2_complete(result)Complete F2 calculation and update the view with results.
calculate_F2_process(progress)Worker process for F2 calculation.
Start calculation of hkl equivalents using a worker thread.
calculate_hkl_complete(result)Complete hkl calculation and update the view with results.
calculate_hkl_process(progress)Worker process for hkl calculation.
change_lattice()Enable or disable reciprocal lattice display in the view.
Generate space groups for the selected crystal system and update the view.
Generate settings for the selected space group and update the view.
Highlight the selected atom row in the view.
load_CIF()Load a CIF file and update the crystal structure in the view and model.
save_INS()Save the current crystal structure to an INS file.
save_screenshot()Save a screenshot of the current view to a file.
Select an isotope and show the periodic table dialog.
Set the atom table in the view and update atoms.
Update atom positions and related information in the view.
update_complete([status])Indicate completion to the user and reset progress.
update_invalid()Indicate invalid parameters to the user and reset progress.
update_oriented_lattice()Update the oriented lattice parameter display in the view.
Update lattice parameters and atom positions in the view.
update_processing([status, progress])Indicate processing state to the user and update progress.
update_progress(progress)Update progress step in the view.
update_selection(data)Update the selected isotope and atom table in the view.
update_status(status)Update status information in the view.
view_ab()Set the view to the c* direction (real lattice).
view_ab_star()Set the view to the c-axis direction (reciprocal lattice).
view_bc()Set the view to the a* direction (real lattice).
view_bc_star()Set the view to the a-axis direction (reciprocal lattice).
view_ca()Set the view to the b* direction (real lattice).
view_ca_star()Set the view to the b-axis direction (reciprocal lattice).
view_manual()Set the view to a manually specified axis direction.
view_up_manual()Set the view's up direction to a manually specified axis.
- calculate_F2_complete(result)[source]#
Complete F2 calculation and update the view with results.
- Parameters:
- resulttuple or None
Result from F2 calculation.
- calculate_F2_process(progress)[source]#
Worker process for F2 calculation.
- Parameters:
- progresscallable
Progress callback function.
- calculate_hkl()[source]#
Start calculation of hkl equivalents using a worker thread.
- Parameters:
- None
- calculate_hkl_complete(result)[source]#
Complete hkl calculation and update the view with results.
- Parameters:
- resulttuple or None
Result from hkl calculation.
- calculate_hkl_process(progress)[source]#
Worker process for hkl calculation.
- Parameters:
- progresscallable
Progress callback function.
- generate_groups()[source]#
Generate space groups for the selected crystal system and update the view.
- Parameters:
- None
- generate_settings()[source]#
Generate settings for the selected space group and update the view.
- Parameters:
- None
- load_CIF()[source]#
Load a CIF file and update the crystal structure in the view and model.
- Parameters:
- None
- class Experiment(view, model)[source]#
Bases:
NeuXtalVizPresenterMethods
change_lattice()Enable or disable reciprocal lattice display in the view.
load_UB()Load UB matrix from file and update the view and model.
Load detector calibration file and set it in the view.
Load goniometer calibration file and set it in the view.
Load detector mask file and set it in the view.
save_screenshot()Save a screenshot of the current view to a file.
Switch instrument and update all related view parameters.
update_complete([status])Indicate completion to the user and reset progress.
update_invalid()Indicate invalid parameters to the user and reset progress.
update_oriented_lattice()Update the oriented lattice parameter display in the view.
update_processing([status, progress])Indicate processing state to the user and update progress.
update_progress(progress)Update progress step in the view.
update_status(status)Update status information in the view.
view_ab()Set the view to the c* direction (real lattice).
view_ab_star()Set the view to the c-axis direction (reciprocal lattice).
view_bc()Set the view to the a* direction (real lattice).
view_bc_star()Set the view to the a-axis direction (reciprocal lattice).
view_ca()Set the view to the b* direction (real lattice).
view_ca_star()Set the view to the b-axis direction (reciprocal lattice).
view_manual()Set the view to a manually specified axis direction.
view_up_manual()Set the view's up direction to a manually specified axis.
add_orientation
add_orientation_complete
add_orientation_process
add_settings
add_settings_complete
add_settings_process
calculate_double
calculate_double_complete
calculate_double_process
calculate_single
calculate_single_alt
calculate_single_complete
calculate_single_hkl
calculate_single_process
create_instrument
delete_angles
delete_angles_complete
delete_angles_process
highlight_peak
load_experiment
lookup_angle
mesh_scan
mesh_scan_complete
mesh_scan_process
optimize_coverage
optimize_coverage_complete
optimize_coverage_process
save_CSV
save_experiment
select_peak
switch_centering
switch_crystal
switch_group
update_goniometer
update_peaks
update_plan
update_wavelength
visualize
- class Atom(view, model)[source]#
Bases:
objectMethods
set_info()Set atom parameters in the view using the selected isotope.
Set the selected isotope and close the dialog.
- class PeriodicTable(view, model)[source]#
Bases:
objectMethods
connect_atom_model_view(atom)Connect the atom model and view for the selected atom.
show_atom_dialog(atom)Show the atom selection dialog for the given atom.
update_selection(data)Update the atom selection in the model and view.
- connect_atom_model_view(atom)[source]#
Connect the atom model and view for the selected atom.
- Parameters:
- atomobject
Atom identifier or data.
- class Sample(view, model)[source]#
Bases:
NeuXtalVizPresenterMethods
Add a sample to the model and update the view with absorption and mesh.
change_lattice()Enable or disable reciprocal lattice display in the view.
Highlight the selected goniometer row in the view.
load_UB()Load UB matrix from file and update the view and model.
save_screenshot()Save a screenshot of the current view to a file.
Set the goniometer table in the view and update atoms.
update_complete([status])Indicate completion to the user and reset progress.
update_invalid()Indicate invalid parameters to the user and reset progress.
update_oriented_lattice()Update the oriented lattice parameter display in the view.
Update sample parameters and constraints in the view.
update_processing([status, progress])Indicate processing state to the user and update progress.
update_progress(progress)Update progress step in the view.
update_status(status)Update status information in the view.
view_ab()Set the view to the c* direction (real lattice).
view_ab_star()Set the view to the c-axis direction (reciprocal lattice).
view_bc()Set the view to the a* direction (real lattice).
view_bc_star()Set the view to the a-axis direction (reciprocal lattice).
view_ca()Set the view to the b* direction (real lattice).
view_ca_star()Set the view to the b-axis direction (reciprocal lattice).
view_manual()Set the view to a manually specified axis direction.
view_up_manual()Set the view's up direction to a manually specified axis.
- add_sample()[source]#
Add a sample to the model and update the view with absorption and mesh.
- Parameters:
- None
- class UB(view, model)[source]#
Bases:
NeuXtalVizPresenterMethods
change_lattice()Enable or disable reciprocal lattice display in the view.
Handle fractional indexing for peaks and update the view.
Handle integer indexing for peaks and update the view.
save_screenshot()Save a screenshot of the current view to a file.
update_complete([status])Indicate completion to the user and reset progress.
Update the find peaks distance in the view using d value.
Update the find peaks spacing in the view using Q value.
update_invalid()Indicate invalid parameters to the user and reset progress.
update_oriented_lattice()Update the oriented lattice parameter display in the view.
update_processing([status, progress])Indicate processing state to the user and update progress.
update_progress(progress)Update progress step in the view.
update_status(status)Update status information in the view.
view_ab()Set the view to the c* direction (real lattice).
view_ab_star()Set the view to the c-axis direction (reciprocal lattice).
view_bc()Set the view to the a* direction (real lattice).
view_bc_star()Set the view to the a-axis direction (reciprocal lattice).
view_ca()Set the view to the b* direction (real lattice).
view_ca_star()Set the view to the b-axis direction (reciprocal lattice).
view_manual()Set the view to a manually specified axis direction.
view_up_manual()Set the view's up direction to a manually specified axis.
add_peak
calculate_hkl
calculate_peaks
cluster
cluster_complete
cluster_process
convert_Q
convert_Q_complete
convert_Q_process
convert_to_hkl
convert_to_hkl_complete
convert_to_hkl_process
filter_peaks
filter_peaks_complete
filter_peaks_process
find_conventional
find_conventional_complete
find_conventional_process
find_niggli
find_niggli_complete
find_niggli_process
find_peaks
find_peaks_complete
find_peaks_process
get_clim_method
get_modulation_info
get_normal
get_vlim_method
highlight_cell
highlight_peak
index_peaks
index_peaks_complete
index_peaks_process
integrate_peaks
integrate_peaks_complete
integrate_peaks_process
lattice_transform
load_Q
load_UB
load_detector_calibration
load_goniometer_calibration
load_peaks
load_tube_calibration
predict_peaks
predict_peaks_complete
predict_peaks_process
refine_UB
refine_UB_complete
refine_UB_process
reslice
save_Q
save_UB
save_peaks
select_cell
select_cell_complete
select_cell_process
set_UB
show_cells
show_cells_complete
show_cells_process
switch_instrument
symmetry_transform
transform_UB
transform_UB_complete
transform_UB_process
update_check_hkl
update_instrument_view
update_instrument_view_complete
update_instrument_view_process
update_lattice_info
update_roi
update_scan
update_wavelength
visualize
- hand_index_fractional()[source]#
Handle fractional indexing for peaks and update the view.
- Parameters:
- None
- hand_index_integer()[source]#
Handle integer indexing for peaks and update the view.
- Parameters:
- None
- update_find_distance()[source]#
Update the find peaks distance in the view using d value.
- Parameters:
- None
- class VolumeSlicer(view, model)[source]#
Bases:
NeuXtalVizPresenterMethods
change_lattice()Enable or disable reciprocal lattice display in the view.
save_screenshot()Save a screenshot of the current view to a file.
update_complete([status])Indicate completion to the user and reset progress.
Update colorbar value limits in the view based on user input.
update_invalid()Indicate invalid parameters to the user and reset progress.
Update slice and cut limits in the view based on input.
update_oriented_lattice()Update the oriented lattice parameter display in the view.
update_processing([status, progress])Indicate processing state to the user and update progress.
update_progress(progress)Update progress step in the view.
update_status(status)Update status information in the view.
view_ab()Set the view to the c* direction (real lattice).
view_ab_star()Set the view to the c-axis direction (reciprocal lattice).
view_bc()Set the view to the a* direction (real lattice).
view_bc_star()Set the view to the a-axis direction (reciprocal lattice).
view_ca()Set the view to the b* direction (real lattice).
view_ca_star()Set the view to the b-axis direction (reciprocal lattice).
view_manual()Set the view to a manually specified axis direction.
view_up_manual()Set the view's up direction to a manually specified axis.
cut_data
cut_data_complete
cut_data_process
get_axis
get_clim_method
get_normal
get_vlim_method
load_NXS
load_NXS_complete
load_NXS_process
redraw_data
redraw_data_complete
redraw_data_process
save_cut
save_slice
slice_data
slice_data_complete
slice_data_process
update_cut
update_cut_value
update_slice
update_slice_value
update_volume
- update_cvals()[source]#
Update colorbar value limits in the view based on user input.
Uses vmin, vmax from the view and sets colorbar limits if valid.