Index: trunk/ippScripts/scripts/ipp_mops_translate.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_mops_translate.pl	(revision 17520)
+++ trunk/ippScripts/scripts/ipp_mops_translate.pl	(revision 17549)
@@ -15,4 +15,7 @@
 use constant ZERO_POINT => 25;	# Magnitude zero point
 use constant MAG_ERROR => 0.1;	# Error in magnitudes
+use constant OBSERVATORY_CODE => 566; # IAU Observatory Code
+use constant FAKE_LIMITING_MAG => 23.0;	# Fake limiting magnitude to report
+use constant FAKE_DETECTION_EFFICIENCY => 0.0; # Fake detection efficiency to report
 
 my ( $input,			# Name of input file with IPP photometry
@@ -20,13 +23,13 @@
      $skycell,			# Skycell file with WCS
      $output,			# Name of output file
-     $save_temps
+     $save_temps,		# Save temporary files?
      );
 
 GetOptions(
-	   'input=s'   => \$input,
-	   'extname=s' => \$extname,
-	   'skycell=s' => \$skycell,
-	   'output=s'  => \$output,
-	   'save-temps'        => \$save_temps, # Save temporary files?
+	   'input=s'    => \$input,
+	   'extname=s'  => \$extname,
+	   'skycell=s'  => \$skycell,
+	   'output=s'   => \$output,
+	   'save-temps' => \$save_temps,
 ) or pod2usage( 2 );
 
@@ -56,5 +59,5 @@
     'FPA.RA'       => { name => 'RA',       type => TSTRING, comment => 'Right ascension of boresight'},
     'FPA.DEC'      => { name => 'DEC',      type => TSTRING, comment => 'Declination of boresight' },
-    'FPA.NAME'     => { name => 'FPA.ID',   type => TSTRING, comment => 'Exposure identifier' },
+    'FPA.NAME'     => { name => 'FPA_ID',   type => TSTRING, comment => 'Exposure identifier' },
     'FPA.FILTER'   => { name => 'FILTER',   type => TSTRING, comment => 'Filter name' },
     'EXPTIME'      => { name => 'EXPTIME',  type => TDOUBLE, comment => 'Exposure time' },
@@ -170,4 +173,27 @@
 }
 
+# Stellar PSF
+my $fwhm = 0.5 * 3600 * ($inHeader->{'FWHM_X'} * $cdelt1 + $inHeader->{'FWHM_Y'} * $cdelt2); # FWHM for star
+$outFits->write_key( TSTRING, 'STARPSF', $fwhm, 'Stellar PSF (arcsec)', $status );
+check_fitsio( $status );
+
+# Observatory code
+$outFits->write_key( TINT, 'OBSCODE', OBSERVATORY_CODE, 'IAU observatory code', $status );
+
+# Limiting magnitude
+$outFits->write_key( TINT, 'LIMITMAG', FAKE_LIMITING_MAG, 'Limiting magnitude (FAKE)', $status );
+
+# Detection efficiency
+$outFits->write_key( TINT, 'DE1', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE2', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE3', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE4', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE5', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE6', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE7', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE8', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE9', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+$outFits->write_key( TINT, 'DE10', FAKE_DETECTION_EFFICIENCY, 'Detection efficiency (FAKE)', $status );
+
 # Write the table
 $outFits->create_tbl( BINARY_TBL(), $numRows, scalar @colNames, \@colNames, \@colTypes, undef, EXTNAME,
@@ -228,44 +254,2 @@
 __END__
 
-
-
-
-
-
-
-        fits_create_tbl(fits->fd,
-                        BINARY_TBL,
-                        table->n, // number of rows in table
-                        numColumns, // number of columns in table
-                        (char**)columnNames->data, // names of the columns
-                        (char**)columnTypes->data, // format of the columns
-                        NULL, // physical unit of columns
-                        NULL, // skip extension name: we set the by hand below
-                        &status);
-
-
-my $status;			# Status of FITSIO calls
-my $fits = Astro::FITS::CFITSIO::open_file( $filename, READONLY, $status ); # FITS file handle
-check_fitsio($status);
-$fits->movnam_hdu(BINARY_TBL, $extname, 0, $status) and check_fitsio($status);
-my $numRows;			# Number of rows in table
-$fits->get_num_rows($numRows, $status) and check_fitsio($status);
-
-my ($xCol, $yCol);		# Column numbers for x and y
-$fits->get_colnum(0, 'X_PSF', $xCol, $status) and check_fitsio($status);
-$fits->get_colnum(0, 'Y_PSF', $yCol, $status) and check_fitsio($status);
-
-my ($xType, $yType);		# Types for x and y
-$fits->get_coltype($xCol, $xType, undef, undef, $status) and check_fitsio($status);
-$fits->get_coltype($yCol, $yType, undef, undef, $status) and check_fitsio($status);
-
-my ($x, $y);			# Coordinates read from table
-$fits->read_col($xType, $xCol, 1, 1, $numRows, 0, $x, undef, $status) and check_fitsio($status);
-$fits->read_col($yType, $yCol, 1, 1, $numRows, 0, $y, undef, $status) and check_fitsio($status);
-
-my ($coordFile, $coordName) = tempfile( "/tmp/ds9_cmf_regions.XXXX", UNLINK => !$save_temps );
-for (my $i = 0; $i < $numRows; $i++) {
-    print $coordFile "image; circle(" . ($$x[$i] + 1) . ',' . ($$y[$i] + 1) .
-	",$radius \# color = $colour\n";
-}
-close $coordFile;
