The Perl Interface

This section contains the Perl functions the operate the diffractometer server:

#
# read the angles
#
my ( $mu, $omega, $chi, $phi, $gamma, $delta) = Spectra::angles(); 
#
# read hkl and psi
#
my ($h, $k, $l, $psi) = Spectra::hkl(); 
#
# move several angles
#
Spectra::angles( mu => $mu, 
		 omega => $omega, 
		 chi => $chi, 
		 phi => $phi,
		 gamma => $gamma,
		 delta => $delta);
#
# read single angles 
#
$mu = Spectra::mu(); 
$omega = Spectra::omega(); 
$chi = Spectra::chi(); 
$phi = Spectra::phi(); 
$gamma = Spectra::gamma(); 
$delta = Spectra::delta(); 
#
# move single angles
#
Spectra::mu( $mu); 
Spectra::omega( $omega); 
Spectra::chi( $chi); 
Spectra::phi( $phi); 
Spectra::gamma( $gamma); 
Spectra::delta( $delta); 
#
# read hkl and psi individually
#
$h = Spectra::h(); 
$k = Spectra::k(); 
$l = Spectra::l(); 
$psi = Spectra::psi();
#
# or 
#
$h = Spectra::hkl( "h"); 
$k = Spectra::hkl( "k"); 
$l = Spectra::hkl( "l"); 
$psi = Spectra::hkl( "psi"); 
#
# move hkl and psi individually
#
Spectra::h( $h); 
Spectra::k( $k); 
Spectra::l( $l); 
Spectra::psi( $psi);
#
# move hkl and psi
#
Spectra::hkl( h => $h, k => $k, l => $l, psi => $psi);
#
# hkl scan
#
Spectra::scan( type => "hkl",
	       start_hkl => [1, 1, 0],  
	       stop_hkl => [1.1, 1.2, 0],  
	       sample_time => 0.1,
	       np => 11);
#
# h scan
#
Spectra::scan( type => "hkl",
	       start_h => 1,
	       stop_h => 3,
	       sample_time => 0.1,
	       np => 11);
#
# angle scans
#   diff_mu, diff_omega, diff_chi, diff_phi, diff_gamma, diff_delta
#
Spectra::scan( type => "diff_mu",
	       start => 1,
	       stop => 3,
	       sample_time => 0.1,
	       np => 11);
#
# scan reflection
#
Spectra::scan( type => "reflection",
	       auto_filter => 0, 
	       centering_order => "moc", 
               coarse => 0, 
	       np_scan =>  11, 
               nobackground_subtraction => 0, 
	       range_mu => 0.5, 
	       range_omega => 0.5, 
	       range_chi => 0.5, 
	       store => 1);