Pilatus, Multiple Frames, P03

The following virtual counter operates a Pilatus in multiple frame mode, i.e. if the VC is used during a scan, 100 frames (can be edited) are taken at each stop.

# Label: 300k_carsten
#
# Pilatus as virual counter taking several images instead of a single one per
# point during a scan.
#
# here:
#   exposure time given in online defines total exposure time for a single
#   pilatus sequence (including dead time(s)).
#   variable 'numimages' defines the numer of pilatus images to take per scan point
#
# history:
# version 0: A.R., oct 24, 2012
#

   if( $method =~ /reset/i)
   {
    ##########################
    # to be adjusted by user #
    ##########################
    my $numimages=100;    


    my $mydeadtime=0.003;
    my $pil_epo =  $Spectra::SYM{ sample_time} / ($numimages) - $mydeadtime;

    Spectra::tng_attrStringWrt( "pilatus", "FilePrefix", $Spectra::SYM{ scan_name});
    Spectra::tng_attrLongWrt( "pilatus", "NbFrames", $numimages);
    Spectra::tng_attrDoubleWrt( "pilatus", "ExposureTime", $pil_epo);
    Spectra::tng_attrDoubleWrt( "pilatus", "ExposurePeriod", $pil_epo+$mydeadtime);
    Spectra::tng_attrLongWrt( "pilatus", "FileStartNum", ($Spectra::SYM{ sindex}-1)*$numimages+1);

    Spectra::tng_inout("pilatus", "StartStandardAcq");
    return 1;
   }
 
   if( $method =~ /read/i)
   {
     while( Spectra::pilatus_state( "pilatus"))
     {
        Util::log( "waiting for Pilatus "); 
        Spectra::wait( 0.1); 
     } 
     return 1; 
   }