mxcubecore.HardwareObjects.abstract.AbstractXRFSpectrum#

Abstract XRF spectrum class. Complient with queue_entry/xrf_spectrum.py

Classes

AbstractXRFSpectrum(name)

Abstract XRFSpectrum procedure.

class mxcubecore.HardwareObjects.abstract.AbstractXRFSpectrum.AbstractXRFSpectrum(name)[source]#

Bases: HardwareObject

Abstract XRFSpectrum procedure.

Emits:

stateChanged: (“stateChanged”, (state)) xrfSpectrumStatusChanged: (“xrfSpectrumStatusChanged”, (error_msg)

default_integration_time#

Time [s]

Type:

float

spectrum_info_dict#

keys defined by the lims model.

Type:

dict

lims#

reference to the lims hardware object

States:

HardwareObjectStates: READY, BUSY, FAULT

Note

_execute_spectrum and spectrum_analyse are hooks to be overloaded for spcific implementation.

create_directory(directory)[source]#

Create a directory, if needed. :param directory: Directory to save the data (full path). :type directory: str

Returns:

Tue if directory created or already exists, False if error.

Return type:

(bool)

execute_spectrum(integration_time=None, filename=None)[source]#

Do the acquisition.

Parameters:
  • integration_time (float) – MCA integration time [s].

  • filename (str) – Data file (full path).

Raises:

RuntimeError – Cannot acquire data.

get_filename(directory, prefix)[source]#

Create file template. :param directory: directory name (full path) :type directory: str

Returns:

File template

Return type:

(str)

init()[source]#

Initialisation

spectrum_analyse()[source]#

Get the spectrum data. Do analysis and save fitted data. The method has to be implemented as specific for each site.

spectrum_command_aborted()[source]#

Spectrum aborted actions

spectrum_command_failed()[source]#

Spectrum failed actions

spectrum_command_finished()[source]#

Actions to do if spectrum acquired.

spectrum_status_change(status_msg)[source]#

Emit the signal xrfSpectrumStatusChanged with appropriate message. :param status_msg: Message to send. :type status_msg: str

spectrum_store_lims()[source]#

Store the data in lims, according to the existing data model.

start_spectrum(integration_time=None, data_dir=None, prefix=None, archive_dir=None, session_id=None, blsample_id=None, cpos=None)[source]#

Start the procedure. Called by the queue_model.

Parameters:
  • integration_time (float) – Inregration time [s].

  • data_dir (str) – Directory to save the data (full path).

  • archive_dir (str) – Directory to save the archive data (full path).

  • prefix (str) – File prefix

  • session_id (int) – Session ID number (from ISpyB)

  • blsample_id (int) – Sample ID number (from ISpyB)