IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 4, 2015, 2:24:51 PM (11 years ago)
Author:
watersc1
Message:

revert back to the style of difftool warpstack code from before I tried to make it better, as that didn't work.

File:
1 edited

Legend:

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

    r37938 r37947  
    4242static bool definepoprunMode(pxConfig *config);
    4343static bool definewarpstackMode(pxConfig *config);
    44 static bool definewarpstackOldMethodMode(pxConfig *config);
     44//static bool definewarpstackOldMethodMode(pxConfig *config);
    4545static bool definewarpwarpMode(pxConfig *config);
    4646static bool definestackstackMode(pxConfig *config);
     
    9696        MODECASE(DIFFTOOL_MODE_DEFINEPOPRUN,          definepoprunMode);
    9797        MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACK,       definewarpstackMode);
    98         MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD,       definewarpstackOldMethodMode);
     98        //      MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD,       definewarpstackOldMethodMode);
    9999        MODECASE(DIFFTOOL_MODE_DEFINEWARPWARP,        definewarpwarpMode);
    100100        MODECASE(DIFFTOOL_MODE_DEFINESTACKSTACK,      definestackstackMode);
     
    13361336    return true;
    13371337  }
    1338 
    1339   // Do a pass through the result list to determine which runs should be excluded.
    1340   // This exclusion should do two things:  If a skycell doesn't have a stack (as we do a LEFT JOIN) now,
    1341   // then that skycell needs to not be included in the diff.  However, if we have available off,
    1342   // then we need to flag the entire exposure as bad.
    1343   psS64 previous_exp_id = 0;
    1344   long  start_index     = 0;
    1345   bool  bad_exposure    = false;
    1346   long  Nskycells       = 0;
    1347   for (long i = 0; i < output->n; i++) {
    1348     psMetadata *row = output->data[i];
    1349     bool mdok;
    1350     psS64 exp_id = psMetadataLookupS64(&mdok, row, "exp_id");
    1351     if (!mdok) {
    1352         psError(PXTOOLS_ERR_PROG, false, "exp_id not found");
    1353         if (!psDBRollback(config->dbh)) {
    1354           psError(PS_ERR_UNKNOWN, false, "database error");
    1355         }
    1356         return false;
    1357     }
    1358 
    1359     if (exp_id != previous_exp_id) { // Save the position of the start of this exposure.
    1360       if (Nskycells == 0) {  // Ooops, we didn't find any good skycells for this exposure.  Don't make an empty run.
    1361         for (long j = start_index; j < i; j++) { // Clear all the previous entries for this exposure.
    1362           psMetadata *old_row = output->data[j];
    1363           psMetadataAddBool(old_row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true);  // No stack exists, so this row can't be diffed.
    1364           psMetadataAddBool(old_row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true);  // No stack exists, so this row can't be diffed.
    1365         }
    1366       }     
    1367       previous_exp_id = exp_id;
    1368       start_index = i;
    1369       bad_exposure = false;
    1370       Nskycells = 0;
    1371     }
    1372 
    1373     if (bad_exposure) { // We've flagged this exposure as bad.
    1374       psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true);
    1375       psMetadataAddBool(row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true);
    1376       continue;
    1377     }
    1378 
    1379     psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", false); // By default, this shouldn't be excluded.
    1380     psMetadataAddBool(row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", false);
    1381    
    1382     psS64 stack_id = psMetadataLookupS64(&mdok, row, "stack_id");
    1383     if (stack_id == PS_MAX_S64) { // stack_id IS NULL, we cannot make this skycell-level diff
    1384       psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true);  // No stack exists, so this row can't be diffed.
    1385 
    1386       if (!available) { // We want to be strict about everything, so cancel this entire exposure.
    1387         bad_exposure = true;  // New exposures with this exp_id will be flagged as bad.
    1388         for (long j = start_index; j < i; j++) { // Clear all the previous entries for this exposure.
    1389           psMetadata *old_row = output->data[j];
    1390           psMetadataAddBool(old_row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true);  // No stack exists, so this row can't be diffed.
    1391           psMetadataAddBool(old_row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true);  // No stack exists, so this row can't be diffed.
    1392         }
    1393       }
    1394     }
    1395     else { // This looks fine.
    1396       Nskycells++;
    1397     }
    1398   }
    1399  
    1400 
    14011338 
    14021339  if (pretend) {
     
    14511388          return false;
    14521389        }
    1453       }
    1454 
    1455       // Do exposure level exclusion here.
    1456       bool excludeExp = psMetadataLookupBool(&mdok, row, "excludeExp");
    1457       if (!mdok) {
    1458         psError(PXTOOLS_ERR_PROG, false, "excludeExp not found");
    1459         if (!psDBRollback(config->dbh)) {
    1460           psError(PS_ERR_UNKNOWN, false, "database error");
    1461         }
    1462         return false;
    1463       }
    1464       if (excludeExp) { // The pre-scan determined that no diff should be made for this exposure.
    1465         continue;
    14661390      }
    14671391     
     
    15201444   
    15211445    if (exp_id == last_exp_id) {
    1522       bool exclude = psMetadataLookupBool(&mdok, row, "exclude");
    1523       if (!mdok) {
    1524         psError(PXTOOLS_ERR_PROG, false, "exclude not found");
    1525         if (!psDBRollback(config->dbh)) {
    1526           psError(PS_ERR_UNKNOWN, false, "database error");
    1527         }
    1528         return false;
    1529       }
    1530       if (exclude) { // skip this skycell, as we probably don't have a diff.
    1531         continue;
    1532       }
    15331446      psString skycell_id = psMetadataLookupStr(&mdok, row, "skycell_id");
    15341447      if (!mdok) {
     
    16141527
    16151528
    1616 
     1529#if (0)
    16171530static bool definewarpstackOldMethodMode(pxConfig *config)
    16181531{
     
    20051918    return true;
    20061919}
    2007 
     1920#endif
    20081921
    20091922static bool definewarpwarpMode(pxConfig *config)
Note: See TracChangeset for help on using the changeset viewer.