IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27039


Ignore:
Timestamp:
Feb 22, 2010, 5:36:31 PM (16 years ago)
Author:
Paul Price
Message:

Be dynamic about dynamic masks --- only use the dynamic masks for warp if it's turned on in the psastro recipe.

Location:
trunk/ippScripts/scripts
Files:
2 edited

Legend:

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

    r27010 r27039  
    144144}
    145145
     146
     147my $produceMasks;               # Produce masks?
     148{
     149    # Get the PSASTRO recipe
     150    my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe ADDSTAR -";
     151    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     152        run(command => $command, verbose => $verbose);
     153    unless ($success) {
     154        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     155        &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);
     156    }
     157    my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
     158        &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
     159
     160    $produceMasks = metadataLookupBool($recipeData, 'REFSTAR_MASK');
     161}
     162
     163
    146164### not needed to have such an extensive temp file name.
    147165my ($list1File, $list1Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b1.list.XXXX", UNLINK => !$save_temps ); # For binning 1
     
    177195    print $list4File ($chipMask . "\n");
    178196
    179     push @outMasks, $ipprc->filename("PSASTRO.OUTPUT.MASK", $outroot, $class_id);
     197    push @outMasks, $ipprc->filename("PSASTRO.OUTPUT.MASK", $outroot, $class_id) if $produceMasks;
    180198}
    181199close $list1File;
  • trunk/ippScripts/scripts/warp_skycell.pl

    r27019 r27039  
    7777# Recipes to use based on reduction class
    7878$reduction = 'DEFAULT' unless defined $reduction;
    79 my $recipe_pswarp = $ipprc->reduction($reduction, 'WARP_PSWARP'); # Recipe to use for ppImage
    80 unless ($recipe_pswarp) {
    81     &my_die("Couldn't find selected reduction for WARP_PSWARP: $reduction\n", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_CONFIG_ERROR);
     79my $recipe_pswarp = $ipprc->reduction($reduction, 'WARP_PSWARP'); # Recipe to use
     80my $recipe_psastro = $ipprc->reduction($reduction, 'PSASTRO'); # Recipe to use
     81unless ($recipe_pswarp and $recipe_psastro) {
     82    &my_die("Couldn't find selected reduction: $reduction\n", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_CONFIG_ERROR);
    8283}
    8384
     
    121122    $astromSource = metadataLookupStr($metadata, 'ASTROM.SOURCE');
    122123}
     124
     125my $dynamicMasks;               # Use dynamic masks?
     126{
     127    # Get the PSASTRO recipe
     128    my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe ADDSTAR -";
     129    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     130        run(command => $command, verbose => $verbose);
     131    unless ($success) {
     132        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     133        &my_die("Unable to perform ppConfigDump: $error_code", $warp_id, $PS_EXIT_CONFIG_ERROR);
     134    }
     135    my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
     136        &my_die("Unable to parse metadata config doc", $warp_id, $PS_EXIT_CONFIG_ERROR);
     137
     138    $dynamicMasks = metadataLookupBool($recipeData, 'REFSTAR_MASK');
     139}
     140
    123141
    124142my $outputImage = $ipprc->filename("PSWARP.OUTPUT", $outroot, $skycell_id );
     
    153171    my $image = $imfile->{uri}; # Image name
    154172    my $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
    155     my $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $imfile->{cam_path_base}, $imfile->{class_id}); # Mask name
     173
     174    my $mask;                   # Mask name
     175    if ($dynamicMasks) {
     176        $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $imfile->{cam_path_base}, $imfile->{class_id});
     177    } else {
     178        $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $imfile->{chip_path_base}, $imfile->{class_id});
     179    }
    156180
    157181    &my_die("Couldn't find input file: $image", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($image);
Note: See TracChangeset for help on using the changeset viewer.