IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42483


Ignore:
Timestamp:
Aug 2, 2023, 3:06:37 PM (3 years ago)
Author:
eugene
Message:

do not crash if no boundary tree is supplied when calibrating warps and stacks

Location:
trunk/Ohana/src/relphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relphot/src/relphot.c

    r41647 r42483  
    3636      // calculate zero points for images (may group by exposure [mosaic], night [tgroups]; may measure flat-correction)
    3737      // IF CALLED WITH NLOOP == 0, DOES NOT LOAD bcatalog, just loads image table and generates ImageSubset.dat
    38       // If called with -update, calls reload_catalogs() just like apply_offsets
     38      // If called with -update, calls reload_catalogs() just like apply_offsets, UNLESS -only-stacks-and-warps is selected
    3939      relphot_images (skylist);
    4040      relphot_free (sky, skylist);
  • trunk/Ohana/src/relphot/src/setMrelCatalog.c

    r42151 r42483  
    948948  }
    949949
    950   // for a diff db, we just want primary, if available or not. for warp we want to use the
    951   // skycell which provided the stack best entry
    952   int tessID, projID, skycellID;
    953   if (IS_DIFF_DB) {
    954     get_tess_ids(&tessID, &projID, &skycellID, average[0].R, average[0].D);
    955   }
    956   for (Nsec = 0; Nsec < Nsecfilt; Nsec++) {
    957     if (!IS_DIFF_DB) {
    958       myAssert (secfilt[Nsec].stackBestOff <= catalog->Nmeasure, "stackBestOff out of range");
    959       if (!FindImageSkycellID (secfilt[Nsec].stackBestOff, cat, &tessID, &projID, &skycellID)) continue;
    960     }
    961     results->tessID[Nsec]    = tessID;
    962     results->projID[Nsec]    = projID;
    963     results->skycellID[Nsec] = skycellID;
     950  if (BOUNDARY_TREE) {
     951    int tessID, projID, skycellID;
     952
     953    // for a diff db, we just want primary, if available or not.
     954    if (IS_DIFF_DB) {
     955      get_tess_ids(&tessID, &projID, &skycellID, average[0].R, average[0].D);
     956    }
     957    // save the tess ID for each secfilt
     958    for (Nsec = 0; Nsec < Nsecfilt; Nsec++) {
     959      // for warps, we want to use the skycell which provided the stack best entry
     960      if (!IS_DIFF_DB) {
     961        myAssert (secfilt[Nsec].stackBestOff <= catalog->Nmeasure, "stackBestOff out of range");
     962        if (!FindImageSkycellID (secfilt[Nsec].stackBestOff, cat, &tessID, &projID, &skycellID)) continue;
     963      }
     964      results->tessID[Nsec]    = tessID;
     965      results->projID[Nsec]    = projID;
     966      results->skycellID[Nsec] = skycellID;
     967    }
    964968  }
    965969
     
    987991    if (isfinite(measure[k].psfQF)     && (measure[k].psfQF     > 0.00)) average->NwarpOK ++;
    988992
    989     // use primary skycell for DIFF, stack skycell for WARP
    990     if (!MatchImageSkycellID (meas, cat, results->tessID[Nsec], results->projID[Nsec], results->skycellID[Nsec])) {
    991       continue;
     993    // restrict to measurements from the desired skycell
     994    if (BOUNDARY_TREE) {
     995      // use primary skycell for DIFF, stack skycell for WARP, otherwise skip this measurement
     996      if (!MatchImageSkycellID (meas, cat, results->tessID[Nsec], results->projID[Nsec], results->skycellID[Nsec])) {
     997        continue;
     998      }
    992999    }
    9931000
Note: See TracChangeset for help on using the changeset viewer.