Changeset 26048
- Timestamp:
- Nov 5, 2009, 2:09:48 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_finish.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_finish.pl
r25739 r26048 208 208 209 209 # ra_deg and dec_deg are the coordinates of center of the stamp 210 # first assume that the image is compressed and check the first extension. 211 # If not found check the PHU. If that doesn't work just set them to zero. 210 212 # XXX do this more cleanly 211 my (undef, $ra_deg, $dec_deg) = split " ", `echo $out_dir/$img_name | fields -x -1 RA_DEG DEC_DEG`; 213 my (undef, $ra_deg, $dec_deg) = split " ", `echo $out_dir/$img_name | fields -x 0 RA_DEG DEC_DEG`; 214 if (!defined $ra_deg) { 215 (undef, $ra_deg, $dec_deg) = split " ", `echo $out_dir/$img_name | fields RA_DEG DEC_DEG`; 216 } 212 217 $ra_deg = 0.0 if (!$ra_deg); 213 218 $dec_deg = 0.0 if (!$dec_deg); … … 372 377 my $ra_deg = $exp->{ra} * RADIANS_TO_DEGREES; 373 378 my $decl_deg = $exp->{decl} * RADIANS_TO_DEGREES; 374 my $mjd_obs = dateobs_to_mjd($exp->{dateobs} , $exp->{exp_time});379 my $mjd_obs = dateobs_to_mjd($exp->{dateobs}); 375 380 376 381 my $info = "$mjd_obs|$ra_deg|$decl_deg|$exp->{filter}|$exp->{exp_time}|$exp->{exp_name}"; … … 381 386 sub dateobs_to_mjd { 382 387 my $dateobs = shift; 383 my $exp_time = shift;384 388 385 389 # dateobs is in format: 1970-01-01T00:00:00 … … 391 395 my $ticks = timegm($sec, $min, $hr, $day, $mon-1, $year-1900); 392 396 393 $ticks += $exp_time / 2.0;394 395 397 return 40587.0 + ($ticks/86400.); 396 398 }
Note:
See TracChangeset
for help on using the changeset viewer.
