IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17549


Ignore:
Timestamp:
May 6, 2008, 3:04:13 PM (18 years ago)
Author:
Paul Price
Message:

Adding missing primary header keywords.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/ipp_mops_translate.pl

    r17520 r17549  
    1515use constant ZERO_POINT => 25;  # Magnitude zero point
    1616use constant MAG_ERROR => 0.1;  # Error in magnitudes
     17use constant OBSERVATORY_CODE => 566; # IAU Observatory Code
     18use constant FAKE_LIMITING_MAG => 23.0; # Fake limiting magnitude to report
     19use constant FAKE_DETECTION_EFFICIENCY => 0.0; # Fake detection efficiency to report
    1720
    1821my ( $input,                    # Name of input file with IPP photometry
     
    2023     $skycell,                  # Skycell file with WCS
    2124     $output,                   # Name of output file
    22      $save_temps
     25     $save_temps,               # Save temporary files?
    2326     );
    2427
    2528GetOptions(
    26            'input=s'   => \$input,
    27            'extname=s' => \$extname,
    28            'skycell=s' => \$skycell,
    29            'output=s'  => \$output,
    30            'save-temps'        => \$save_temps, # Save temporary files?
     29           'input=s'    => \$input,
     30           'extname=s'  => \$extname,
     31           'skycell=s'  => \$skycell,
     32           'output=s'   => \$output,
     33           'save-temps' => \$save_temps,
    3134) or pod2usage( 2 );
    3235
     
    5659    'FPA.RA'       => { name => 'RA',       type => TSTRING, comment => 'Right ascension of boresight'},
    5760    'FPA.DEC'      => { name => 'DEC',      type => TSTRING, comment => 'Declination of boresight' },
    58     'FPA.NAME'     => { name => 'FPA.ID',   type => TSTRING, comment => 'Exposure identifier' },
     61    'FPA.NAME'     => { name => 'FPA_ID',   type => TSTRING, comment => 'Exposure identifier' },
    5962    'FPA.FILTER'   => { name => 'FILTER',   type => TSTRING, comment => 'Filter name' },
    6063    'EXPTIME'      => { name => 'EXPTIME',  type => TDOUBLE, comment => 'Exposure time' },
     
    170173}
    171174
     175# Stellar PSF
     176my $fwhm = 0.5 * 3600 * ($inHeader->{'FWHM_X'} * $cdelt1 + $inHeader->{'FWHM_Y'} * $cdelt2); # FWHM for star
     177$outFits->write_key( TSTRING, 'STARPSF', $fwhm, 'Stellar PSF (arcsec)', $status );
     178check_fitsio( $status );
     179
     180# Observatory code
     181$outFits->write_key( TINT, 'OBSCODE', OBSERVATORY_CODE, 'IAU observatory code', $status );
     182
     183# Limiting magnitude
     184$outFits->write_key( TINT, 'LIMITMAG', FAKE_LIMITING_MAG, 'Limiting magnitude (FAKE)', $status );
     185
     186# Detection efficiency
     187$outFits->write_key( TINT, 'DE1', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     188$outFits->write_key( TINT, 'DE2', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     189$outFits->write_key( TINT, 'DE3', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     190$outFits->write_key( TINT, 'DE4', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     191$outFits->write_key( TINT, 'DE5', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     192$outFits->write_key( TINT, 'DE6', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     193$outFits->write_key( TINT, 'DE7', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     194$outFits->write_key( TINT, 'DE8', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     195$outFits->write_key( TINT, 'DE9', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     196$outFits->write_key( TINT, 'DE10', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
     197
    172198# Write the table
    173199$outFits->create_tbl( BINARY_TBL(), $numRows, scalar @colNames, \@colNames, \@colTypes, undef, EXTNAME,
     
    228254__END__
    229255
    230 
    231 
    232 
    233 
    234 
    235 
    236         fits_create_tbl(fits->fd,
    237                         BINARY_TBL,
    238                         table->n, // number of rows in table
    239                         numColumns, // number of columns in table
    240                         (char**)columnNames->data, // names of the columns
    241                         (char**)columnTypes->data, // format of the columns
    242                         NULL, // physical unit of columns
    243                         NULL, // skip extension name: we set the by hand below
    244                         &status);
    245 
    246 
    247 my $status;                     # Status of FITSIO calls
    248 my $fits = Astro::FITS::CFITSIO::open_file( $filename, READONLY, $status ); # FITS file handle
    249 check_fitsio($status);
    250 $fits->movnam_hdu(BINARY_TBL, $extname, 0, $status) and check_fitsio($status);
    251 my $numRows;                    # Number of rows in table
    252 $fits->get_num_rows($numRows, $status) and check_fitsio($status);
    253 
    254 my ($xCol, $yCol);              # Column numbers for x and y
    255 $fits->get_colnum(0, 'X_PSF', $xCol, $status) and check_fitsio($status);
    256 $fits->get_colnum(0, 'Y_PSF', $yCol, $status) and check_fitsio($status);
    257 
    258 my ($xType, $yType);            # Types for x and y
    259 $fits->get_coltype($xCol, $xType, undef, undef, $status) and check_fitsio($status);
    260 $fits->get_coltype($yCol, $yType, undef, undef, $status) and check_fitsio($status);
    261 
    262 my ($x, $y);                    # Coordinates read from table
    263 $fits->read_col($xType, $xCol, 1, 1, $numRows, 0, $x, undef, $status) and check_fitsio($status);
    264 $fits->read_col($yType, $yCol, 1, 1, $numRows, 0, $y, undef, $status) and check_fitsio($status);
    265 
    266 my ($coordFile, $coordName) = tempfile( "/tmp/ds9_cmf_regions.XXXX", UNLINK => !$save_temps );
    267 for (my $i = 0; $i < $numRows; $i++) {
    268     print $coordFile "image; circle(" . ($$x[$i] + 1) . ',' . ($$y[$i] + 1) .
    269         ",$radius \# color = $colour\n";
    270 }
    271 close $coordFile;
Note: See TracChangeset for help on using the changeset viewer.