IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 8, 2010, 7:21:36 PM (16 years ago)
Author:
watersc1
Message:

rtbt works in test case up through auto-chip-queue

Location:
branches/czw_branch/20101203/ippTools/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203/ippTools/src/chiptool.c

    r29902 r29982  
    271271
    272272    // default
     273    PXOPT_LOOKUP_BOOL(unique, config->args, "-unique", false);
    273274    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
    274275    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    275 
     276   
    276277    // find the exp_id of all the exposures that we want to queue up.
    277278    psString query = pxDataGet("chiptool_find_rawexp.sql");
     
    288289    psFree(where);
    289290
     291    if (unique) {
     292      psStringAppend(&query, "AND chip_id IS NULL");
     293    }
     294   
    290295    if (!p_psDBRunQuery(config->dbh, query)) {
    291296        psError(PS_ERR_UNKNOWN, false, "database error");
  • branches/czw_branch/20101203/ippTools/src/chiptoolConfig.c

    r29902 r29982  
    6161    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_dist_group",  0,      "define distribution group", NULL);
    6262    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_note",  0,           "define note", NULL);
     63    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-unique",   0,           "only queue exposures that have no previous chipRun", false);
    6364    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend",  0,            "do not actually modify the database", false);
    6465    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
  • branches/czw_branch/20101203/ippTools/src/pztool.c

    r27053 r29982  
    112112    PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false);
    113113    PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false);
    114 
     114   
    115115    if (!pzDataStoreInsert(config->dbh,
    116116            camera,
  • branches/czw_branch/20101203/ippTools/src/regtool.c

    r29965 r29982  
    331331
    332332  psString previous_uri = NULL;
     333  psString this_uri = NULL;
    333334  bool ok_to_burn = true;
    334335  bool already_burned = true;
     
    340341    psMetadata *row = output->data[i];
    341342
    342     // Use tmp_class_id because class_id may not be populated for all imfiles
     343    // Add the information about this row and the previous, if it exists.
     344    // Write the class_id stuff for debugging.
    343345    this_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    344346    psStringSubstitute(&this_class_id,"XY","ota");
    345     // Determine if we've crossed a class_id boundary.
     347    psMetadataAddStr(row,PS_LIST_TAIL,"this_class_id",PS_META_REPLACE,"",this_class_id);
     348    if (previous_class_id) {
     349      psMetadataAddStr(row,PS_LIST_TAIL,"previous_class_id",PS_META_REPLACE,"",previous_class_id);
     350    }
     351   
     352    // Determine if we've crossed a class_id boundary, as this resets the bits.
    346353    if (previous_class_id) {
    347354      if (strcmp(this_class_id,previous_class_id) != 0) {
     
    352359    }
    353360
    354     // If the state of this imfile is not "pending_burntool" then skip it, because
    355     if (!ignore_state) {
    356       psString imfile_state = psMetadataLookupStr(NULL,row,"imfile_state");
    357 
    358       if (!imfile_state) {
    359         continue;
    360       }
    361       if (strcmp("pending_burntool",imfile_state) != 0) {
    362         continue;
    363       }
    364     }
    365    
     361    // Write the URIs as well.
     362    this_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Duplicate, but helpful for my debugging.
     363    psMetadataAddStr(row,PS_LIST_TAIL,"this_uri",PS_META_REPLACE,"",this_uri);
     364    if (previous_uri) {
     365      psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri);
     366    }
     367
     368    // Check the two status variables
    366369    // Convert bits of the SQL query into booleans describing the data state
    367370    if ((psMetadataLookupS32(NULL,row,"is_downloaded") != 1)||
     
    381384    psMetadataAddBool(row,PS_LIST_TAIL,"already_burned",PS_META_REPLACE,"",already_burned);
    382385
    383     // We'll need to return the previous uri so we know where the input table is:
    384     if (previous_uri) {
    385       psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri);
    386       psFree(previous_uri);
    387     }
    388     previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri"));
    389 
    390     // Write the class_id stuff at the end for debugging.
    391     psMetadataAddStr(row,PS_LIST_TAIL,"this_class_id",PS_META_REPLACE,"",this_class_id);
    392     if (previous_class_id) {
    393       psMetadataAddStr(row,PS_LIST_TAIL,"previous_class_id",PS_META_REPLACE,"",previous_class_id);
    394       psFree(previous_class_id);
    395     }
    396     // Use tmp_class_id because class_id may not be populated for all imfiles
    397     previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
    398     psStringSubstitute(&previous_class_id,"XY","ota");
     386    // Check the uri for this exposure
     387    if (!this_uri) {
     388        ok_to_burn = false;
     389        already_burned = false;
     390
     391        // Save this round for next round.
     392        psFree(previous_class_id);
     393        psFree(previous_uri);
     394        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     395        psStringSubstitute(&previous_class_id,"XY","ota");
     396        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     397        continue;
     398    }     
     399
     400    //    printf("STATUS: %s %s %s %s (%d %d)\n",this_uri,previous_uri,this_class_id,previous_class_id,ok_to_burn,already_burned);
     401
     402    // If the state of this imfile is not "pending_burntool" then we can't burn it.
     403    if (!ignore_state) {
     404      psString imfile_state = psMetadataLookupStr(NULL,row,"imfile_state");
     405
     406      if (!imfile_state) { // imfile state is NULL, so we probably aren't registered.
     407        ok_to_burn = false;
     408
     409        // Save this round for next round.
     410        psFree(previous_class_id);
     411        psFree(previous_uri);
     412        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     413        psStringSubstitute(&previous_class_id,"XY","ota");
     414        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     415        continue;
     416      }
     417      if (strcmp("pending_burntool",imfile_state) != 0) { // Probably the state is full, do not twiddle states 
     418        // Save this round for next round.
     419        psFree(previous_class_id);
     420        psFree(previous_uri);
     421        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     422        psStringSubstitute(&previous_class_id,"XY","ota");
     423        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     424        continue;
     425      }
     426    }
     427   
    399428    // Determine if we've already suggested an entry for this ota, and if not, copy this
    400429    // suggestion into our output result list.
    401430    if (!ok_to_burn || already_burned) {
     431      // Save this round for next round.
     432      psFree(previous_class_id);
     433      psFree(previous_uri);
     434      previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     435      psStringSubstitute(&previous_class_id,"XY","ota");
     436      previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
    402437      continue;
    403438    }
    404    
     439    // If we're here, then we think we could potentially burntool this file.
    405440    psArrayAdd(results,results->n,row);
    406     // If we're here, then we think we could potentially burntool this file.
    407 
     441
     442    // Save this round for next round.
     443    psFree(previous_class_id);
     444    psFree(previous_uri);
     445    previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     446    psStringSubstitute(&previous_class_id,"XY","ota");
     447    previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.         
    408448  }
    409449 
     
    499539    PXOPT_LOOKUP_S32(bytes, config->args,  "-bytes", false, false);
    500540    PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
    501     PXOPT_LOOKUP_Bool(video_cells, config->args, "-video_cells", false, false);
     541    PXOPT_LOOKUP_BOOL(video_cells, config->args, "-video_cells", false);
    502542   
    503543    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     
    10601100    PXOPT_LOOKUP_F32(moon_phase, config->args, "-moon_phase", false, false);
    10611101    PXOPT_LOOKUP_STR(label,  config->args, "-label", false, false);
     1102    PXOPT_LOOKUP_STR(data_group,  config->args, "-data_group", false, false);
     1103    PXOPT_LOOKUP_STR(dist_group,  config->args, "-dist_group", false, false);
     1104    PXOPT_LOOKUP_STR(chip_workdir,config->args, "-chip_workdir", false, false);
    10621105    PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
    10631106
     
    12591302    // else continue on...
    12601303
    1261 
     1304    chip_workdir = chip_workdir ? chip_workdir : workdir;
    12621305    // insert an entry into the chipPendingExp table
    12631306    // this can only be run as the newExp's state has been set to stop
    12641307    if (!pxchipQueueByExpTag(config,
    12651308                exp_id,
    1266                 workdir,
     1309                             chip_workdir,
    12671310                label,
    1268                 NULL,       // data_group
    1269                 NULL,       // dist_group
     1311                             data_group,
     1312                             dist_group,
    12701313                reduction,
    12711314                NULL,       // expgroup
  • branches/czw_branch/20101203/ippTools/src/regtoolConfig.c

    r29965 r29982  
    268268    ADD_OPT(F32,  addprocessedexpArgs, "-moon_phase",       "define moon phase (0.0 = new)",   NAN);
    269269    ADD_OPT(Str,  addprocessedexpArgs, "-label",            "define label for chip stage (non-detrend data only)", NULL);
     270    ADD_OPT(Str,  addprocessedexpArgs, "-data_group",       "define data_group for chip stage (non-detrend data only)", NULL);
     271    ADD_OPT(Str,  addprocessedexpArgs, "-dist_group",       "define dist_group for chip stage (non-detrend data only)", NULL);
     272    ADD_OPT(Str,  addprocessedexpArgs, "-chip_workdir",     "define workdir for chip stage (non-detrend data only)", NULL);
    270273    ADD_OPT(Str,  addprocessedexpArgs, "-hostname",         "define host name", NULL);
    271274    ADD_OPT(S16,  addprocessedexpArgs, "-fault",             "set fault code", 0);
Note: See TracChangeset for help on using the changeset viewer.