Index: trunk/ippScripts/scripts/ipp_mops_translate.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_mops_translate.pl	(revision 19732)
+++ trunk/ippScripts/scripts/ipp_mops_translate.pl	(revision 21195)
@@ -10,4 +10,7 @@
 use Math::Trig;
 use Data::Dumper;
+use PS::IPP::Config 1.01 qw( :standard );
+
+my $ipprc = PS::IPP::Config->new();
 
 use constant EXTNAME => 'MOPS_TRANSIENT_DETECTIONS'; # Extension name for output table
@@ -69,9 +72,32 @@
 
 # Read the skycell header for the WCS
-my ($wcsheader, $status) = Astro::FITS::CFITSIO::fits_read_header( $skycell );
+my $skycellResolved = $ipprc->file_resolve( $skycell );
+my $status = 0;
+my $skyfile_fits = Astro::FITS::CFITSIO::open_file( $skycellResolved, READONLY, $status ); 
+    die("failed to open skycell file: $skycellResolved: $status") if $status;
+
+my $wcsheader;
+($wcsheader, $status) = Astro::FITS::CFITSIO::fits_read_header( $skyfile_fits );
+die("Unable to read skycell header: $status") if $status;
 
 # Get the useful header keywords
-my $naxis1 = $$wcsheader{'NAXIS1'} or die("Can't find NAXIS1");
-my $naxis2 = $$wcsheader{'NAXIS2'} or die("Can't find NAXIS2");
+my $naxis1 = $$wcsheader{'NAXIS1'};
+my $naxis2;
+if ($naxis1) {
+    $naxis2 = $$wcsheader{'NAXIS2'} or die("Can't find NAXIS2");
+} else {
+    # if the skyfile is compressed then the WCS won't be in the primary header
+    my $hdutype;
+    $skyfile_fits->movrel_hdu(1, $hdutype, $status);
+    die("Unable to movrel_hdu: $status") if $status;
+
+    ($wcsheader, $status) = Astro::FITS::CFITSIO::fits_read_header( $skyfile_fits );
+    die("Unable to read extension header: $status") if $status;
+    my $xtension = $$wcsheader{'XTENSION'} or die("Can't find XTENSION");
+    die("XTENSION found: $xtension") if $xtension ne "'BINTABLE'";
+    $naxis1 = $$wcsheader{'ZNAXIS1'} or die("Can't find ZNAXIS1");
+    $naxis2 = $$wcsheader{'ZNAXIS2'} or die("Can't find ZNAXIS2");
+}
+
 my $ctype1 = $$wcsheader{'CTYPE1'} or die("Can't find CTYPE1");
 my $ctype2 = $$wcsheader{'CTYPE2'} or die("Can't find CTYPE2");
@@ -185,5 +211,5 @@
 
 # Stellar PSF
-my $fwhm = 0.5 * 3600 * ($inHeader->{'FWHM_X'} * $cdelt1 + $inHeader->{'FWHM_Y'} * $cdelt2); # FWHM for star
+my $fwhm = 0.5 * 3600 * ($inHeader->{'FWHM_MAJ'} * $cdelt1 + $inHeader->{'FWHM_MIN'} * $cdelt2); # FWHM for star
 $outFits->write_key( TSTRING, 'STARPSF', $fwhm, 'Stellar PSF (arcsec)', $status );
 check_fitsio( $status );
