IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 10, 2013, 12:08:57 PM (13 years ago)
Author:
bills
Message:

add chipRun.update_mode. If set do not use the config dump
file when regenerating images using update

File:
1 edited

Legend:

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

    r35770 r35789  
    4545# Parse the command-line arguments
    4646my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose,
    47      $no_update, $save_temps, $no_op, $redirect, $magicked, $deburned );
     47     $no_update, $save_temps, $no_op, $redirect, $magicked, $deburned, $update_mode );
    4848
    4949GetOptions(
     
    5858    'reduction=s'       => \$reduction, # Reduction class
    5959    'run-state=s'       => \$run_state, # current state of the run (new, update)
     60    'update-mode=s'     => \$update_mode, # update_mode if non-zero do not use configdump
    6061    'magicked=s'        => \$magicked,  # magicked state of input file
    6162    'deburned=s'        => \$deburned,  # does deburned image exist?
     
    147148my $outputBin2;
    148149my $dump_config = 1;
    149 my $do_stats = 1;
     150
     151# Note: We currently always do_stats because we need the quality flags
     152# If run_state eq 'update' using the same file name wipes out the stats from the original processing which
     153# is arguably a bug.  Since they are already in the database in that case this probably isn't a big
     154# deal
     155my $do_stats = 1;   
    150156$outputStats   = prepare_output("PPIMAGE.STATS",         $outroot, $class_id, 1);
     157
    151158my $do_binned_images = 1;
    152159
     
    155162    $configuration = prepare_output("PPIMAGE.CONFIG",        $outroot, $class_id, 1);
    156163} else {
    157     $configuration = $ipprc->filename('PPIMAGE.CONFIG', $outroot, $class_id)
     164    # If update_mode is non-zero we are going to update with current recipes.
     165    # In this case dump the new configuration.
     166    if ($update_mode) {
     167        $configuration = prepare_output("PPIMAGE.CONFIG",        $outroot, $class_id, 1);
     168    } else {
     169        $configuration = $ipprc->filename('PPIMAGE.CONFIG', $outroot, $class_id)
    158170            or &my_die("Missing entry from camera config: PPIMAGE.CONFIG", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    159     if ($ipprc->file_exists($configuration)) {
    160         $dump_config = 0;
    161     } else {
    162         print STDERR "WARNING: Config dump file $configuration is missing. Using current recipes and file rules.\n";
    163 
    164         # XXX: should we create a new config dump file?
    165         # I vote yes but only if we can distingusing between temporarily unavailable and GONE.
    166         my $gone = 0;
    167         if (storage_object_exists($configuration, \$gone)) {
    168             if ($gone) {
    169                 $configuration = prepare_output('PPIMAGE.CONFIG', $outroot, $class_id, 1);
    170                 # if we dump the config we need to insure that the config dump represents
    171                 # the full processing
    172             } else {
    173                 # file is temporarily not available. Don't dump config.
    174                 $dump_config = 0;
     171        if ($ipprc->file_exists($configuration)) {
     172            $dump_config = 0;
     173        } else {
     174            print STDERR "WARNING: Config dump file $configuration is missing. Using current recipes and file rules.\n";
     175
     176            # XXX: should we create a new config dump file?
     177            # I vote yes but only if we can distingusing between temporarily unavailable and GONE.
     178            my $gone = 0;
     179            if (storage_object_exists($configuration, \$gone)) {
     180                if ($gone) {
     181                    $configuration = prepare_output('PPIMAGE.CONFIG', $outroot, $class_id, 1);
     182                    # if we dump the config we need to insure that the config dump represents
     183                    # the full processing
     184                } else {
     185                    # file is temporarily not available. Don't dump config.
     186                    $dump_config = 0;
     187                }
    175188            }
    176189        }
     
    185198        or &my_die("failed to delete existing destreak backup weight file", $exp_id, $chip_id, $class_id, $PS_EXIT_UNKNOWN_ERROR);
    186199
    187     # don't do binned images when updating unless we are starting from scratch.
    188     $do_binned_images = 0 unless $dump_config;
     200    # don't do binned images when updating
     201    $do_binned_images = 0;
    189202}
    190203if ($do_binned_images) {
     
    219232    my $do_photom = metadataLookupBool($recipeData, 'PHOTOM');
    220233    if ($do_photom and ($run_state eq 'update')) {
    221         # If previous photometry outputs are ok skip running photometry
     234        # If previous psf file is ok skip photometry
    222235        if ($dump_config || rerun_photometry($outroot, $class_id)) {
    223236            carp "Will rerun photometry\n";
     
    562575    $command .= " -class_id $class_id";
    563576    $command .= " -dbname $dbname" if defined $dbname;
     577    # XXX: if we had a quality problem on this re-run we are not saving that fact in the DB...
     578    # to change this we need to modify chiptool -tofullimfile to supprot -set_quality and then add
     579    #$command .= " -set_quality $quality" if $quality;
    564580}
    565581
     
    600616
    601617    my $update_sources_if_gone = 0; # set this to regenerate sources if gone.
    602                                     # We no longer do this as of 2012-12
     618                                    # We no longer do this as of 2012-12 since cleanup deletes them
    603619    my $make_sources = 0;
    604620    my $sources_available = 0;
     
    635651        if (storage_object_exists($outputPsf, \$gone)) {
    636652            # object exists, but no instances are available. If they are permanently gone
    637             # rename the storage object
     653            # remake it
    638654            if ($gone) {
    639655                carp "WARNING: PSF storage object exists but all instances are permanently gone";
     
    641657            }
    642658        } else {
     659            # object completely missing remake it
    643660            $make_psf = 1;
    644661        }
Note: See TracChangeset for help on using the changeset viewer.