IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37686


Ignore:
Timestamp:
Nov 28, 2014, 12:37:27 PM (12 years ago)
Author:
eugene
Message:

save the old offset map, skip objects with two few filtered detections

Location:
branches/eam_branches/ipp-20140904/Ohana/src/relastro
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h

    r37684 r37686  
    503503int checkStarMap(int N);
    504504int createStarMap (Catalog *catalog, int Ncatalog);
     505int printStarMap(int N, char *filename);
    505506
    506507int GetScatterRawRef(float *dLsig, float *dMsig, float *dRsig, int *nKeep, StarData *raw, StarData *ref, int Nstars, float SigmaLimit);
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/StarMaps.c

    r36630 r37686  
    176176}
    177177
     178int printStarMap(int N, char *filename) {
     179
     180  off_t i, Nimages;
     181  Image *images = getimages(&Nimages, NULL);
     182  double L, M;
     183
     184  FILE *f = fopen (filename, "w");
     185
     186  for (i = 0; i < starmap[N].Npoints; i++) {
     187    // set the transformed coordinates
     188    XY_to_LM (&L, &M, starmap[N].points[i].X, starmap[N].points[i].Y, &images[N].coords);
     189
     190    fprintf (f, "%d %7.2f %f : %7.2f %7.2f : %7.2f %7.2f : %7.2f %7.2f\n", (int) i, starmap[N].points[i].X, starmap[N].points[i].Y, starmap[N].points[i].L, starmap[N].points[i].M, L, M, starmap[N].points[i].L - L, starmap[N].points[i].M - M);
     191  }
     192  fclose (f);
     193  return (TRUE);
     194}
     195
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateChips.c

    r37684 r37686  
    107107      if (VERBOSE) fprintf (stderr, "reject fit for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT" of %d\n", image[i].name,  i,  Nraw, image[i].nstar);
    108108
    109       // restore status quo ante (replace truMap with tmpMap)
    110       RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
    111       image[i].dXpixSys = dXpixSys;
    112       image[i].dYpixSys = dYpixSys;
    113       image[i].nFitAstrom = nFitAstr;
    114 
    115       saveCenter (image, &Ro[i], &Do[i], i);
    116       mode[i] = 1;
    117       NoldFit ++;
    118       free (raw);
    119       free (ref);
    120       continue;
     109      if (1) {
     110        // restore status quo ante (replace truMap with tmpMap)
     111        RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
     112        image[i].dXpixSys = dXpixSys;
     113        image[i].dYpixSys = dYpixSys;
     114        image[i].nFitAstrom = nFitAstr;
     115
     116        saveCenter (image, &Ro[i], &Do[i], i);
     117        mode[i] = 1;
     118        NoldFit ++;
     119        free (raw);
     120        free (ref);
     121        continue;
     122      }
    121123    }
    122124
     
    124126      if (VERBOSE) fprintf (stderr, "fit diverges too much for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT"\n", image[i].name,  i,  Nraw);
    125127
    126       // restore status quo ante (replace truMap with tmpMap)
    127       RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
    128       image[i].dXpixSys = dXpixSys;
    129       image[i].dYpixSys = dYpixSys;
    130       image[i].nFitAstrom = nFitAstr;
    131 
    132       saveCenter (image, &Ro[i], &Do[i], i);
    133       mode[i] = 2;
    134       image[i].flags |= ID_IMAGE_ASTROM_POOR;
    135       NoldFit ++;
    136       free (raw);
    137       free (ref);
    138       continue;
     128      if (1) {
     129        // restore status quo ante (replace truMap with tmpMap)
     130        RestoreCoords (&image[i].coords, &oldCoords, &image[i]);
     131        image[i].dXpixSys = dXpixSys;
     132        image[i].dYpixSys = dYpixSys;
     133        image[i].nFitAstrom = nFitAstr;
     134
     135        saveCenter (image, &Ro[i], &Do[i], i);
     136        mode[i] = 2;
     137        image[i].flags |= ID_IMAGE_ASTROM_POOR;
     138        NoldFit ++;
     139        free (raw);
     140        free (ref);
     141        continue;
     142      }
    139143    }
    140144
     
    538542
    539543  // copy the coords structure data first, then fix the offsetMap pointers
     544  // this modifies tgt.coords, but we need to keep the original pointer
    540545  CopyCoords (tgt, src);
     546  tgt->offsetMap = truMap;
    541547
    542548  // we want to keep the old solution, which is (maybe) a pointer to a stand-alone
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/bcatalog.c

    r37655 r37686  
    199199      }
    200200    }
     201    // we have filtered this object.  do not keep it if we now have too few meas
     202    if (Nm <= SRC_MEAS_TOOFEW) {
     203      Nmeasure -= Nm;
     204      continue;
     205    }
    201206    subcatalog[0].average[Naverage].Nmeasure = Nm;
    202207    Naverage ++;
Note: See TracChangeset for help on using the changeset viewer.