IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 21, 2007, 2:10:11 PM (19 years ago)
Author:
Paul Price
Message:

Changes to multiple packages in order to use "reduction classes" to
specify recipe names. The idea is to give a group of recipes a
symbolic name, which distinguish how the reduction is to be performed,
without going to all the trouble of changing the recipes themselves.

For example, we might want to turn off the usual
overscan/bias/dark/shutter/flat processing and only do photometry if
we have pre-processed data. Gene also wants a similar ability for
building the flat-field correction.

Added a REDUCTION metadata to the camera configuration that contains
multiple METADATA entries that have recipes for different processing
steps. PS::IPP::Config has a 'reduction' function to return the
appropriate recipe, and this is now used in the scripts. Updated
ippTasks to use these where appropriate.

This necessitated changing the database, so that the desired reduction
class can be specified in the right places. Instructions on converting
an extant database are in dbconfig/changes.txt.

Tested with the SIMTEST, and it works.

There is currently no way of specifying the reduction class when an
exposure proceeds from 'register' to 'chip' (it has to be hacked in
the database directly: "update chipPendingExp set reduction =
'SOME_CLASS' where ..."), but it can be specified when adding a
detrend run or queuing chips with 'chiptool -queue' (the '-reduction'
option). Also, the 'recipe' columns remain throughout the detrend
tables, and they continue to be populated with the actual recipe used
(rather than the reduction class; but that is contained in the
detRun).

File:
1 edited

Legend:

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

    r13926 r13937  
    3434
    3535my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend,
    36         $input_uri, $camera, $mode, $dbname, $workdir, $no_update, $no_op);
     36        $input_uri, $camera, $mode, $dbname, $workdir, $reduction, $no_update, $no_op);
    3737GetOptions(
    3838    'det_id|d=s'        => \$det_id,
     
    4747    'dbname|d=s'        => \$dbname, # Database name
    4848    'workdir|w=s'       => \$workdir,   # Working directory, for output files
     49    'reduction=s'       => \$reduction, # Reduction class
    4950    'no-update'         => \$no_update,
    5051    'no-op'             => \$no_op,
     
    6768$ipprc->define_camera($camera);
    6869
    69 # Recipes to use, as a function of the detrend type
    70 use constant RECIPES => {
    71     'master' => {               # We're creating a master --- already processed the input
    72         'bias'     => 'PPIMAGE_B',      # Bias only
    73         'dark'     => 'PPIMAGE_D',      # Dark only
    74         'shutter'  => 'PPIMAGE_S',      # Shutter only
    75         'flat'     => 'PPIMAGE_F',      # Flat-field only
    76         'domeflat' => 'PPIMAGE_F',      # Flat-field only
    77         'skyflat'  => 'PPIMAGE_F',      # Flat-field only
    78         'fringe'   => 'PPIMAGE_R',      # Fringe only
    79     },
    80     'verify' => {               # We're checking the master --- input is not already processed
    81         'bias'     => 'PPIMAGE_OB',     # Bias only
    82         'dark'     => 'PPIMAGE_OBD',    # Dark only
    83         'shutter'  => 'PPIMAGE_OBDS',   # Shutter only
    84         'flat'     => 'PPIMAGE_OBDSF',  # Flat-field only
    85         'domeflat' => 'PPIMAGE_OBDSF',  # Flat-field only
    86         'skyflat'  => 'PPIMAGE_OBDSF',  # Flat-field only
    87         'fringe'   => 'PPIMAGE_OBDSFR', # Fringe only
    88     },
    89 };
     70$reduction = 'DETREND' unless defined $reduction;
     71my $recipe;                     # Name of recipe to use
     72if ($mode eq 'master') {
     73    $recipe = $det_type . '_RESID';
     74} elsif ($mode eq 'verify') {
     75    $recipe = $det_type . '_VERIFY';
     76} else {
     77    &my_die("Unrecognised mode: $mode", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
     78}
     79$recipe = $ipprc->reduction($reduction, $recipe);
    9080
    9181# Flags to specify the particular detrend to use
     
    113103$ppImage .= " -dbname $dbname" if defined $dbname;
    114104
    115 # Recipe to use in processing
    116 &my_die("Unrecognised mode: $mode", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR) unless defined RECIPES->{$mode};
    117 my $recipe = RECIPES->{$mode}->{lc($det_type)};
    118 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR) unless defined $recipe;
    119 
    120105$workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir;
    121106
     
    183168my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN');
    184169my $bin_stdev     = ($binnedStats->bg_stdev() or 'NAN');
    185 my $fringe_0      = (${$stats->fringe()[0]} or 'NAN');
    186 my $fringe_1      = (${$stats->fringe_err()[0]} or 'NAN');
     170my $fringe_0      = (${$stats->fringe()}[0] or 'NAN');
     171my $fringe_1      = (${$stats->fringe_err()}[0] or 'NAN');
    187172my $fringe_2      = 'NAN';
    188173
Note: See TracChangeset for help on using the changeset viewer.