IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26277


Ignore:
Timestamp:
Nov 25, 2009, 11:48:23 AM (16 years ago)
Author:
eugene
Message:

free next_meas, reduce search range to 1.02*radius (was 2.0)

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/find_matches.c

    r21508 r26277  
    77  double *X1, *Y1, *X2, *Y2;
    88  double dX, dY, dR;
    9   int *N1, *N2,  *next_meas;
     9  int *N1, *N2, *next_meas;
    1010  int Nave, NAVE, Nmeas, NMEAS, Nmatch;
    1111  int Nsecfilt, Nsec;
     
    2424  ALLOCATE (X1, double, NstarsIn);
    2525  ALLOCATE (Y1, double, NstarsIn);
    26   ALLOCATE (N1, int,   NstarsIn);
     26  ALLOCATE (N1, int,    NstarsIn);
    2727
    2828  /** allocate local arrays (catalog) **/
     
    338338  free (Y1);
    339339  free (N1);
     340  free (N2);
    340341  free (X2);
    341342  free (Y2);
    342   free (N2);
     343  free (next_meas);
     344
    343345  return (Nmatch);
    344346}
  • trunk/Ohana/src/addstar/src/find_matches_closest.c

    r21508 r26277  
    2424  ALLOCATE (X1, double, NstarsIn);
    2525  ALLOCATE (Y1, double, NstarsIn);
    26   ALLOCATE (N1, int,   NstarsIn);
     26  ALLOCATE (N1, int,    NstarsIn);
    2727
    2828  /** allocate local arrays (catalog) **/
     
    4242  catID = catalog[0].catID;
    4343
    44   /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the
    45    * advantage that every point in R,D has a mapping to a unique X,Y.  However, note that not all
    46    * possible X,Y points map back to R,D and the local plate scale changes substantially far from
    47    * the projection pole.  a better mapping might be ARC, not yet implemented (see
    48    * coordops.update.c).  We use the center of the region (catalog) for crval1,2.
     44  /* project onto rectilinear grid with 1 arcsec pixels. the choice of ARC projection has
     45   * the advantage that every point in R,D has a mapping to a unique X,Y.  However, note
     46   * that not all possible X,Y points map back to R,D and the local plate scale changes
     47   * far from the projection pole. We use the center of the region (catalog) for crval1,2.
    4948   */
    5049  tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax);
     
    117116    /* negative dX: j is too large */
    118117    dX = X1[i] - X2[j];
    119     if (dX <= -2*RADIUS) {
     118    if (dX <= -1.02*RADIUS) {
    120119      i++;
    121120      continue;
    122121    }
    123122    /* positive dX, i is too large */
    124     if (dX >= 2*RADIUS) {
     123    if (dX >= 1.02*RADIUS) {
    125124      j++;
    126125      continue;
    127126    }
    128127
     128    /* within match range; look for matches */
    129129    Jmin = -1;
    130130    Rmin = RADIUS2;
    131     for (J = j; (dX > -2*RADIUS) && (J < Nave); J++) {
     131    for (J = j; (dX > -1.02*RADIUS) && (J < Nave); J++) {
    132132      /* find closest match for this detection */
    133133      dX = X1[i] - X2[J];
     
    195195    }
    196196
    197 
    198197    /* adds the measurement to the calibration if appropriate color terms are found */
    199198    /* we call this before (optionally) setting the average magnitude to avoid auto-correlations */
     
    285284
    286285    // the following measure elements cannot be set until here:
    287     catalog[0].measure[Nmeas].dR       = 0.0;
    288     catalog[0].measure[Nmeas].dD       = 0.0;
     286    catalog[0].measure[Nmeas].dR       = 0.0; // astrometric offset, not error
     287    catalog[0].measure[Nmeas].dD       = 0.0; // astrometric offset, not error
    289288    catalog[0].measure[Nmeas].dbFlags  = 0;
    290289    catalog[0].measure[Nmeas].averef   = Nave;
     
    336335  free (Y1);
    337336  free (N1);
     337  free (N2);
    338338  free (X2);
    339339  free (Y2);
    340   free (N2);
     340  free (next_meas);
     341
    341342  return (Nmatch);
    342343}
Note: See TracChangeset for help on using the changeset viewer.