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: object

Presenter 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

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_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.

change_lattice()[source]#

Enable or disable reciprocal lattice display in the view.

save_screenshot()[source]#

Save a screenshot of the current view to a file.

update_complete(status='Complete!')[source]#

Indicate completion to the user and reset progress.

Parameters:
statusstr, optional

Completion message (default is “Complete!”).

update_invalid()[source]#

Indicate invalid parameters to the user and reset progress.

update_oriented_lattice()[source]#

Update the oriented lattice parameter display in the view.

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.

update_status(status)[source]#

Update status information in the view.

Parameters:
statusstr

Status message to display.

view_ab()[source]#

Set the view to the c* direction (real lattice).

view_ab_star()[source]#

Set the view to the c-axis direction (reciprocal lattice).

view_bc()[source]#

Set the view to the a* direction (real lattice).

view_bc_star()[source]#

Set the view to the a-axis direction (reciprocal lattice).

view_ca()[source]#

Set the view to the b* direction (real lattice).

view_ca_star()[source]#

Set the view to the b-axis direction (reciprocal lattice).

view_manual()[source]#

Set the view to a manually specified axis direction.

view_up_manual()[source]#

Set the view’s up direction to a manually specified axis.

class CrystalStructure(view, model)[source]#

Bases: NeuXtalVizPresenter

Methods

calculate_F2()

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.

calculate_hkl()

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_groups()

Generate space groups for the selected crystal system and update the view.

generate_settings()

Generate settings for the selected space group and update the view.

highlight_row()

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_isotope()

Select an isotope and show the periodic table dialog.

set_atom_table()

Set the atom table in the view and update atoms.

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_parameters()

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()[source]#

Start calculation of F2 factors using a worker thread.

Parameters:
None
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
highlight_row()[source]#

Highlight the selected atom row in the view.

Parameters:
None
load_CIF()[source]#

Load a CIF file and update the crystal structure in the view and model.

Parameters:
None
save_INS()[source]#

Save the current crystal structure to an INS file.

Parameters:
None
select_isotope()[source]#

Select an isotope and show the periodic table dialog.

Parameters:
None
set_atom_table()[source]#

Set the atom table in the view and update atoms.

Parameters:
None
update_atoms()[source]#

Update atom positions and related information in the view.

Parameters:
None
update_parameters()[source]#

Update lattice parameters and atom positions in the view.

Parameters:
None
update_selection(data)[source]#

Update the selected isotope and atom table in the view.

Parameters:
dataobject

Selected isotope data.

class Experiment(view, model)[source]#

Bases: NeuXtalVizPresenter

Methods

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()

Load detector calibration file and set it in the view.

load_goniometer()

Load goniometer calibration file and set it in the view.

load_mask()

Load detector mask file and set it in the view.

save_screenshot()

Save a screenshot of the current view to a file.

switch_instrument()

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

add_orientation()[source]#
add_orientation_complete(result)[source]#
add_orientation_process(progress)[source]#
add_settings()[source]#
add_settings_complete(result)[source]#
add_settings_process(progress)[source]#
calculate_double()[source]#
calculate_double_complete(result)[source]#
calculate_double_process(progress)[source]#
calculate_single()[source]#
calculate_single_alt()[source]#
calculate_single_complete(result)[source]#
calculate_single_hkl()[source]#
calculate_single_process(progress)[source]#
create_instrument()[source]#
delete_angles()[source]#
delete_angles_complete(rows)[source]#
delete_angles_process(progress)[source]#
highlight_peak()[source]#
load_UB()[source]#

Load UB matrix from file and update the view and model.

load_detector()[source]#

Load detector calibration file and set it in the view.

load_experiment()[source]#
load_goniometer()[source]#

Load goniometer calibration file and set it in the view.

load_mask()[source]#

Load detector mask file and set it in the view.

lookup_angle(gamma, nu)[source]#
mesh_scan()[source]#
mesh_scan_complete(result)[source]#
mesh_scan_process(progress)[source]#
optimize_coverage()[source]#
optimize_coverage_complete(result)[source]#
optimize_coverage_process(progress)[source]#
save_CSV()[source]#
save_experiment()[source]#
select_peak(gamma, nu)[source]#
switch_centering()[source]#
switch_crystal()[source]#
switch_group()[source]#
switch_instrument()[source]#

Switch instrument and update all related view parameters.

update_goniometer()[source]#
update_peaks()[source]#
update_plan()[source]#
update_wavelength()[source]#
visualize()[source]#
class Atom(view, model)[source]#

Bases: object

Methods

set_info()

Set atom parameters in the view using the selected isotope.

set_isotope()

Set the selected isotope and close the dialog.

set_info()[source]#

Set atom parameters in the view using the selected isotope.

Parameters:
None
set_isotope()[source]#

Set the selected isotope and close the dialog.

Parameters:
None
class PeriodicTable(view, model)[source]#

Bases: object

Methods

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.

