Automatic filter (Script)

This subsection gives a simple example of an implementation of an automatic absorber procedure. The main code is part of Online. It calls functions that are supplied by the user, normally in /online_dir/TkIrc.pl:

In addition the following symbols have to be provided by the user:

In our example a motor, mot54, is moved in the range from 20 to 30 to keep the signal between 1000 and 5000 counts. The position of the motor is changed by 0.5 units. The signal comes from c1 which is gated by t1. The sample time is 0.1 s:

package Filter; 
use vars qw( $signal_min $signal_max $delta $filter_max $filter_min); 

$delta = 0.5;
( $signal_min, $signal_max) = (1000, 5000); 
( $filter_min, $filter_max) = ( 20, 30); 

sub set
{
    return Spectra::move( mot54 => $_[0]); 
}
sub get
{
    return Spectra::gmup( "mot54"); 
}
sub signal
{
    return (Spectra::vfc( "c1", "t1", 0.1)*10);
}
sub absorption
{
    my $ret = Filter::get(); 
    return( POSIX::exp( $ret));
}