#!/usr/local/bin/perl
# Script to take arguments from DiffAG.html, and return an
# HTML page to the client.
#
# The script can be considered as consisting of the following parts:
#
# (1) Read in arguments passed to script.
# (2) Verification of arguments.
# (3) Make Calculations.
# (4) Generate return HTML page
#
# J.Brewer, August 1998.
##############################################################################
##############################################################################
# (1) Read in arguments passed to script.
##############################################################################
# Below is from Gundavaram (Nutshell book)
$webmaster = "jbrewer\@eso\.org";
&parse_form_data (*ip);
# For compactness, assign array elements to variables...
$pier = $ip{'pier'};
$units = $ip{'units'};
$ra_cm = $ip{'ra_cm'};
$dec_cm = $ip{'dec_cm'};
$dec = $ip{'dec'};
##############################################################################
##############################################################################
# (2) Verification of arguments.
##############################################################################
# Set the error flag
$error = 0;
# $pier and $units are not verified as they are defined
# via pulldown menus
# Check validity of R.A. cross motion rate...
if ($ra_cm < -1000 || $ra_cm > 1000){
if (! $error){&first_error;}
print "ERROR: R.A. cross motion rate is out of range/invalid\n";
}
# Check validity of Dec cross motion rate...
if ($dec_cm < -1000 || $dec_cm > 1000){
if (! $error){&first_error;}
print "ERROR: Dec cross motion rate is out of range/invalid\n";
}
# Bail out if an error occured...
if ($error){exit(1);}
##############################################################################
##############################################################################
# (3) Make Calculations...
##############################################################################
if (!($dec eq "None")){
# Apply 15Cos(Dec) correction to R.A. cross motion rate...
$ra_cm = 15*cos((3.142/180)*$dec)*$ra_cm;
# Round off...
&trun($ra_cm,5);
}
# Convert RA and Dec cross motion to arcsec/sec.
if ($units eq "arcsec/hr"){
$ra_cm = $ra_cm/3600;
$dec_cm = $dec_cm/3600;
} elsif ($units eq "arcsec/min"){
$ra_cm = $ra_cm/60;
$dec_cm = $dec_cm/60;
}
if ($pier eq "East"){
# Use transformations for East of pier...
$RA_CM = 0.6975*($ra_cm - sin((3.142/180)*3)*$dec_cm);
$DEC_CM = 1.1154*($dec_cm - sin((3.142/180)*3)*$ra_cm);
}else{
# Use transformations for West of pier...
$RA_CM = -0.6975*($ra_cm - sin((3.142/180)*3)*$dec_cm);
$DEC_CM = -1.1154*($dec_cm - sin((3.142/180)*3)*$ra_cm);
}
# Round off values...
&trun($RA_CM,4);
&trun($DEC_CM,4);
##############################################################################
##############################################################################
# (4) Generate return HTML page
##############################################################################
$dateX = `date`;
print < Note: 15cos(dec) correction
end_of_print1
if ($dec eq "None"){
print"not made to R.A. cross motion rate.
Differential AG Calculation
Entered Parameters
Telescope Pier: $pier
R.A. Cross Motion: $ip{'ra_cm'} $units
Dec. Cross Motion: $ip{'dec_cm'} $units
Object Declination: $dec
";
print"Corrected Value is $ra_cm
To start differential autoguiding, first acquire a guide
star and start autoguiding. After the autoguider has locked onto the
guide star, open an Xterm on the tcs1d5 WS, and issue the command:
cmd pltrack $RA_CM   $DEC_CM
To stop differential autoguiding switch off the
autoguider and then enter the command:
cmd nopltrack
| This Page Created: $dateX | Comments: jbrewer\@eso.org |
|---|