Index: trunk/ippScripts/scripts/camera_exp.pl
===================================================================
--- trunk/ippScripts/scripts/camera_exp.pl	(revision 35722)
+++ trunk/ippScripts/scripts/camera_exp.pl	(revision 35723)
@@ -117,4 +117,18 @@
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
+my $recipeData;
+{
+    # Get the PSASTRO recipe
+    my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);
+    }
+    $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
+}
+
 my $cmdflags;
 
@@ -160,35 +174,15 @@
     chomp $cmdflags;
 
-    { # Determine if FWHM is too large to bother continuing.
-	my $maxFWHM = 0;
-      # XXX: temporary hack if this is a CNP exposure set maxFWHM to a large
-      # value.
-      # Before the next tag we will put this into a recipe
-      if ($outroot =~ /CNP/) {
-            $maxFWHM = 25;
-      } else {
-	my $command = "$ppConfigDump -camera $camera -get-key MAX_ALLOWED_FWHM";
-	my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	    run(command => $command, verbose => $verbose);
-	unless ($success) {
-	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);
-	}
-	if (@$stdout_buf) {
-	    my $cameraConfig = $mdcParser->parse(join "", @$stdout_buf) or
-		&my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
-	    $maxFWHM = metadataLookupStr($cameraConfig, 'MAX_ALLOWED_FWHM');
-	}
-      }
-	if ($maxFWHM) {
-	    my $expFWHM;
-	    ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/;	
-	    
-	    if ($expFWHM > $maxFWHM) {
-		print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM  maximum: $maxFWHM\n";
-		$cmdflags .= " -quality 4007 "; # This corresponds to PSASTRO_ERR_DATA
-		$no_op = 1;
-	    }
-	}
+    # Determine if FWHM is too large to bother continuing.
+    my $maxFWHM = metadataLookupF32($recipeData, 'PSASTRO.MAX.ALLOWED.FWHM');
+    if ($maxFWHM) {
+        my $expFWHM;
+        ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/;	
+        
+        if ($expFWHM > $maxFWHM) {
+            print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM  maximum: $maxFWHM\n";
+            $cmdflags .= " -quality 4007 "; # This corresponds to PSASTRO_ERR_DATA
+            $no_op = 1;
+        }
     }
 }
@@ -197,15 +191,4 @@
 my $do_masks;               # Produce masks?
 if (!$skip_masks) {
-    # Get the PSASTRO recipe
-    my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-        run(command => $command, verbose => $verbose);
-    unless ($success) {
-        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-        &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);
-    }
-    my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
-        &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
-
     $do_masks = metadataLookupBool($recipeData, 'REFSTAR_MASK');
 }
@@ -235,5 +218,5 @@
     $psastroInputArg = " -list $list3Name";
 } else {
-    # for $run_state eq 'update' we onlly rebuild the masks using psastro
+    # for $run_state eq 'update' we only rebuild the masks using psastro
     $do_stats = 0;
     $do_jpegs = 0;
@@ -317,5 +300,5 @@
     $configuration = prepare_output("PSASTRO.CONFIG",  $outroot, undef, 1);
 } else {
-    # Do not use the original recipes because they might contain the 
+    # Do not use the original recipes for updates because they might contain the 
     # recipe values that caused the masks to get fouled up in the first place
     # $configuration = $ipprc->filename("PSASTRO.CONFIG",  $outroot, undef);
Index: trunk/ippconfig/gpc1/psastro.config
===================================================================
--- trunk/ippconfig/gpc1/psastro.config	(revision 35722)
+++ trunk/ippconfig/gpc1/psastro.config	(revision 35723)
@@ -111,4 +111,7 @@
 #PSASTRO.MODEL.BORESITE.X      F32      -200.0
 #PSASTRO.MODEL.BORESITE.Y      F32     -300.0
+
+# maximum accepted fwhm_major (moved from camera.config
+PSASTRO.MAX.ALLOWED.FWHM              F32       12
 
 # *** make sure the choice of CATDIR (dvo database) contains the photcodes desired below
@@ -360,4 +363,9 @@
 END
 
+CNP_DATASET METADATA
+    ZERO.POINT.USE.MEAN         BOOL    TRUE
+    PSASTRO.MAX.ALLOWED.FWHM    F32     25
+END
+
 LAP_ASTRO METADATA
 #  PSASTRO.CATDIR                STR      3PI.20110505.REFCAT
Index: trunk/ippconfig/megacam/psastro.config
===================================================================
--- trunk/ippconfig/megacam/psastro.config	(revision 35722)
+++ trunk/ippconfig/megacam/psastro.config	(revision 35723)
@@ -50,4 +50,6 @@
 PSASTRO.MAX.ERROR      F32      10.0 # max error in pixels
 PSASTRO.MIN.NSTAR      S32      10   # min fitted stars in solution
+
+PSASTRO.MAX.ALLOWED.FWHM      F32       25
 
 PSASTRO.MOSAIC.MODE           BOOL     TRUE
Index: trunk/ippconfig/recipes/nightly_science.config
===================================================================
--- trunk/ippconfig/recipes/nightly_science.config	(revision 35722)
+++ trunk/ippconfig/recipes/nightly_science.config	(revision 35723)
@@ -281,4 +281,5 @@
   STACKABLE   BOOL FALSE
   DIFFABLE    BOOL FALSE
+  REDUCTION   STR  CNP_DATASET
   CHIP	      S16  800
   WARP	      S16  800
Index: trunk/ippconfig/recipes/psastro.config
===================================================================
--- trunk/ippconfig/recipes/psastro.config	(revision 35722)
+++ trunk/ippconfig/recipes/psastro.config	(revision 35723)
@@ -179,5 +179,6 @@
 MASKSTAT.ADVISORY   U32 0x080
 
-
+# maximum allowed fwhm_major (moved from */camera.config)
+PSASTRO.MAX.ALLOWED.FWHM    F32     0
 
 # 2MASS default configuration (use 2MASS_J as ref magnitude)
@@ -265,4 +266,7 @@
 END
 
+CNP_DATASET METADATA
+END
+
 SYNTH_CAT METADATA
 END
