IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 2, 2014, 3:27:44 PM (11 years ago)
Author:
heather
Message:

changes to addtool to do addstar diffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/addtool.c

    r37551 r37709  
    373373      //needs to be checked HAF xxx
    374374      if (strcmp(stage,"diff") == 0) {
    375         psStringAppend(&query, " GROUP BY diff_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
     375        psStringAppend(&query, " GROUP BY diff_id, diff_skyfile_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
    376376      }
    377377      //needs to be checked HAF xxx
    378378      if (strcmp(stage,"fullforce") == 0) {
    379         psStringAppend(&query, " GROUP BY ff_id, skycal_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
     379        psStringAppend(&query, " GROUP BY ff_id, warp_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
    380380      }
    381381
     
    535535
    536536    if (strcmp(stage,"diff") == 0) {
     537     
    537538      for (long i = 0; i < psArrayLength(output); i++) {
    538539        psMetadata *md = output->data[i];
    539540
    540541        diffRunRow *row = diffRunObjectFromMetadata(md);
    541 
     542       
    542543        if (!row) {
    543           psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into skycalRun");
     544          psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into diffRun");
    544545          psFree(output);
    545546          return false;
     
    568569
    569570        if (!row) {
    570           psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into skycalRun");
     571          psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into fullforceRun");
    571572          psFree(output);
    572573          return false;
     
    784785   
    785786    if (strcmp(stage,"diff") == 0) {
     787     
    786788    for (long i = 0; i < psArrayLength(output); i++) {
    787789        psMetadata *md = output->data[i];
    788790        psS64 stage_id =0;
    789        
    790                   diffRunRow *row = diffRunObjectFromMetadata(md);
    791           stage_id = row->diff_id;
     791        //      psS64 stage_extra1 = 0;
     792        diffRunRow *row = diffRunObjectFromMetadata(md);
     793        stage_id = row->diff_id;
     794        bool status = false;
     795        psS32 stage_extra1 = psMetadataLookupS32(&status, md, "diff_skyfile_id");
     796        if (!status) {
     797          psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item diff_skyfile_id");
     798          return false;
     799        }
     800
    792801       
    793802        if (!row) {
     
    796805            return false;
    797806        }
    798 
     807       
    799808        // queue the exp
    800809        if (!pxaddQueueByCamID(config,
    801810                               stage,
    802811                               stage_id,
    803                                0,
     812                               stage_extra1,
    804813                               workdir     ? workdir   : row->workdir,
    805814                               reduction   ? reduction : row->reduction,
     
    831840        psS64 stage_id =0;
    832841       
    833                   fullForceRunRow *row = fullForceRunObjectFromMetadata(md);
    834           stage_id = row->ff_id;
    835        
     842        fullForceRunRow *row = fullForceRunObjectFromMetadata(md);
     843        stage_id = row->ff_id;
     844        bool status = false;
     845        psS32 stage_extra1 = psMetadataLookupS32(&status, md, "warp_id");
     846        if (!status) {
     847          psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item warp_id");
     848          return false;
     849        }
     850
    836851        if (!row) {
    837852            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into skycalRun");
     
    844859                               stage,
    845860                               stage_id,
    846                                0,
     861                               stage_extra1,
    847862                               workdir     ? workdir   : row->workdir,
    848863                               reduction   ? reduction : row->reduction,
Note: See TracChangeset for help on using the changeset viewer.