srsinst.rga.instruments.rga100 package
srsinst.rga.instruments.rga100.commands module
RGA100 remote commands allow no space between a set command and the following parameter. Following NSCommand (no space command) classes are derived from Command classes in srsgui to meet the requirement.
- class srsinst.rga.instruments.rga100.commands.IntNSCommand(remote_command_name, unit='', min=0, max=65535, step=1, default_value=None)
Bases:
IntCommand
- class srsinst.rga.instruments.rga100.commands.FloatNSCommand(remote_command_name, unit='', min=-1000000.0, max=1000000.0, step=1e-09, significant_figures=4, default_value=None)
Bases:
FloatCommand
- class srsinst.rga.instruments.rga100.commands.BoolSetNSCommand(remote_command_name, default_value=None)
Bases:
BoolSetCommand
- class srsinst.rga.instruments.rga100.commands.RgaIntCommand(remote_command_name, unit='', min=0, max=65535, step=1, default_value=None)
Bases:
IntNSCommand
Descriptor for an RGA100 remote command to set and query an integer value. Setting a value returns a status byte, which is stored as last_set_status
- class srsinst.rga.instruments.rga100.commands.RgaFloatCommand(*args, **kwargs)
Bases:
FloatNSCommand
Descriptor for an RGA100 remote command to set and query a float value. Setting a value returns a status byte, which is stored as last_set_status
- class srsinst.rga.instruments.rga100.commands.RgaIonEnergyCommand(*args, **kwargs)
Bases:
RgaIntCommand
Descriptor for a RGA100 remote command to set and query ion energy. only 8 and 12 eV are allowed. Setting a value returns a status byte, which is stored as last_set_status
- class srsinst.rga.instruments.rga100.commands.RgaTotalPressureCommand(remote_command_name, unit='', min=0, max=65535, step=1, default_value=None)
Bases:
IntGetCommand
Descriptor for a RGA100 remote command to query total pressure value returned as a binary long integer. To set a value is not allowed.
- class srsinst.rga.instruments.rga100.commands.RgaStoredCEMGainCommand(*args, **kwargs)
Bases:
FloatNSCommand
Descriptor for a RGA100 remote command to set and query Cem gain stored. The raw data is stored as the gain divided by 1000. And the descriptor converts back to the original value
srsinst.rga.instruments.rga100.components module
- class srsinst.rga.instruments.rga100.components.Defaults
Bases:
object
SRS RGA default values after reset
- ElectronEnergy = 70
- IonEnergy = 12
- FocusVoltage = 90
- InitialMass = 1
- ScanSpeed = 4
- StepsPerAmu = 10
- class srsinst.rga.instruments.rga100.components.Ionizer(parent, name='unnamed')
Bases:
Component
- electron_energy
Descriptor for an RGA100 remote command to set and query an integer value. Setting a value returns a status byte, which is stored as last_set_status
- ion_energy
Descriptor for a RGA100 remote command to set and query ion energy. only 8 and 12 eV are allowed. Setting a value returns a status byte, which is stored as last_set_status
- focus_voltage
Descriptor for an RGA100 remote command to set and query an integer value. Setting a value returns a status byte, which is stored as last_set_status
- emission_current
For typical operation, set emission current to 1 (mA). When the emission current is set to 0, the filament will be turned off
- last_set_status = 0
RgaCommand returns status byte with set operations Check this variable after ionizer set commands
- get_parameters()
Get electron energy, ion energy, focus voltage setting values
- Returns:
(electron_energy, ion_energy, focus_voltage)
- Return type:
tuple
- set_parameters(electron_energy=70, ion_energy=12, focus_voltage=90)
Set electron energy, ion energy and focus voltage
- Parameters:
electron_energy (int) – electron energy electron impact ionization
ion_energy (int) – ion energy, 12 eV or 8 eV
focus_voltage (int) – focus plate voltage
- Returns:
error status after setting
- Return type:
int
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- class srsinst.rga.instruments.rga100.components.Filament(parent, name='unnamed')
Bases:
Component
- last_set_status = 0
RgaCommand returns status byte with set operations Check this value after ionizer set commands
- turn_on(target_emission_current=1.0)
Turn on filament to the target emission current
- Parameters:
target_emission_current (int, optional) – Default is 1.0 mA
- Returns:
error_status – Error status byte
- Return type:
int
- turn_off()
Turn off the filament
- start_degas(degas_minute=3)
Start degas. Subsequent commands are blocked until the degas is over for RGA100.
- allow_run_button = [<function Filament.turn_on>, <function Filament.turn_off>]
Allow methods to have run buttons in the GUI control panel
- add_parent_to_index_commands()
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- class srsinst.rga.instruments.rga100.components.CEM(parent, name='unnamed')
Bases:
Component
- voltage
Descriptor for an RGA100 remote command to set and query an integer value. Setting a value returns a status byte, which is stored as last_set_status
- stored_voltage
- stored_gain
Stored CEM gain. Underlying remote command ‘MG’ returns the gain divided by 1000. This descriptor generates the original value, 1000 times of the raw remote command value.
- turn_on()
Set CEM HV to the stored CEM voltage
- turn_off()
Set CEM HV to the stored CEM voltage
- allow_run_button = [<function CEM.turn_on>, <function CEM.turn_off>]
Allow methods to have run buttons in the GUI control panel
- add_parent_to_index_commands()
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- class srsinst.rga.instruments.rga100.components.Pressure(parent, name='unnamed')
Bases:
Component
- partial_pressure_sensitivity
Partial pressure sensitivity is used to convert a spectrum in current unit to partial pressure unit. The partial pressure sensitivity in the unit of mA/Torr
- total_pressure_sensitivity
Total pressure sensitivity is used to convert total pressure measured in current unit to pressure unit. The total pressure sensitivity in the unit of mA/Torr
- total_pressure_enable
- total_pressure
Total pressure measured in ion current in 0.1 fA
- LowLimit = 0.0001
- sens_factor = 0.0
- reduction_factor = 1.0
- get_total_pressure_in_torr()
- get_partial_pressure_sensitivity_in_torr()
Sensitivity factor is multiplied to a raw ion current value (in 1e-16 A unit) to calculate the partial pressure in Torr
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- class srsinst.rga.instruments.rga100.components.QMF(parent)
Bases:
Component
- class RF(parent, name='unnamed')
Bases:
Component
- slope
- offset
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- class DC(parent, name='unnamed')
Bases:
Component
- slope
- offset
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- class srsinst.rga.instruments.rga100.components.Status(parent, name='unnamed')
Bases:
Component
- id_string
Descriptor for a remote command only to query a string value. To set a value is not allowed.
- error_status
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- error_ps
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- error_detector
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- error_qmf
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- error_cem
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- error_filament
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- error_rs232
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- get_errors()
Get RGA100 error bits in a string Call get_status() with the returned error bis string to get human friendy message
- Returns:
error bits coded in a string
- Return type:
str
- get_error_text(error_bits='')
Get human-firendly error message
- Parameters:
error_bits (str, optional) – error bits in string obtained with get_errors()
srsinst.rga.instruments.rga100.errors module
Module to handle RGA100 error status
- srsinst.rga.instruments.rga100.errors.query_errors(status)
Query all the status registers of RGA100
- Returns:
string that contains colon separated register name and bits
- Return type:
str
- srsinst.rga.instruments.rga100.errors.fetch_error_descriptions(error_string)
Fetch long description of each error bits from the error bit sring from query_errors()
- Returns:
comma separated long description of error bits
- Return type:
str
srsinst.rga.instruments.rga100.rga module
Module contains the main class for operation of SRS RGA100 series
- class srsinst.rga.instruments.rga100.rga.RGA100(interface_type=None, *args)
Bases:
Instrument
Class to control and acquire data with SRS RGA100, 200 and 300 series.
A native SRS RGA has a RS232 serial port that connects with baud rate of 28800, one stop bit, no parity, with RTS/CTS flow control.
There is an option to add Ethernet communication using RGA ethernet adapter
RGA100 class provides methods for establishing communication, basic operation and scans to acquire mass spectra.
Example
from srsinst.rga import RGA100 r1 = RGA100('serial', 'COM3', 28800) # if Ethernet connection is used, # r1 = RGA100('tcpip', '192.168.1.100', 'userid', 'password') r1.filament.turn_on() r1.set_scan_parameters() # Set to defaults xs = r1.scan.get_mass_axis() ys = r1.scan.get_analog_scan() for x, y in zip(xs, ys): print(x, y) r1.filament.turn_off() r1.disconnect()
- available_interfaces = [[<class 'srsgui.inst.communications.serialinterface.SerialInterface'>, {'baud_rate': 28800, 'hardware_flow_control': True, 'port': <srsgui.task.inputs.FindListInput object>}], [<class 'srsgui.inst.communications.tcpipinterface.TcpipInterface'>, {'ip_address': <srsgui.task.inputs.Ip4Input object>, 'password': <srsgui.task.inputs.PasswordInput object>, 'port': 818, 'user_id': <srsgui.task.inputs.StringInput object>}]]
Available_interface specifies the communication interface available with an instrument. As default, SerialInterface and TcpipInterface is provided with the base class. VXI11 interface and VISA interface is available srsinst.sr860 package.
- connect(interface_type, *args)
Connect to an instrument over the specified communication interface
If interface_type is ‘serial’,
- Parameters:
interface_type (str) – Use ‘serial’ for serial communication
port (string) – serial port, such as ‘COM3’ or ‘/dev/ttyUSB0’
baud_rate (int, optional) – baud rate of the serial port, the Instrument class default is 114200, but RGA100 uses 28800 only.
hardware_flow_control (bool, optional) – RTS/CTS setting. The Instrument class default is False, however, RGA100 requires True.
If interface_type is ‘tcpip’,
- Parameters:
interface_type (str) – Use ‘tcpip’ for Ethernet communication
ip_address (str) – IP address of a instrument
user_id (str) – user name for login.
password (str) – password for login.
port (int, optional) – TCP port number. The default is 818.
- check_id()
Check if the connected instrument returns the right ID string and adjust the maximum mass depending on the ID string.
- Returns:
(model_name, serial_number, firmware_version)
- Return type:
tuple
- get_status()
Get instrument status
Returns a string with stauts and error infomation. This method will be called by the owner of the instrument to display status info to its output interface.
- Return type:
str
- handle_command(cmd_string: str)
It sends a remote command and returns the reply, if the remote command returns a reply. if the remote command has no replay, it return a empty string. A terminal program will always get a reply for any remote command, unless unexpected timeout error occurs
- Parameters:
cmd (str) – remote command
- reset()
Reset the instrument.
- check_head_online()
Check if SRS RGA is connected to a communication insterface
For serial communication, it check for DSR line from SRS RGA is set high. For Ethernet communication, it check if the TCP socket is open.
- get_max_mass()
Get maximum mass that can be used for a scan
SRS RGA100 model has the maximum mass of 100 AMU; SRS RGA200, 200 AMU; and SRS RGA300, 300 AMU.
- Returns:
maximum mass
- Return type:
int
- calibrate_all()
Calibrate all
- Returns:
Error status byte after calibration
- Return type:
int
- calibrate_electrometer()
Calibrate electrometer’s I-V response
- Returns:
Error status byte after calibration
- Return type:
int
- allow_run_button = [<function RGA100.reset>, <function RGA100.calibrate_all>, <function RGA100.calibrate_electrometer>]
Allow methods to have run buttons in the GUI control panel
- add_parent_to_index_commands()
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- connect_with_parameter_string(parameter_string)
Connect the instrument using colon-separated parameter string from a config file
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- disconnect()
Disconnect from the instrument
- exclude_capture = [<function Instrument.connect_with_parameter_string>]
Exclude commands from query in capture_commands
- get_available_interfaces()
Get available communication interfaces for the instrument
- Return type:
dict
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_info()
Get the instrument information
default return value is a dictionalry containing model name, serial number, firmware version. A subclass can add more information into the dictionary as needed.
- Return type:
dict
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- get_term_char()
Get the current termination character
- Returns:
termination character for the communication interface
- Return type:
bytes
- is_connected()
Check if the communication interface is connected.
- Return type:
bool
- parent()
- query_float(cmd)
Send a remote command with a float reply, and return the reply as a float.
- Parameters:
cmd (str) – remote command
- Returns:
reply of the remote command
- Return type:
float
- query_int(cmd)
Send a remote command with a integer reply, and return the reply as a integer.
- Parameters:
cmd (str) – remote command
- Returns:
reply of the remote command
- Return type:
int
- query_text(cmd)
Send a remote command with a string reply, and return the reply as a string.
- Parameters:
cmd (str) – remote command
- Returns:
reply of the remote command
- Return type:
str
- send(cmd)
Send a remote command without a reply
- Parameters:
cmd (str) – remote command
- set_name(name)
Set the name of the component
- set_term_char(ch)
Set the termination character for the communication interface
- Parameters:
ch (bytes) – termination character
- update_components()
Update the communication interface of child components with the parent’s
srsinst.rga.instruments.rga100.scans module
- class srsinst.rga.instruments.rga100.scans.Scans(parent)
Bases:
Component
Component for scan setup and data acquisition for RGA100 class
- MaxMass = 100
- initial_mass
- final_mass
- speed
- resolution
- total_points_analog
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- total_points_histogram
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- set_callbacks(data_available=None, scan_started=None, scan_finished=None)
Set callback functions to be called when data is available, when a scan is started, or when the scan is finished. The measurement program that owns the communication interface to the instrument can set the callbacks to run tasks for the events.
- Parameters:
data_available (function(available_data_points:int) or None) – Optional function called when new scan data is available
scan_started (function() or None) – Optional function called when a scan is started
scan_finished (function() or None) – Optional function called after the scan is finished
- set_data_callback_period(period)
Set how often data_available_callback function needs to be called during a scan
It depends on how fast the data display can be redrawn. As data size gets larger, it takes loner time to redraw and a longer period reduces CPU load to handle display update
- Parameters:
period (int) – time in second
- get_data_callback_period(period)
Get the current data_available call back period during a scan
- get_max_mass()
Get maximum mass available to a scan
- Return type:
int
- get_parameters()
Get the current scan parameters.
- Returns:
tuple of (initial_mass, final_mass, scan_speed, steps_per_amu)
- Return type:
(int, int, int, int)
- set_parameters(initial_mass=1, final_mass=65, scan_speed=4, steps_per_amu=10)
Set scan parameters
- Parameters:
initial_mass (int, optional) – the initial mass of an analog or histogram scan. The default is 1 AMU
final_mass (int, optional) – the final mass of an analog or histogram scan. The default is 65 AMU
scan_speed (int, optional) – 0 for the slowest scan, 7 for the fastest scan. The default is 4
steps_per_amu (int, optional) – steps for 1 AMU in analog scan, between 10 and 25. The default is 10. For a histogram scan, it is 1
- read_long()
- static convert_to_long(data)
- get_mass_axis(for_analog_scan=True)
Calculate mass axis array based on the initial mass, final mass, and steps per amu values To be consistent, get_mass_axis after running analog scans or histogram scans.
- Parameters:
for_analog_scan (bool) – True if it is for analog scan, False if it is for histogram scan
- Return type:
NumPy array
- get_analog_scan()
Run an analog scan
Set_scan_parameters() before running
- get_histogram_scan()
Run a histogram scan
- get_multiple_mass_scan(*mass_list)
Run a multi mass scan
- Parameters:
mass_list (list[int]) – list of masses to measure ion current
- Return type:
NumPy array
- get_single_mass_scan(mass)
Measure ion intensity for a single mass
- Parameters:
mass (int) – mass to measure ion current
- Return type:
float
- set_mass_lock(mass)
fix mass filter to a mass
- Parameters:
mass (int) – the mass to fix mass filter
- get_partial_pressure_corrected_spectrum(spectrum)
Convert a spectrum in current unit (0.1 fA) to one in Torr
- get_peak_from_analog_scan(mass, fit=False)
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_name()
Get the name of the component
- is_connected()
check if the current communication interface is open
- parent()
- set_name(name)
Set the name of the component
- update_components()
Update the communication interface of child components with the parent’s
- class srsinst.rga.instruments.rga100.scans.Scans200(parent)
Bases:
Scans
- MaxMass = 200
Scans for RGA200
- initial_mass
- final_mass
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- static convert_to_long(data)
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_analog_scan()
Run an analog scan
Set_scan_parameters() before running
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_data_callback_period(period)
Get the current data_available call back period during a scan
- get_histogram_scan()
Run a histogram scan
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_mass_axis(for_analog_scan=True)
Calculate mass axis array based on the initial mass, final mass, and steps per amu values To be consistent, get_mass_axis after running analog scans or histogram scans.
- Parameters:
for_analog_scan (bool) – True if it is for analog scan, False if it is for histogram scan
- Return type:
NumPy array
- get_max_mass()
Get maximum mass available to a scan
- Return type:
int
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_multiple_mass_scan(*mass_list)
Run a multi mass scan
- Parameters:
mass_list (list[int]) – list of masses to measure ion current
- Return type:
NumPy array
- get_name()
Get the name of the component
- get_parameters()
Get the current scan parameters.
- Returns:
tuple of (initial_mass, final_mass, scan_speed, steps_per_amu)
- Return type:
(int, int, int, int)
- get_partial_pressure_corrected_spectrum(spectrum)
Convert a spectrum in current unit (0.1 fA) to one in Torr
- get_peak_from_analog_scan(mass, fit=False)
- get_single_mass_scan(mass)
Measure ion intensity for a single mass
- Parameters:
mass (int) – mass to measure ion current
- Return type:
float
- is_connected()
check if the current communication interface is open
- parent()
- read_long()
- resolution
- set_callbacks(data_available=None, scan_started=None, scan_finished=None)
Set callback functions to be called when data is available, when a scan is started, or when the scan is finished. The measurement program that owns the communication interface to the instrument can set the callbacks to run tasks for the events.
- Parameters:
data_available (function(available_data_points:int) or None) – Optional function called when new scan data is available
scan_started (function() or None) – Optional function called when a scan is started
scan_finished (function() or None) – Optional function called after the scan is finished
- set_data_callback_period(period)
Set how often data_available_callback function needs to be called during a scan
It depends on how fast the data display can be redrawn. As data size gets larger, it takes loner time to redraw and a longer period reduces CPU load to handle display update
- Parameters:
period (int) – time in second
- set_mass_lock(mass)
fix mass filter to a mass
- Parameters:
mass (int) – the mass to fix mass filter
- set_name(name)
Set the name of the component
- set_parameters(initial_mass=1, final_mass=65, scan_speed=4, steps_per_amu=10)
Set scan parameters
- Parameters:
initial_mass (int, optional) – the initial mass of an analog or histogram scan. The default is 1 AMU
final_mass (int, optional) – the final mass of an analog or histogram scan. The default is 65 AMU
scan_speed (int, optional) – 0 for the slowest scan, 7 for the fastest scan. The default is 4
steps_per_amu (int, optional) – steps for 1 AMU in analog scan, between 10 and 25. The default is 10. For a histogram scan, it is 1
- speed
- total_points_analog
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- total_points_histogram
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- update_components()
Update the communication interface of child components with the parent’s
- class srsinst.rga.instruments.rga100.scans.Scans300(parent)
Bases:
Scans
- MaxMass = 300
Scans for RGA200
- add_parent_to_index_commands()
- allow_run_button = []
Allow methods to have run buttons in the GUI control panel
- assert_command_key(command, key)
It asserts if the component has the command as a DictCommand and DictIndexCommand, and the command has the key in its set_dict.
- capture_commands(include_query_only=False, include_set_only=False, include_excluded=False, include_methods=False, show_raw_cmds=False)
Query all commands with both set and get methods in the component and its subcomponents
- static convert_to_long(data)
- dir = None
Attribute to be used to get a dictionary that contains information on the subcomponents, commands, and class method
- exclude_capture = []
Exclude commands from query in capture_commands
- get_analog_scan()
Run an analog scan
Set_scan_parameters() before running
- get_command_dict(include_superclass=False)
Get a dict of commands available from the component.
list contains strings on command name, command type, remote command it uses
- Returns:
list of commands
- Return type:
list(str)
- get_command_info(command_name)
- get_component_dict()
Get a dict of the child component of the component
- Returns:
list contain name of child compoents and its class name
- Return type:
list(str)
- get_data_callback_period(period)
Get the current data_available call back period during a scan
- get_histogram_scan()
Run a histogram scan
- get_lists(include_superclass=True)
Get the directory containing a list of subcomponents in this component, a list of commands available in the component, a list of method available in the component and its superclass
- get_mass_axis(for_analog_scan=True)
Calculate mass axis array based on the initial mass, final mass, and steps per amu values To be consistent, get_mass_axis after running analog scans or histogram scans.
- Parameters:
for_analog_scan (bool) – True if it is for analog scan, False if it is for histogram scan
- Return type:
NumPy array
- get_max_mass()
Get maximum mass available to a scan
- Return type:
int
- get_method_list(include_superclass=False)
get a list of names of methods available from the component including methods inherited from the superclasses
- Returns:
list of string of method names
- Return type:
list(str)
- get_multiple_mass_scan(*mass_list)
Run a multi mass scan
- Parameters:
mass_list (list[int]) – list of masses to measure ion current
- Return type:
NumPy array
- get_name()
Get the name of the component
- get_parameters()
Get the current scan parameters.
- Returns:
tuple of (initial_mass, final_mass, scan_speed, steps_per_amu)
- Return type:
(int, int, int, int)
- get_partial_pressure_corrected_spectrum(spectrum)
Convert a spectrum in current unit (0.1 fA) to one in Torr
- get_peak_from_analog_scan(mass, fit=False)
- get_single_mass_scan(mass)
Measure ion intensity for a single mass
- Parameters:
mass (int) – mass to measure ion current
- Return type:
float
- initial_mass
- is_connected()
check if the current communication interface is open
- parent()
- read_long()
- resolution
- set_callbacks(data_available=None, scan_started=None, scan_finished=None)
Set callback functions to be called when data is available, when a scan is started, or when the scan is finished. The measurement program that owns the communication interface to the instrument can set the callbacks to run tasks for the events.
- Parameters:
data_available (function(available_data_points:int) or None) – Optional function called when new scan data is available
scan_started (function() or None) – Optional function called when a scan is started
scan_finished (function() or None) – Optional function called after the scan is finished
- set_data_callback_period(period)
Set how often data_available_callback function needs to be called during a scan
It depends on how fast the data display can be redrawn. As data size gets larger, it takes loner time to redraw and a longer period reduces CPU load to handle display update
- Parameters:
period (int) – time in second
- set_mass_lock(mass)
fix mass filter to a mass
- Parameters:
mass (int) – the mass to fix mass filter
- set_name(name)
Set the name of the component
- set_parameters(initial_mass=1, final_mass=65, scan_speed=4, steps_per_amu=10)
Set scan parameters
- Parameters:
initial_mass (int, optional) – the initial mass of an analog or histogram scan. The default is 1 AMU
final_mass (int, optional) – the final mass of an analog or histogram scan. The default is 65 AMU
scan_speed (int, optional) – 0 for the slowest scan, 7 for the fastest scan. The default is 4
steps_per_amu (int, optional) – steps for 1 AMU in analog scan, between 10 and 25. The default is 10. For a histogram scan, it is 1
- speed
- total_points_analog
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- total_points_histogram
Descriptor for a remote command only to query an integer value. To set a value is not allowed.
- update_components()
Update the communication interface of child components with the parent’s
- final_mass
srsinst.rga.instruments.rga100.sicp module
SRS Internet Configuration Protocol (SICP) class
The RGA120 series and RGA Ethernet Adapter (REA) use the IP configuration over UDP broadcasting, SRS IP Configuration protocol (SICP). When a search packet is broadcast, all SICP enabled devices on the Local Area Network (LAN) will respond with a packet. From those packets, you can find available devices on the network.
If an instrument is waiting for IP configuration, you can change the IP settings by broadcasting another packet. For REAs, the IP setting is only available by power-cycle with a hardware button pressed. For RGA120s, the IP setting is available when the ECU is powered while unplugged from the probe.
Because anybody on the local area network can find instruments with SICP, You need to change the default user id and password of the instrument, while you configure IP settings.
Example
from srsinst.rga import SICP
s = SICP()
s.find()
for packet in s.packet_list:
# packet.print_info()
if not packet.is_connected():
print(packet.convert_to_ip_format(packet.ip_address),
' is available.')
- class srsinst.rga.instruments.rga100.sicp.Packet(data)
Bases:
object
- DEVICE_STATUS_CONNECTED = 1
- DEVICE_STATUS_CONFIG_ENABLED = 2
- DEVICE_STATUS_DHCP_RUNNING = 4
- DEVICE_STATUS_DHCP_SUCESS = 8
- DEVICE_STATUS_DHCP_FAILED = 16
- DEVICE_STATUS_IP_CONFLICT = 32
- DEVICE_STATUS_INVALID_LENGTH = 64
- SICP_SEQ_CALL = 1
- SICP_SEQ_REPLY = 2
- SICP_SEQ_SET = 3
- SICP_SEQ_DHCP = 4
- PacketSize = 100
- ST_CONNECTED = 'Connected'
- ST_CONFIGURABLE = 'Configurable'
- ST_IP_CONFLICT = 'IP_conflict'
- ST_DHCP_RUNNING = 'DHCP running'
- ST_DHCP_FAILED = 'DHCP failed'
- ST_DATA_LENGTH_INVALID = 'Error during SICP'
- ST_AVAILABLE = 'Available'
- set_name(name: str)
- set_ip_address(ip: str)
- set_password_reset(value=True)
- decode()
- get_ip_address_string()
- get_mac_address_string()
- is_connected()
- is_configurable()
- is_dhcp_running()
- is_dhcp_successful()
- is_dhcp_failed()
- is_ip_conflicted()
- is_data_length_invalid()
- static convert_to_ip_format(s)
- static convert_to_mac_format(s)
- print_raw()
- print_info()
- get_short_status_from_packet()
- set_sequence_number(number: int)