IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 28, 2013, 3:32:59 PM (13 years ago)
Author:
bills
Message:

Get the cut for input seeing from new recipe value PSASTRO.MAX.ALLOWED.FWHM instead
of camera.config

Change value for CNP_DATASET recipe. Start using that recipe for CNP.nightlyscience

File:
1 edited

Legend:

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

    r35715 r35723  
    117117my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    118118
     119my $recipeData;
     120{
     121    # Get the PSASTRO recipe
     122    my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
     123    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     124        run(command => $command, verbose => $verbose);
     125    unless ($success) {
     126        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     127        &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);
     128    }
     129    $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
     130        &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
     131}
     132
    119133my $cmdflags;
    120134
     
    160174    chomp $cmdflags;
    161175
    162     { # Determine if FWHM is too large to bother continuing.
    163         my $maxFWHM = 0;
    164       # XXX: temporary hack if this is a CNP exposure set maxFWHM to a large
    165       # value.
    166       # Before the next tag we will put this into a recipe
    167       if ($outroot =~ /CNP/) {
    168             $maxFWHM = 25;
    169       } else {
    170         my $command = "$ppConfigDump -camera $camera -get-key MAX_ALLOWED_FWHM";
    171         my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    172             run(command => $command, verbose => $verbose);
    173         unless ($success) {
    174             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    175             &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);
    176         }
    177         if (@$stdout_buf) {
    178             my $cameraConfig = $mdcParser->parse(join "", @$stdout_buf) or
    179                 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
    180             $maxFWHM = metadataLookupStr($cameraConfig, 'MAX_ALLOWED_FWHM');
    181         }
    182       }
    183         if ($maxFWHM) {
    184             my $expFWHM;
    185             ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/;     
    186            
    187             if ($expFWHM > $maxFWHM) {
    188                 print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM  maximum: $maxFWHM\n";
    189                 $cmdflags .= " -quality 4007 "; # This corresponds to PSASTRO_ERR_DATA
    190                 $no_op = 1;
    191             }
    192         }
     176    # Determine if FWHM is too large to bother continuing.
     177    my $maxFWHM = metadataLookupF32($recipeData, 'PSASTRO.MAX.ALLOWED.FWHM');
     178    if ($maxFWHM) {
     179        my $expFWHM;
     180        ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/; 
     181       
     182        if ($expFWHM > $maxFWHM) {
     183            print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM  maximum: $maxFWHM\n";
     184            $cmdflags .= " -quality 4007 "; # This corresponds to PSASTRO_ERR_DATA
     185            $no_op = 1;
     186        }
    193187    }
    194188}
     
    197191my $do_masks;               # Produce masks?
    198192if (!$skip_masks) {
    199     # Get the PSASTRO recipe
    200     my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
    201     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    202         run(command => $command, verbose => $verbose);
    203     unless ($success) {
    204         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    205         &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);
    206     }
    207     my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
    208         &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
    209 
    210193    $do_masks = metadataLookupBool($recipeData, 'REFSTAR_MASK');
    211194}
     
    235218    $psastroInputArg = " -list $list3Name";
    236219} else {
    237     # for $run_state eq 'update' we onlly rebuild the masks using psastro
     220    # for $run_state eq 'update' we only rebuild the masks using psastro
    238221    $do_stats = 0;
    239222    $do_jpegs = 0;
     
    317300    $configuration = prepare_output("PSASTRO.CONFIG",  $outroot, undef, 1);
    318301} else {
    319     # Do not use the original recipes because they might contain the
     302    # Do not use the original recipes for updates because they might contain the
    320303    # recipe values that caused the masks to get fouled up in the first place
    321304    # $configuration = $ipprc->filename("PSASTRO.CONFIG",  $outroot, undef);
Note: See TracChangeset for help on using the changeset viewer.