pyepr.hardware.XeprAPI_link.XeprAPILink¶
- class pyepr.hardware.XeprAPI_link.XeprAPILink(config_file=None)¶
- Parameters:
config_file (str)
- Xepr = None¶
- cur_exp = None¶
- _tmp_dir = None¶
- XeprCmds = None¶
- connect()¶
Connect to the Xepr Spectrometer.
- Return type:
None
- _set_Xepr_global(Xepr_inst)¶
- _get_Xepr_global()¶
- _xepr_retry(func, *args, **kwargs)¶
- get_param(param_name)¶
- Parameters:
param_name (str)
- Parameters:
param_name (str)
- _set_cur_exp_param(param_name, value)¶
- set_param(param_name, value)¶
- Parameters:
param_name (str)
- Parameters:
param_name (str)
- find_Xepr()¶
- _set_cur_exp_global(cur_exp_inst)¶
- _get_cur_exp_global()¶
- find_cur_exp()¶
Try and finds the current experiment
- is_exp_running()¶
- acquire_dataset(sequence=None)¶
This function acquire the dataset, this work both for a running experiment or once it has finished.
- acquire_scan(sequence=None)¶
This script detects the end of the scan and acquires the data set. This requires that the experiment is still running, or recently finished. Once it has been saved this will no longer work.
- acquire_scan_at(scan_num, sequence=None)¶
This script acquires the scan after a specific number of scans
- Parameters:
scan_num (int)
- acquire_scan_2d(sequence=None)¶
This function acquires the dataset after a full 2D scan. This is done by identifying the number of scan steps per sweep and acquiring the data on that scan. This requires that the experiment has not been saved.
- set_PulseSpel_var(variable, value)¶
This can be used to change any pulse spell variable whilst the experiment is running. These changes take effect at the beginning of the next scan
- Parameters:
variable (str)
value (int)
- get_ReplaceMode()¶
- set_ReplaceMode(state=False)¶
- get_PhaseCycle()¶
- set_PhaseCycle(state=True)¶
- get_PulseSpel_exp_filename()¶
- get_PulseSpel_exp_filepath()¶
- set_PulseSpel_exp_filepath(fullpath)¶
- get_PulseSpel_def_filename()¶
- get_PulseSpel_def_filepath()¶
- set_PulseSpel_def_filepath(fullpath)¶
- get_PulseSpel_phase_cycling()¶
- set_PulseSpel_phase_cycling(name)¶
- get_PulseSpel_experiment()¶
- set_PulseSpel_experiment(name)¶
- save_PulseSpel_exp(name=None)¶
- Parameters:
name (str)
- save_PulseSpel_def(name=None)¶
- get_Acquisition_mode()¶
- set_Acquisition_mode(mode)¶
mode=0: Run from tables, mode=1: Run from Pulse Spel, mode=2:Read transient, mode=3:Start Transient
- Parameters:
mode (int)
- compile_PulseSpel_prg()¶
- compile_PulseSpel_def()¶
- run_exp()¶
Runs the current experiment.
- pause_exp()¶
Pauses the current experiment.
- rerun_exp()¶
Re-runs the current experiment. Only for use after a pause commands
- stop_exp()¶
Stops the current experiment.
- abort_exp()¶
Aborts the current experiment.
- xepr_save(path, title=None)¶
_summary_
- Parameters:
- pathstr
_description_
- titlestr, optional
_description_, by default None
- Parameters:
path (str)
title (str)
- get_field()¶
Gets the magnetic field.
- Returns:
- int
Field position in Gauss
- Return type:
int
- set_field(val, hold=True)¶
Sets the magentic field.
- Parameters:
- valint
Field position in Gauss
- holdbool, optional
Wait until Xepr belives the field is stable, by default True
- Returns:
- int
Field position in Gauss
- Parameters:
val (int)
hold (bool)
- Return type:
int
- get_counterfreq()¶
Gets the frequency counter value.
Note: There is no equivalent set command
- Returns:
- float
The counter frequency in GHz
- Return type:
float
- set_sweep_width(val)¶
Sets the field sweep width
- Parameters:
- valint
Field sweep width in Gauss
- Returns:
- int
Field sweep width in Gauss
- Parameters:
val (int)
- Return type:
int
- get_sweep_width()¶
Gets the field sweep width
- Returns:
- int
Field sweep width in Gauss.
- Return type:
int
- set_freq(val, pol=None, precision=False)¶
Sets the current bridge frequency. The stepper motor value is calculated through a conversion.
- Parameters:
- valfloat
The frequency in GHz
- pollist, optional
Conversion polynomal coefficents for freq->Step, by default None
- Returns:
- float
Frequency in GHz
- Parameters:
val (float)
pol (list)
precision (bool)
- Return type:
float
- get_freq(pol=None)¶
Gets the current bridge frequency. The frequency is calculated through a conversion.
- Parameters:
- pollist, optional
Conversion polynomal coefficents for freq->Step, by default None
- Returns:
- float
Frequency in GHz
- Parameters:
pol (list)
- Return type:
float
- get_spec_config()¶
get_spec_config Gets the name of the current spectrometer configuration file.
- Returns:
- str
Returns the name of the current spectrometer configuration file
- Return type:
str
- get_attenuator(channel)¶
- Parameters:
channel (str)
- Return type:
float
- set_attenuator(channel, value)¶
- Parameters:
channel (str)
- Return type:
float
- get_phase(channel)¶
- Parameters:
channel (str)
- Return type:
float
- set_phase(channel, value)¶
- Parameters:
channel (str)
value (float)
- Return type:
float
- get_ELDOR_freq()¶
Gets the freuency of the ELDOR chnannel.
- Returns:
float: ELDOR frequency in GHz
- Return type:
float
- set_ELDOR_freq(value)¶
Sets the freuency of the ELDOR chnannel.
- Args:
value (float): ELDOR frequency in GHz
- Returns:
float: ELDOR frequency in GHz
- Parameters:
value (float)
- Return type:
float
- get_video_gain()¶
Get the video gain in dB
- Returns:
- int
Video gain in dB
- Return type:
int
- set_video_gain(value)¶
Set the video gain in dB
- Parameters:
- valueint
Video gain to be set in dB.
- Returns:
- int
The adjusted video gain
- Parameters:
value (int)
- Return type:
int
- get_config_file()¶
Get the name of the spectrometer configuration file
- Returns:
- str
The name of the spectrometer configuration file
- Return type:
str
- set_config_file(config_file)¶
Sets the name of the spectrometer configuration file. If the current configuration file is already correct, nothing changes.
- Parameters:
- config_filestr
The new configuration file name.
- Returns:
- str
The name of the spectrometer configuration file
- Parameters:
config_file (str)
- Return type:
str
- get_MW_amp()¶
Gets the current setting of the microwave amplifier
- Returns:
- bool
current setting of the microwave amplifier
- Return type:
bool
- set_MW_amp(value)¶
Sets the current setting of the microwave amplifier
- Parameters:
- valuebool
New setting of the microwave amplifier
- Returns:
- bool
Setting of the microwave amplifier
- Parameters:
value (bool)
- Return type:
bool
- get_video_bandwidth()¶
Gets the detection video bandwidth.
- Returns:
- float
Video bandwidth in MHz
- Return type:
float
- set_video_bandwidth(value)¶
Sets the detection video bandwidth.
- Parameters:
- valuefloat
Video bandwidth in MHz, options = [200,20].
- Returns:
- float
Video bandwidth in MHz
- Parameters:
value (float)
- Return type:
float