IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34265


Ignore:
Timestamp:
Jul 31, 2012, 4:55:25 PM (14 years ago)
Author:
heather
Message:

skycal stage for addstar

Location:
trunk
Files:
6 added
7 edited

Legend:

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

    r34080 r34265  
    9494# Recipes to use based on reduction class
    9595$reduction = 'DEFAULT' unless defined $reduction;
     96if ($stage =~/skycal/) {
     97    $reduction = 'DEFAULT';
     98}
    9699my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR');
    97100# XXX This is now not used: do we still need it?
     
    105108#  $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR_STATICSKY'); # Recipe to use
    106109#}
     110if ($stage =~/skycal/) {
     111    $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use                                                             
     112}
     113
     114
     115
    107116&my_die("Unrecognised ADDSTAR recipe", $add_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar;
    108117
     
    118127my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT", $stageroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
    119128my $fpaObjectsAlt = $fpaObjects;
     129
     130if ($stage =~ /skycal/) {
     131    #should be ok for skycal?
     132    print "using $fpaObjects for $stage\n";
     133}
    120134
    121135
     
    162176    }
    163177}
    164 if (($stage =~/stack/)) {
     178
     179if (($stage =~/stack/ || $stage =~ /skycal/)) {
    165180    $fpaObjects =~ s/smf$/cmf/;
    166181    $fpaObjectsAlt =~ s/smf$/cmf/;
    167182
    168183}
     184
    169185my $fpaObjects1;
    170186my $fpaObjects2;
  • trunk/ippTasks/addstar.pro

    r33989 r34265  
    2424  end
    2525  task addstar.exp.load.staticsky
     26    active true 
     27  end
     28  task addstar.exp.load.skycal
    2629    active true
    2730  end
     
    4144    active false
    4245  end
     46  task addstar.exp.load.skycal
     47    active false
     48  end
    4349  task addstar.exp.run
    4450    active false
     
    5056    active false
    5157  end
    52  task addstar.revert.stack
    53     active false
    54   end
    55  task addstar.revert.staticsky
    56     active false
    57   end
    58 end
     58  task addstar.revert.stack
     59    active false
     60  end
     61  task addstar.revert.staticsky
     62    active false
     63  end
     64  task addstar.revert.skycal
     65    active false
     66  end
     67end
     68
    5969macro addstar.revert.on
    6070  task addstar.revert.cam
     
    6575  end
    6676  task addstar.revert.staticsky
     77    active true
     78  end
     79  task addstar.revert.skycal
    6780    active true
    6881  end
     
    7790$addstar_revert_DB_SS = 0
    7891$addstar_revert_DB_SSM = 0
     92$addstar_revert_DB_SC = 0
    7993
    8094$LOADEXEX_ADD = 300
     
    244258
    245259  # operation times out?
     260  task.exit    timeout
     261    showcommand timeout
     262  end
     263end
     264
     265task           addstar.exp.load.skycal
     266  host         local
     267  periods      -poll $LOADPOLL
     268  periods      -exec 300
     269  periods      -timeout 300
     270  npending     1
     271
     272  stdout NULL
     273  stderr $LOGDIR/addstar.exp.log
     274
     275  task.exec
     276   # if ($LABEL:n == 0) break                                                                                 
     277    $run = addtool -pendingexp -stage skycal
     278    if ($DB:n == 0)
     279      option DEFAULT
     280    else
     281      # save the DB name for the exit tasks                                                                   
     282      option $DB:$addstar_DB
     283      $run = $run -dbname $DB:$addstar_DB
     284      $addstar_DB ++
     285      if ($addstar_DB >= $DB:n) set addstar_DB = 0
     286    end
     287    add_poll_args run
     288    add_poll_labels run
     289    command $run
     290  end
     291
     292  # success                                                                                                   
     293  task.exit    0
     294    # convert 'stdout' to book format                                                                         
     295    ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     296    if ($VERBOSE > 2)
     297      book listbook addPendingExp
     298    end
     299
     300    # delete existing entries in the appropriate pantaskStates                                               
     301    process_cleanup addPendingExp
     302  end
     303
     304  # default exit status                                                                                       
     305  task.exit    default
     306    showcommand failure
     307  end
     308
     309  task.exit    crash
     310    showcommand crash
     311  end
     312
     313  # operation times out?                                                                                     
    246314  task.exit    timeout
    247315    showcommand timeout
     
    311379        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
    312380    end
     381    if ("$STAGE" == "skycal")
     382        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
     383    end
     384
    313385 
    314386
     
    326398      $run = $run --stage_id $STAGE_ID
    327399    end
     400   if ("$STAGE" == "skycal")
     401      $run = $run --stage_id $STAGE_ID
     402    end
     403
     404
     405
    328406    if ("$IMAGE_ONLY" == "T")
    329407      $run = $run --image-only
     
    508586  end
    509587end
     588
     589task addstar.revert.skycal
     590  host         local
     591
     592  periods      -poll 5.0
     593  periods      -exec 60.0
     594  periods      -timeout 1200
     595  npending     1
     596  active        false
     597
     598  stdout NULL
     599  stderr $LOGDIR/revert.log
     600
     601  task.exec
     602    if ($LABEL:n == 0) break
     603    $run = addtool -revertprocessedexp -stage skycal
     604    if ($DB:n == 0)
     605      option DEFAULT
     606    else
     607      # save the DB name for the exit tasks                                                                   
     608      option $DB:$addstar_revert_DB_SC
     609      $run = $run -dbname $DB:$addstar_revert_DB_SC
     610      $addstar_revert_DB_SC ++
     611      if ($addstar_revert_DB_SC >= $DB:n) set addstar_revert_DB_SC = 0
     612    end
     613     add_poll_labels run
     614    command $run
     615  end
     616
     617  # success                                                                                                   
     618  task.exit    0
     619  end
     620
     621  # locked list                                                                                               
     622  task.exit    default
     623    showcommand failure
     624  end
     625
     626  task.exit    crash
     627    showcommand crash
     628  end
     629
     630  # operation times out?                                                                                     
     631  task.exit    timeout
     632    showcommand timeout
     633  end
     634end
  • trunk/ippTasks/survey.pro

    r33525 r34265  
    862862        #only queue uncensored stacks
    863863        $run = $run -uncensored
     864    end
     865    if ("$stage" == "skycal")
     866        #skycal doesn't have magic, however, we still need to tell addtool
     867        $run = $run -uncensored
    864868    end
    865869
  • trunk/ippTools/share/Makefile.am

    r33744 r34265  
    88        addtool_find_cam_id_dvo.sql \
    99        addtool_find_cam_id.sql \
     10        addtool_find_skycal_id_dvo.sql \
     11        addtool_find_skycal_id.sql \
    1012        addtool_find_sky_id_multi_dvo.sql \
    1113        addtool_find_sky_id_multi.sql \
     
    1416        addtool_find_pendingexp.sql \
    1517        addtool_find_pendingexp_cam.sql \
     18        addtool_find_pendingexp_skycal.sql \
    1619        addtool_find_pendingexp_stack.sql \
    1720        addtool_find_pendingexp_staticsky_multi.sql \
    1821        addtool_find_pendingmergeprocess.sql \
    1922        addtool_find_processedexp_cam.sql \
     23        addtool_find_processedexp_skycal.sql \
    2024        addtool_find_processedexp_stack.sql \
    2125        addtool_find_processedexp_staticsky_multi.sql \
     
    2731        addtool_queue_stack_id.sql \
    2832        addtool_queue_sky_id_multi.sql \
     33        addtool_queue_skycal_id.sql \
    2934        addtool_queue_minidvodbrun.sql \
    3035        addtool_revertminidvodbprocessed.sql \
    3136        addtool_revertprocessedexp_cam.sql \
     37        addtool_revertprocessedexp_skycal.sql \
    3238        addtool_revertprocessedexp_stack.sql \
    3339        addtool_revertprocessedexp_staticsky.sql \
  • trunk/ippTools/src/addtool.c

    r34081 r34265  
    120120    PXOPT_COPY_S64(config->args, where,  "-cam_id",    "camRun.cam_id", "==");
    121121    PXOPT_COPY_S64(config->args, where,  "-stack_id",    "stackRun.stack_id", "==");
    122  PXOPT_COPY_S64(config->args, where,  "-sky_id",    "staticskyRun.sky_id", "==");
     122    PXOPT_COPY_S64(config->args, where,  "-sky_id",    "staticskyRun.sky_id", "==");
     123    PXOPT_COPY_S64(config->args, where,  "-skycal_id",  "skycalRun.skycal_id", "==");
    123124    PXOPT_LOOKUP_STR(stage,       config->args, "-stage", false, false);
    124125    if (strcmp(stage, "cam")== 0) {
    125126      pxcamGetSearchArgs (config, where);
    126     pxAddLabelSearchArgs (config, where, "-label",     "camRun.label", "=="); // define using camRun label
    127     pxAddLabelSearchArgs (config, where, "-data_group","camRun.data_group", "=="); // define using camRun label
    128 
    129     PXOPT_COPY_STR(config->args, where,  "-reduction", "camRun.reduction", "==");
     127      pxAddLabelSearchArgs (config, where, "-label",     "camRun.label", "=="); // define using camRun label
     128      pxAddLabelSearchArgs (config, where, "-data_group","camRun.data_group", "=="); // define using camRun label
     129      PXOPT_COPY_STR(config->args, where,  "-reduction", "camRun.reduction", "==");
    130130    }
    131131    if (strcmp(stage, "stack")== 0) {
    132 
    133     pxAddLabelSearchArgs (config, where, "-label",     "stackRun.label", "=="); // define using camRun label
    134     pxAddLabelSearchArgs (config, where, "-data_group","stackRun.data_group", "=="); // define using camRun label
    135     PXOPT_COPY_STR(config->args, where,  "-reduction", "stackRun.reduction", "==");
    136     pxAddLabelSearchArgs (config, where, "-filter",     "stackRun.filter", "=="); // define using camRun label
     132      pxAddLabelSearchArgs (config, where, "-label",     "stackRun.label", "=="); // define using camRun label
     133      pxAddLabelSearchArgs (config, where, "-data_group","stackRun.data_group", "=="); // define using camRun label
     134      PXOPT_COPY_STR(config->args, where,  "-reduction", "stackRun.reduction", "==");
     135      pxAddLabelSearchArgs (config, where, "-filter",     "stackRun.filter", "=="); // define using camRun label
    137136    }
    138137    if (strcmp(stage, "staticsky")== 0) {
    139 
    140     pxAddLabelSearchArgs (config, where, "-label",     "staticskyRun.label", "=="); // define using camRun label
    141     pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label
    142     PXOPT_COPY_STR(config->args, where,  "-reduction", "staticskyyRun.reduction", "==");
     138      pxAddLabelSearchArgs (config, where, "-label",     "staticskyRun.label", "=="); // define using camRun label
     139      pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label
     140      PXOPT_COPY_STR(config->args, where,  "-reduction", "staticskyRun.reduction", "==");
    143141    //no filter here
    144142    }
     143    if (strcmp(stage, "skycal")==0) {
     144      pxAddLabelSearchArgs (config, where, "-label",     "skycalRun.label", "=="); //define using skycalRun label
     145      pxAddLabelSearchArgs (config, where, "-data_group","skycalRun.data_group", "==");
     146      PXOPT_COPY_STR(config->args, where,  "-reduction", "skycalRun.reduction",  "==");
     147    }
     148
    145149    if (!psListLength(where->list)) {
    146150        psFree(where);
     
    228232        // user supplied dvodb
    229233        psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb);
    230     } else {
    231       psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_sky_id_multi.sql\n%s\n",stage);
     234      } else {
     235        psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_sky_id_multi.sql\n%s\n",stage);
    232236        // find the cam_id of all the exposures that we want to queue up.
    233237        bare_query = pxDataGet("addtool_find_sky_id_multi.sql");
    234238        // inherit dvodb from camRun, avoid matching NULL
    235239        psStringAppend(&dvodb_string, "(staticskyRun.dvodb IS NOT NULL AND previous_dvodb = staticskyRun.dvodb)");
    236     }
    237     }
     240      }
     241    }
     242   
     243    if (strcmp(stage,"skycal") == 0) {
     244      if (dvodb ) {
     245        psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_skycal_id_dvo.sql\n%s\n", dvodb,stage);
     246        // find the skycal_id of all the exposures that we want to queue up.                                                                                                   
     247        bare_query = pxDataGet("addtool_find_skycal_id_dvo.sql");
     248        // user supplied dvodb                                                                                                                                             
     249        psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb);
     250      } else {
     251        psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_skycal_id.sql\n%s\n",stage);
     252        // find the skycal_id of all the exposures that we want to queue up.                                                                                                   
     253        bare_query = pxDataGet("addtool_find_skycal_id.sql");
     254        // inherit dvodb from skycalRun, avoid matching NULL                                                                                                                   
     255        psStringAppend(&dvodb_string, "(skycalRun.dvodb IS NOT NULL AND previous_dvodb = skycalRun.dvodb)");
     256        // this is silly, there is no dvodb in skycalRun...?
     257      }
     258    }
     259
     260
     261
     262
     263
     264
    238265
    239266    if (!bare_query) {
     
    267294        psStringAppend(&query, " AND (stackRun.magicked > 0)");
    268295      }
    269       // staticSky has no magicked column.
     296      // staticSky/skycal have no magicked column.
    270297    } else {
    271298      //This picks only the unmagicked/uncensored ones
     
    291318      //   psStringAppend(&query, " GROUP BY stack_id");
    292319      // }
    293     if (strcmp(stage,"staticsky") == 0) {
    294       psStringAppend(&query, " GROUP BY sky_id, stack_id");  //some reason it needs this
    295       }
    296 
     320      if (strcmp(stage,"staticsky") == 0) {
     321        psStringAppend(&query, " GROUP BY sky_id, stack_id");  //some reason it needs this
     322      }
     323      if (strcmp(stage,"skycal") == 0) {
     324        psStringAppend(&query, " GROUP BY skycal_id, sky_id, stack_id ");  //this needs checking, but I think it shoul be fine? it groups by lots of stuff (including stack - we only want one of each stack in there
     325      }
    297326
    298327    psTrace("addtool.c", PS_LOG_INFO,"query: \n\n%s\n\n",query);
     
    381410    }
    382411   
     412
     413
    383414    if (strcmp(stage,"staticsky") == 0) {
    384415    for (long i = 0; i < psArrayLength(output); i++) {
     
    418449    }
    419450
     451    if (strcmp(stage,"skycal") == 0) {
     452      for (long i = 0; i < psArrayLength(output); i++) {
     453        psMetadata *md = output->data[i];
     454
     455        skycalRunRow *row = skycalRunObjectFromMetadata(md);
     456
     457        if (!row) {
     458          psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into skycalRun");
     459          psFree(output);
     460          return false;
     461        }
     462
     463        if (!dvodb) {  // there's no skycalRun.dvodb
     464          psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, skycal_id %" PRId64, row->label, row->skycal_id);
     465          psFree(output);
     466          return false;
     467        }
     468        if (!workdir && !row->workdir) {
     469          psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, skycal_id %" PRId64, row->label, row->skycal_id);
     470          psFree(output);
     471          return false;
     472        }
     473
     474        psFree(row);
     475      }
     476    }
    420477
    421478
     
    572629      }
    573630
    574 
     631    if (strcmp(stage,"skycal") == 0) {
     632    for (long i = 0; i < psArrayLength(output); i++) {
     633        psMetadata *md = output->data[i];
     634        psS64 stage_id =0;
     635       
     636                  skycalRunRow *row = skycalRunObjectFromMetadata(md);
     637          stage_id = row->skycal_id;
     638       
     639        if (!row) {
     640            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into skycalRun");
     641            psFree(output);
     642            return false;
     643        }
     644
     645        // queue the exp
     646        if (!pxaddQueueByCamID(config,
     647                               stage,
     648                               stage_id,
     649                               0,
     650                               workdir     ? workdir   : row->workdir,
     651                               reduction   ? reduction : row->reduction,
     652                               label       ? label     : row->label,
     653                               data_group  ? data_group : (row->data_group ? row->data_group :  (label ? label : row->label)),
     654                               dvodb       ? dvodb     : NULL,
     655                               note        ? note      : NULL,
     656                               image_only,
     657                               minidvodb,
     658                               minidvodb_group,
     659                               minidvodb_name
     660        )) {
     661            if (!psDBRollback(config->dbh)) {
     662                psError(PS_ERR_UNKNOWN, false, "database error sfg");
     663            }
     664            psError(PS_ERR_UNKNOWN, false,
     665                    "failed to trying to queue stage %s %" PRId64,stage, stage_id);
     666            psFree(row);
     667            psFree(output);
     668            return false;
     669        }
     670        psFree(row);
     671    }
     672      }
     673   
    575674
    576675
     
    594693    PXOPT_COPY_S64(config->args, where, "-cam_id",    "camRun.cam_id", "==");
    595694    PXOPT_COPY_S64(config->args, where, "-stack_id",    "stackRun.stack_id", "==");
    596    PXOPT_COPY_S64(config->args, where, "-sky_id",    "staticskyRun.sky_id", "==");
    597    
     695    PXOPT_COPY_S64(config->args, where, "-sky_id",    "staticskyRun.sky_id", "==");
     696    PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycalRun.skycal_id", "==");
    598697    PXOPT_LOOKUP_STR(stage,       config->args, "-stage", false, false);
    599698    pxcamGetSearchArgs (config, where); // most search arguments based on camera
     
    610709    psString query = NULL;
    611710    if (strcmp(stage, "cam")==0) {
    612     query = psStringCopy("UPDATE addRun JOIN camRun on cam_id = stage_id JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");
     711      query = psStringCopy("UPDATE addRun JOIN camRun on cam_id = stage_id JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");
    613712    }
    614713    if (strcmp(stage, "stack")==0) {
    615     query = psStringCopy("UPDATE addRun JOIN stackRun on stack_id = stage_id");
     714      query = psStringCopy("UPDATE addRun JOIN stackRun on stack_id = stage_id");
    616715    }
    617716    if (strcmp(stage, "staticsky")==0) {
    618     query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id");
    619     }
    620    
     717      query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id");
     718    }
     719    if (strcmp(stage, "skycal")==0) {
     720      query = psStringCopy("UPDATE addRun JOIN skycalRun on skycal_id = stage_id");
     721    }
     722
    621723
    622724    // pxUpdateRun gets parameters from config->args and runs the update query
     
    640742    PXOPT_COPY_S64(config->args, where, "-stack_id",    "stackRun.stack_id", "==");
    641743    PXOPT_COPY_S64(config->args, where, "-sky_id",    "staticskyRun.sky_id", "==");
     744    PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycalRun.skycal_id", "==");
    642745    PXOPT_LOOKUP_STR(stage,       config->args, "-stage", false, false);
    643746    pxcamGetSearchArgs (config, where);
     
    650753   
    651754    if (strcmp(stage, "cam")==0) {
    652     query = pxDataGet("addtool_find_pendingexp_cam.sql");
     755      query = pxDataGet("addtool_find_pendingexp_cam.sql");
    653756    }
    654757    if (strcmp(stage, "stack")==0) {
    655     query = pxDataGet("addtool_find_pendingexp_stack.sql");
     758      query = pxDataGet("addtool_find_pendingexp_stack.sql");
    656759    }
    657760    if (strcmp(stage, "staticsky")==0) {
    658     query = pxDataGet("addtool_find_pendingexp_staticsky_multi.sql");
    659     }
    660    
     761      query = pxDataGet("addtool_find_pendingexp_staticsky_multi.sql");
     762    }
     763    if (strcmp(stage, "skycal")==0) {
     764      query = pxDataGet("addtool_find_pendingexp_skycal.sql");
     765    }
     766
    661767
    662768    if (!query) {
     
    676782      psStringAppend(&query, " GROUP BY %s", "stack_id");
    677783    }
    678     //if (strcmp(stage, "staticsky") == 0) {
    679     //  //this group by is needed to join against all the warps (to get camera)
    680     //  psStringAppend(&query, " GROUP BY %s", "sky_id");
    681     //}
     784    if (strcmp(stage, "skycal") == 0) {
     785      //this group by is needed to join against all the warps (to get camera)
     786      psStringAppend(&query, " GROUP BY %s", "skycal_id");
     787    }
    682788    if (strcmp(stage, "staticsky") == 0) {
    683789      //this group by is needed to join against all the warps (to get camera)
     
    881987
    882988    if (strcmp (stage,"cam") == 0) {
    883     query = pxDataGet("addtool_find_processedexp_cam.sql");
     989      query = pxDataGet("addtool_find_processedexp_cam.sql");
    884990    }
    885991    if (strcmp (stage,"stack") == 0) {
    886     query = pxDataGet("addtool_find_processedexp_stack.sql");
     992      query = pxDataGet("addtool_find_processedexp_stack.sql");
    887993    }
    888994    if (strcmp (stage,"staticsky") == 0) {
    889     query = pxDataGet("addtool_find_processedexp_staticsky_multi.sql");
     995      query = pxDataGet("addtool_find_processedexp_staticsky_multi.sql");
     996    }
     997    if (strcmp (stage,"skycal") == 0) {
     998      query = pxDataGet("addtool_find_processedexp_skycal.sql");
    890999    }
    8911000
     
    10001109         query = pxDataGet("addtool_revertprocessedexp_staticsky_multi.sql");
    10011110      }
     1111    if (strcmp(stage, "skycal") == 0) {
     1112      query = pxDataGet("addtool_revertprocessedexp_skycal.sql");
     1113    }
    10021114
    10031115
  • trunk/ippTools/src/addtoolConfig.c

    r33030 r34265  
    5353    psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-stack_id",             0, "search by stack_id", 0);
    5454    psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-sky_id",             0, "search by sky_id", 0);
     55    psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-skycal_id",          0, "search by skycal_id", 0);
    5556    pxcamSetSearchArgs(definebyqueryArgs);
    5657    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by camRun label", NULL);
     
    8182    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-stack_id",                 0, "search by stack_id", 0);
    8283    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-sky_id",                 0, "search by sky_id", 0);
     84    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-skycal_id",                 0, "search by skycal_id", 0);
    8385    pxcamSetSearchArgs(updaterunArgs);
    8486    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label",                  0, "search by addRun label", NULL);
     
    101103    psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-stack_id",                 0, "search by stack_id", 0);
    102104    psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-sky_id",                 0, "search by sky_id", 0);
     105    psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-skycal_id",                 0, "search by skycal_id", 0);
    103106    pxcamSetSearchArgs(pendingexpArgs);
    104107    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by addRun label", NULL);
  • trunk/ippTools/src/pxadd.c

    r33525 r34265  
    151151        query = pxDataGet("addtool_queue_cam_id.sql");
    152152        psMemSetPersistent(query, true);
     153      }
     154      else if (strcmp(stage,"stack") == 0) {
     155        query = pxDataGet("addtool_queue_stack_id.sql");
     156        psMemSetPersistent(query, true);
    153157      }
    154       if (strcmp(stage,"stack") == 0) {
    155         query = pxDataGet("addtool_queue_stack_id.sql");
     158      else if (strcmp(stage,"staticsky") == 0) {
     159        query = pxDataGet("addtool_queue_sky_id_multi.sql");
     160        psMemSetPersistent(query, true);
     161      }
     162      else if (strcmp(stage,"skycal") == 0) {
     163        query = pxDataGet("addtool_queue_skycal_id.sql");
    156164        psMemSetPersistent(query, true);
    157165      }
    158       if (strcmp(stage,"staticsky") == 0) {
    159         query = pxDataGet("addtool_queue_sky_id_multi.sql");
    160         psMemSetPersistent(query, true);
     166      else
     167        {
     168          psError(PXTOOLS_ERR_SYS, false, "uknown stage %s for pxadd.c", stage);
     169          return false;
     170        }
     171
     172      if (!query) {
     173        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     174        return false;
    161175      }
    162         if (!query) {
    163             psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    164             return false;
    165         }
    166176    }
    167177
Note: See TracChangeset for help on using the changeset viewer.