Changeset 19721
- Timestamp:
- Sep 23, 2008, 3:06:53 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/register_imfile.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/register_imfile.pl
r17964 r19721 21 21 use PS::IPP::Metadata::Config; 22 22 use PS::IPP::Metadata::Stats; 23 24 my $PI = 3.141592653589793238462643383279502; 23 25 24 26 my $ipprc = PS::IPP::Config->new(); # IPP configuration … … 74 76 { name => "FPA.TELESCOPE", type => "constant", flag => "-telescope", dtype => "string" }, # Telescope 75 77 { name => "FPA.CAMERA", type => "constant", flag => "-inst", dtype => "string" }, # Instrument 78 { name => "FPA.LONGITUDE", type => "constant", flag => "-longitude", dtype => "float" }, # Site longitude 79 { name => "FPA.LATITUDE", type => "constant", flag => "-latitude", dtype => "float" }, # Site latitude 80 { name => "FPA.ELEVATION", type => "constant", flag => "-elevation", dtype => "float" }, # Site elevation 76 81 { name => "FPA.M1X", type => "constant", flag => "-m1_x", dtype => "float" }, # M1X 77 82 { name => "FPA.M1Y", type => "constant", flag => "-m1_y", dtype => "float" }, # M1Y … … 172 177 $command .= $stats->cmdflags(); 173 178 179 # determine solar-system parameters 180 my $longitude = $stats->value_for_flag ("-longitude"); 181 my $latitude = $stats->value_for_flag ("-latitude"); 182 my $elevation = $stats->value_for_flag ("-elevation"); 183 my $ra = $stats->value_for_flag ("-ra"); 184 my $dec = $stats->value_for_flag ("-decl"); 185 my $dateobs = $stats->value_for_flag ("-dateobs"); 186 187 # if the needed data is available, pass it to sunmoon: 188 if ($longitude && $latitude && $ra && $dec && $dateobs) { 189 190 $longitude *= 12.0 / $PI; # longitude is reported in West radians; sunmoon wants it in West Hours 191 $latitude *= 180.0 / $PI; # latitude is reported in North radians; sunmoon wants it in North Degrees 192 $ra *= 180.0 / $PI; # ra is reported in radians; sunmoon wants it in degrees 193 $dec *= 180.0 / $PI; # dec is reported in radians; sunmoon wants it in degrees 194 195 my $sunmoon_cmd = "sunmoon -latitude $latitude -longitude $longitude -elevation $elevation $ra $dec $dateobs"; 196 my $sunmoon_data = `$sunmoon_cmd`; 197 chomp $sunmoon_data; 198 199 # print STDERR "run: $sunmoon_cmd\n"; 200 # print STDERR "got: $sunmoon_data\n"; 201 202 if ($?) { 203 warn ("failure running $sunmoon_cmd, not supplying\n"); 204 } else { 205 $command .= " $sunmoon_data"; 206 } 207 } 208 174 209 $now_time = localtime(); 175 210 printf STDERR "\nrunning regtool update: %s\n", $now_time if $verbose;
Note:
See TracChangeset
for help on using the changeset viewer.