show_atom_dialog(atom)[source]#

Show the atom selection dialog for the given atom.

Parameters:
atomobject

Atom identifier or data.

update_selection(data)[source]#

Update the atom selection in the model and view.

Parameters:
dataobject

Selected atom data.

class Sample(view, model)[source]#

Bases: NeuXtalVizPresenter

Methods

add_sample()

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_row()

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_goniometer_table()

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_parameters()

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
highlight_row()[source]#

Highlight the selected goniometer row in the view.

Parameters:
None
load_UB()[source]#

Load UB matrix from file and update the view and model.

Parameters:
None
set_goniometer_table()[source]#

Set the goniometer table in the view and update atoms.

Parameters:
None
update_parameters()[source]#

Update sample parameters and constraints in the view.

Parameters:
None
class UB(view, model)[source]#

Bases: NeuXtalVizPresenter

Methods

change_lattice()

Enable or disable reciprocal lattice display in the view.

hand_index_fractional()

Handle fractional indexing for peaks and update the view.

hand_index_integer()

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_find_distance()

Update the find peaks distance in the view using d value.

update_find_spacing()

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

add_peak()[source]#
calculate_hkl()[source]#
calculate_peaks()[source]#
cluster()[source]#
cluster_complete(result)[source]#
cluster_process(progress)[source]#
convert_Q()[source]#
convert_Q_complete(result)[source]#
convert_Q_process(progress)[source]#
convert_to_hkl()[source]#
convert_to_hkl_complete(result)[source]#
convert_to_hkl_process(progress)[source]#
filter_peaks()[source]#
filter_peaks_complete(result)[source]#
filter_peaks_process(progress)[source]#
find_conventional()[source]#
find_conventional_complete(result)[source]#
find_conventional_process(progress)[source]#
find_niggli()[source]#
find_niggli_complete(result)[source]#
find_niggli_process(progress)[source]#
find_peaks()[source]#
find_peaks_complete(result)[source]#
find_peaks_process(progress)[source]#
get_clim_method()[source]#
get_modulation_info()[source]#
get_normal()[source]#
get_vlim_method()[source]#
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
highlight_cell()[source]#
highlight_peak()[source]#
index_peaks()[source]#
index_peaks_complete(result)[source]#
index_peaks_process(progress)[source]#
integrate_peaks()[source]#
integrate_peaks_complete(result)[source]#
integrate_peaks_process(progress)[source]#
lattice_transform()[source]#
load_Q()[source]#
load_UB()[source]#
load_detector_calibration()[source]#
load_goniometer_calibration()[source]#
load_peaks()[source]#
load_tube_calibration()[source]#
predict_peaks()[source]#
predict_peaks_complete(result)[source]#
predict_peaks_process(progress)[source]#
refine_UB()[source]#
refine_UB_complete(result)[source]#
refine_UB_process(progress)[source]#
reslice()[source]#
save_Q()[source]#
save_UB()[source]#
save_peaks()[source]#
select_cell()[source]#
select_cell_complete(result)[source]#
select_cell_process(progress)[source]#
set_UB()[source]#
show_cells()[source]#
show_cells_complete(result)[source]#
show_cells_process(progress)[source]#
switch_instrument()[source]#
symmetry_transform()[source]#
transform_UB()[source]#
transform_UB_complete(result)[source]#
transform_UB_process(progress)[source]#
update_check_hkl()[source]#
update_find_distance()[source]#

Update the find peaks distance in the view using d value.

Parameters:
None
update_find_spacing()[source]#

Update the find peaks spacing in the view using Q value.

Parameters:
None
update_instrument_view()[source]#
update_instrument_view_complete(result)[source]#
update_instrument_view_process(progress)[source]#
update_lattice_info()[source]#
update_roi()[source]#
update_scan()[source]#
update_wavelength()[source]#
visualize()[source]#
class VolumeSlicer(view, model)[source]#

Bases: NeuXtalVizPresenter

Methods

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_cvals()

Update colorbar value limits in the view based on user input.

update_invalid()

Indicate invalid parameters to the user and reset progress.

update_lims()

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

cut_data()[source]#
cut_data_complete(result)[source]#
cut_data_process(progress)[source]#
get_axis()[source]#
get_clim_method()[source]#
get_normal()[source]#
get_vlim_method()[source]#
load_NXS()[source]#
load_NXS_complete(result)[source]#
load_NXS_process(progress)[source]#
redraw_data(reset=True)[source]#
redraw_data_complete(result)[source]#
redraw_data_process(progress)[source]#
save_cut()[source]#
save_slice()[source]#
slice_data()[source]#
slice_data_complete(result)[source]#
slice_data_process(progress)[source]#
update_cut()[source]#
update_cut_value()[source]#
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.

update_lims()[source]#

Update slice and cut limits in the view based on input.

Uses xmin/max, ymin/max and sets slice/cut limits if valid.

update_slice()[source]#
update_slice_value()[source]#
update_volume()[source]#