Changeset 21195 for trunk/ippScripts/scripts/ipp_mops_translate.pl
- Timestamp:
- Jan 27, 2009, 4:06:36 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ipp_mops_translate.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_mops_translate.pl
r19732 r21195 10 10 use Math::Trig; 11 11 use Data::Dumper; 12 use PS::IPP::Config 1.01 qw( :standard ); 13 14 my $ipprc = PS::IPP::Config->new(); 12 15 13 16 use constant EXTNAME => 'MOPS_TRANSIENT_DETECTIONS'; # Extension name for output table … … 69 72 70 73 # Read the skycell header for the WCS 71 my ($wcsheader, $status) = Astro::FITS::CFITSIO::fits_read_header( $skycell ); 74 my $skycellResolved = $ipprc->file_resolve( $skycell ); 75 my $status = 0; 76 my $skyfile_fits = Astro::FITS::CFITSIO::open_file( $skycellResolved, READONLY, $status ); 77 die("failed to open skycell file: $skycellResolved: $status") if $status; 78 79 my $wcsheader; 80 ($wcsheader, $status) = Astro::FITS::CFITSIO::fits_read_header( $skyfile_fits ); 81 die("Unable to read skycell header: $status") if $status; 72 82 73 83 # Get the useful header keywords 74 my $naxis1 = $$wcsheader{'NAXIS1'} or die("Can't find NAXIS1"); 75 my $naxis2 = $$wcsheader{'NAXIS2'} or die("Can't find NAXIS2"); 84 my $naxis1 = $$wcsheader{'NAXIS1'}; 85 my $naxis2; 86 if ($naxis1) { 87 $naxis2 = $$wcsheader{'NAXIS2'} or die("Can't find NAXIS2"); 88 } else { 89 # if the skyfile is compressed then the WCS won't be in the primary header 90 my $hdutype; 91 $skyfile_fits->movrel_hdu(1, $hdutype, $status); 92 die("Unable to movrel_hdu: $status") if $status; 93 94 ($wcsheader, $status) = Astro::FITS::CFITSIO::fits_read_header( $skyfile_fits ); 95 die("Unable to read extension header: $status") if $status; 96 my $xtension = $$wcsheader{'XTENSION'} or die("Can't find XTENSION"); 97 die("XTENSION found: $xtension") if $xtension ne "'BINTABLE'"; 98 $naxis1 = $$wcsheader{'ZNAXIS1'} or die("Can't find ZNAXIS1"); 99 $naxis2 = $$wcsheader{'ZNAXIS2'} or die("Can't find ZNAXIS2"); 100 } 101 76 102 my $ctype1 = $$wcsheader{'CTYPE1'} or die("Can't find CTYPE1"); 77 103 my $ctype2 = $$wcsheader{'CTYPE2'} or die("Can't find CTYPE2"); … … 185 211 186 212 # Stellar PSF 187 my $fwhm = 0.5 * 3600 * ($inHeader->{'FWHM_ X'} * $cdelt1 + $inHeader->{'FWHM_Y'} * $cdelt2); # FWHM for star213 my $fwhm = 0.5 * 3600 * ($inHeader->{'FWHM_MAJ'} * $cdelt1 + $inHeader->{'FWHM_MIN'} * $cdelt2); # FWHM for star 188 214 $outFits->write_key( TSTRING, 'STARPSF', $fwhm, 'Stellar PSF (arcsec)', $status ); 189 215 check_fitsio( $status );
Note:
See TracChangeset
for help on using the changeset viewer.
