Using profiles

Normally the function Spectra::scan() uses the devices (timer, counters, MCAs, etc) as they are selected by an online -tki widget. Sometimes it is preferable to qualify the measurement fully in the function call. Here is an example (other examples can be found in 10.9):

Spectra::scan( device => "dummy", 
	       start => 2, 
	       stop => 2.1, 
	       delta => 0.01, 
	       st => 0.1,
	       title => "A Test Scan", 
	       profile => 
	       { timer => [ qw( t1)],
             counter => [ qw( c1 c2 idoris hhe1)], 
             mca1 => { channels => 1024},
             mca2 => { channels => 4096},
             sca1 => { mca => "mca1",
                       min => 1000,
                       max => 2000},
             flags => [ qw( write_to_disk 1
                            display_deadtime 1
                            bell_on_scan_end 1)], 
             before_during_function => sub { 
             Spectra::move( mot2 => $Spectra::SYM{ position});
		 }});

Notice that scan types and parameters can be selected as described in sections 5.1 and 5.2.

The new feature is the profile parameter which contains the devices, flags and a function which is executed at the beginning of the during-macro.

When Online finds the profile parameter it stores the current device selection in the file /online_dir/Profile-temp.db. In a next step the device selection is cleared and all flags are set to their defaults. Then the scan is executed using the specifications of the profiel parameter. After the scan finished, the original status is restored.

Here is a list of flags that can be set:

automatic_beamshutter, default: 0, Scan->Flags
Online uses was_injection() instead of start_and_wait_for_timer() in the during-macro. Details about the automatic beam shutter mode can be found in the online -tki manual ( Online -tki).

auto_filter, default: 0, Scan->Flags
Some details about this feature are explained in the online -tki manual ( Online -tki).

automatic_filter_script, default: 0, Scan->Flags
The details about this feature are explained in the online -tki manual ( Online -tki).

auto_return, default: 1, Scan->Flags

0 No auto return
1 Auto return
2 If SSA returned 1, goto midpoint
3 If SSA returned 1, goto CMS
4 If SSA returned 1, goto highest point
5 Return to start-of-scan

bell_on_scan_end, default: 1, Scan->Flags
Rings the bell at the end of the scan.

coarse, default: 0, Diff->Alignment
Selects coarse scans during the diffractometer alignment.

continuous_raw, default: 0, Scan->Flags
This flag can be used with continuous scans. It allows you to use VCs and MCAs in a continuous scan at the cost of reduced temporal coverage. See the explanations in the online -tki manual ( Online -tki).

create_info_file, default: 0, Scan->Flags
An info file is created for each scan.

create_ps_file, default: 1, Scan->Flags
A postscript file is created.

display_deadtime, default: 1, Scan->Flags
The deadtime is display at the top of the Scan widget.

mca_doris_digital, default: 1, MCA->Options
The MCA widget reads the DORIS current from a Web server.

doris_wait_for_sync_run, default: 0, widget: Scan->Flags
Place a call to Spectra::wait_for_sync_run() into the during-macro. This function queries a Web server for the current accelerator state. It returns, if the state is 'Sync Run'.

exafs_log, default: 1, Scan->Options->Scan Parameters
The EXAFS signal is displayed using a log. scale.

fio_comments, default: 0, widget: Scan->Flags
Online evaluates the function Spectra::fio_comments() and copies the return value, a string, into the output file. In general the string consists of several lines, e.g.: "line1 \n line2 \n line3 \n". If lines do not begin '!', they are treated as 'official' comments. These comments are accessible by the comment() function and they are copied into .fio files. Mind that only up to 10 official comment lines are allowed. However, Spectra::fio_comment() may return lots of lines that begin with '!'. The file /online_dir/TkIrc.pl may contain the definition of Spectra::fio_comments().

fio_parameters, default: 0, widget: Scan->Flags
Online evaluates the function Spectra::fio_parameters() and copies the return value, a string, into the output file. The string has the following format: "parname1 = val1 \n parname2 = val2 \n parname3 = val3 \n". The file /online_dir/TkIrc.pl may contain the definition of Spectra::fio_parameters().

include_motor_positions, default: 1, Scan->Flags
The motors positions are stored in the .fio file.

include_regions, default: 0, Scan->Flags
The regions are stored in the .fio file.

mca_y_log, default: 0, Scan->Options->Select Scan Devices
MCAs are displayed using a log y-scale.

mostab_analog, default: 0, Misc->MOSTAB
If set to 1, the DORIS current is fed into the front panel of the MOSTAB via cable.

mostab_i1, default: 0, Misc->MOSTAB
If it is 0, no DORIS signal is used for the MOSTAB, neither analog nor digital.

mostab_peakSearch, default: 0, Misc->MOSTAB
Triggers the peak search of the MOSTAB in the before-macro, Mostab("p").

normalize_counts, default: 0, Scan->Options->Select Scan Devices
The counter contents are divieded by the sample time.

preset, default 0, Scan->Options->Select Scan Devices
If set to 1, the timer runs in preset mode, i.e. no sample time is supplied, instead the timer is loaded with a value that is decremented by a flux signal.

print_ps_file, default: 0, Scan->Flags
The postscript file is automatically printed.

sca_net, default: 0, Scan->Options->Select Scan Devices
If enabled, the SCAs are calculated from the RIOs by subtracting a linear background.

scan_x_log, default: 0, Scan->Flags
The x-scale is logarithmic.

scan_y_log, default: 0, Scan->Flags
The y-scale is logarithmic.

smartListboxUpdate, default: 0, Scan->Flags

stack_plots, default: 0, Scan->Options->Scan Parameters
A repeated continuous scan option, no display during sweeps

use_mostab, default: 0, Scan->Flags
The MOSTAB operation is described on the online -tki manual ( Online -tki).

write_to_disk, default: 1, Scan->Flags
The disk file is created without prompting for confirmation.

zip_mca_files, default: 0, Scan->Options->Select Scan Devices
The directory that contains the MCA files is zipped.