IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2012, 8:44:35 PM (14 years ago)
Author:
eugene
Message:

do not crash on primaryCell; set extended based on PSF - AP combined with errors; set GoodPS1 average bit; do not reset average flags on each pass

Location:
branches/eam_branches/ipp-20120905/Ohana/src/relphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120905/Ohana/src/relphot/src/StarOps.c

    r34423 r34424  
    327327
    328328  char *primaryCell = NULL;
    329   ALLOCATE (primaryCell, char, DVO_MAX_PATH);
     329  if (isSetMrelFinal) {
     330    ALLOCATE (primaryCell, char, DVO_MAX_PATH);
     331  }
    330332
    331333  for (j = 0; j < catalog[Nc].Naverage; j++) {
     
    338340    }
    339341
    340     BoundaryTreePrimaryCell(primaryCell, catalog[Nc].average[j].R, catalog[Nc].average[j].D);
     342    if (isSetMrelFinal) {
     343      BoundaryTreePrimaryCell(primaryCell, catalog[Nc].average[j].R, catalog[Nc].average[j].D);
     344    }
    341345
    342346    int GoodPS1 = FALSE;
     
    432436            // count the extended detections
    433437            if (!isnan(catalog[Nc].measure[m].Map)) {
    434               if (catalog[Nc].measure[m].M - catalog[Nc].measure[m].Map > 0.5) {
     438              float dMagAp = catalog[Nc].measure[m].M - catalog[Nc].measure[m].Map;
     439              float SigmaAp = hypot(0.1, 2.5*catalog[Nc].measure[m].dM);
     440              // XXX this is still quite ad hoc, but at least it:
     441              // (a) converges to 0.1 mag offset at the bright end
     442              // (b) converges to 0.5 mag offset at the faint end (dM = 0.2)
     443              if (dMagAp > SigmaAp) {
    435444                Next ++;
    436445                NextPS1 ++;
     
    660669          case 0:
    661670            catalog[Nc].secfilt[Nsecfilt*j+Nsec].flags |= ID_PHOTOM_PASS_0;
    662             GoodPS1 = TRUE;
     671            if (havePS1) GoodPS1 = TRUE;
    663672            break;
    664673          case 1:
    665674            catalog[Nc].secfilt[Nsecfilt*j+Nsec].flags |= ID_PHOTOM_PASS_1;
    666             GoodPS1 = TRUE;
     675            if (havePS1) GoodPS1 = TRUE;
    667676            break;
    668677          case 2:
    669678            catalog[Nc].secfilt[Nsecfilt*j+Nsec].flags |= ID_PHOTOM_PASS_2;
    670             GoodPS1 = TRUE;
     679            if (havePS1) GoodPS1 = TRUE;
    671680            break;
    672681          case 3:
     
    693702
    694703    if (isSetMrelFinal) {
    695       DVOAverageFlags flagBits = ID_OBJ_EXT | ID_OBJ_EXT_ALT | ID_OBJ_GOOD | ID_OBJ_GOOD_ALT;
    696 
    697       // we attempt to set a few flags here; reset those bits before trying:
    698       catalog[Nc].average[j].flags &= ~flagBits;
     704      if (pass == 0) {
     705        DVOAverageFlags flagBits = ID_OBJ_EXT | ID_OBJ_EXT_ALT | ID_OBJ_GOOD | ID_OBJ_GOOD_ALT;
     706        // we attempt to set a few flags here; reset those bits before trying:
     707        catalog[Nc].average[j].flags &= ~flagBits;
     708      }
    699709
    700710      if (NextPS1 && (NextPS1 > NpsfPS1)) {
  • branches/eam_branches/ipp-20120905/Ohana/src/relphot/src/initialize.c

    r33963 r34424  
    7777  args_client (argc, argv);
    7878
    79   if (MODE == MODE_UPDATE_OBJECTS) return;
     79  if (MODE == MODE_UPDATE_OBJECTS) {
     80    char tmpline1[256];
     81    int Ns;
     82    Nphotcodes = GetPhotcodeNsecfilt ();
     83    ALLOCATE (photcodes, PhotCode *, Nphotcodes);
     84    ALLOCATE (PhotcodeList, char, 256);
     85    for (Ns = 0; Ns < Nphotcodes; Ns++) {
     86      photcodes[Ns] = GetPhotcodebyNsec (Ns);
     87      if (Ns > 0) {
     88        snprintf (tmpline1, 256, "%s,%s", PhotcodeList, photcodes[Ns][0].name);
     89      } else {
     90        snprintf (tmpline1, 256, "%s", photcodes[Ns][0].name);
     91      }
     92      strcpy (PhotcodeList, tmpline1);
     93    }
     94    return;
     95  }
    8096
    8197  // load the list of photcodes into the globals (photcodes, Nphotcodes)
Note: See TracChangeset for help on using the changeset viewer.