IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35789


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

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/chip.md

    r29902 r35789  
    2020    maskfrac_magic  F32     0.0
    2121    maskfrac_advisory F32   0.0
     22    update_mode S16         0 
    2223    note        STR         255
    2324END
  • 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        }
  • trunk/ippTasks/chip.pro

    r27926 r35789  
    154154    book getword chipPendingImfile $pageName state -var RUN_STATE
    155155    book getword chipPendingImfile $pageName path_base -var PATH_BASE
     156    book getword chipPendingImfile $pageName update_mode -var UPDATE_MODE
    156157
    157158    if ($RAW_MAGICKED > 0)
     
    189190      $run = $run --reduction $REDUCTION
    190191    end
     192    if ($UPDATE_MODE)
     193        $run = $run --update-mode $UPDATE_MODE
     194    end
     195
    191196    add_standard_args run
    192197
  • trunk/ippTools/share/chiptool_change_exp_state.sql

    r33245 r35789  
    55UPDATE chipRun
    66JOIN rawExp using(exp_id)
    7     SET chipRun.state = '%s'
     7    SET chipRun.state = '%s', chipRun.update_mode = 0
    88    -- set magicked hook %s
    99    WHERE
  • trunk/ippTools/share/chiptool_completely_processed_exp.sql

    r26567 r35789  
    1515    end_stage,
    1616    imfile_magicked as magicked,
     17    0 as update_mode,
    1718    note
    1819FROM
  • trunk/ippTools/share/pxadmin_create_tables.sql

    r35770 r35789  
    1 eREATE TABLE dbversion (
     1CREATE TABLE dbversion (
    22    schema_version VARCHAR(64),
    33    updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP
     
    299299    maskfrac_magic FLOAT,
    300300    maskfrac_advisory FLOAT,
     301    update_mode SMALLINT DEFAULT 0,
    301302    note VARCHAR(255),
    302303    PRIMARY KEY(chip_id),
  • trunk/ippTools/share/pxadmin_drop_tables.sql

    r35227 r35789  
    115115DROP TABLE IF EXISTS survey;
    116116DROP TABLE IF EXISTS lapGroup;
     117DROP TABLE IF EXISTS mergedvodbCopy;
     118DROP TABLE IF EXISTS mergedvodbProcessed;
     119DROP TABLE IF EXISTS mergedvodbRun;
    117120
    118121SET FOREIGN_KEY_CHECKS=1
  • trunk/ippTools/src/chiptool.c

    r35691 r35789  
    20182018    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", false, false);
    20192019    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
     2020    PXOPT_LOOKUP_S16(update_mode, config->args, "-set_update_mode", false, false);
    20202021
    20212022    psString query = pxDataGet("chiptool_setimfiletoupdate.sql");
     
    20292030        psStringAppend(&setHook, "\n , chipRun.label = '%s'", label);
    20302031    }
     2032    // always set update_mode. If user has not supplied it zero is the right answer.
     2033    psStringAppend(&setHook, "\n, chipRun.update_mode = %d", update_mode);
    20312034
    20322035    if (class_id) {
  • trunk/ippTools/src/chiptoolConfig.c

    r35573 r35789  
    5252
    5353    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_workdir",  0,            "define workdir (required)", NULL);
    54     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label",  0,            "define label (required)", NULL);
     54    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label",  0,            "define label", NULL);
    5555    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_reduction",  0,            "define reduction class", NULL);
    5656    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_expgroup",  0,            "define exposure group", NULL);
     
    107107    psMetadataAddStr(setimfiletoupdateArgs, PS_LIST_TAIL, "-class_id", 0,  "search by class_id", NULL);
    108108    psMetadataAddStr(setimfiletoupdateArgs, PS_LIST_TAIL, "-set_label",  0,"new value for label", NULL);
     109    psMetadataAddS16(setimfiletoupdateArgs, PS_LIST_TAIL, "-set_update_mode",  0,"new value for update_mode", 0);
    109110
    110111    // -pendingimfile
  • trunk/ippTools/src/pxchip.c

    r33334 r35789  
    283283                       NAN,
    284284                       NAN,
     285            0,         // update_mode
    285286            note
    286287            )
Note: See TracChangeset for help on using the changeset viewer.