IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 4:08:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging trunk (r25026) to get up-to-date on old branch.

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippScripts/scripts/detrend_norm_apply.pl

    r23688 r25027  
    6262    defined $outroot;
    6363
     64# force det_type to be upper-case in this script
     65$det_type = uc($det_type);
     66
    6467my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    6568
     
    7275# Define which detrend types we normalise
    7376use constant DETTYPE => {
    74     'bias'             => 'bias',
    75     'dark'             => 'dark',
    76     'dark_premask'     => 'dark',
    77     'shutter'          => 'shutter',
    78     'flat_premask'     => 'flat',
    79     'domeflat_premask' => 'flat',
    80     'skyflat_premask'  => 'flat',
    81     'flat_raw'         => 'flat',
    82     'domeflat_raw'     => 'flat',
    83     'skyflat_raw'      => 'flat',
    84     'flat'             => 'flat',
    85     'domeflat'         => 'flat',
    86     'skyflat'          => 'flat',
    87     'fringe'           => 'fringe',
    88     'mask'             => 'mask',
    89     'darkmask'         => 'mask',
    90     'flatmask'         => 'mask',
    91     'ctemask'          => 'mask',
     77    'BIAS'             => 'BIAS',
     78    'DARK'             => 'DARK',
     79    'DARK_PREMASK'     => 'DARK',
     80    'SHUTTER'          => 'SHUTTER',
     81    'FLAT_PREMASK'     => 'FLAT',
     82    'DOMEFLAT_PREMASK' => 'FLAT',
     83    'SKYFLAT_PREMASK'  => 'FLAT',
     84    'FLAT_RAW'         => 'FLAT',
     85    'DOMEFLAT_RAW'     => 'FLAT',
     86    'SKYFLAT_RAW'      => 'FLAT',
     87    'FLAT'             => 'FLAT',
     88    'DOMEFLAT'         => 'FLAT',
     89    'SKYFLAT'          => 'FLAT',
     90    'FRINGE'           => 'FRINGE',
     91    'MASK'             => 'MASK',
     92    'DARKMASK'         => 'MASK',
     93    'FLATMASK'         => 'MASK',
     94    'CTEMASK'          => 'MASK',
     95    'DARKTEST'         => 'DARK',
    9296    };
    9397
    9498# convert supplied detrend type to a controlled namespace
    95 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR) unless exists DETTYPE()->{lc($det_type)};
    96 my $det_type_real = DETTYPE()->{lc($det_type)};
     99&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR) unless exists DETTYPE()->{$det_type};
     100my $det_type_real = DETTYPE()->{$det_type};
    97101
    98102&my_die("Couldn't find input file: $input_uri\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri);
     
    106110$ipprc->outroot_prepare($outroot);
    107111
    108 my $outFile = ($det_type_real eq "mask") ? 'PPIMAGE.OUTPUT.DETMASK' : 'PPIMAGE.OUTPUT';; # XXXX something of a hack (too many places to control things...)
    109 
    110 my $RECIPE_PPSTATS = ($det_type_real eq "dark") ? 'DARKSTATS' : 'DETSTATS';; # XXXX something of a hack (too many places to control things...)
     112my $outFile = ($det_type_real eq "MASK") ? 'PPIMAGE.OUTPUT.DETMASK' : 'PPIMAGE.OUTPUT';; # XXXX something of a hack (too many places to control things...)
     113
     114my $RECIPE_PPSTATS = ($det_type_real eq "DARK") ? 'DARKSTATS' : 'DETSTATS';; # XXXX something of a hack (too many places to control things...)
    111115
    112116my $output    = $ipprc->filename($outFile,        $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     
    122126
    123127    # we cannot use ppImage to load a normalized mask : just copy it and build the jpeg images
    124     if ($det_type_real eq 'mask') {
     128    if ($det_type_real eq 'MASK') {
    125129        $RECIPE_PPIMAGE = 'PPIMAGE_BIN';
    126130        my $input_real = $ipprc->file_resolve($input_uri, 0);
     
    134138    $command .= " -recipe PPSTATS $RECIPE_PPSTATS";
    135139    $command .= " -F PPIMAGE.OUTPUT $outFile" unless $outFile eq 'PPIMAGE.OUTPUT';
    136     $command .= ' -isfringe' if $det_type_real eq 'fringe';
    137     $command .= ' -isdark' if $det_type_real eq 'dark';
     140    $command .= ' -isfringe' if $det_type_real eq 'FRINGE';
     141    $command .= ' -isdark' if $det_type_real eq 'DARK';
    138142    $command .= " -tracedest $traceDest -log $logDest";
    139143    $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.