IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2015, 4:49:06 PM (11 years ago)
Author:
eugene
Message:

extensive work on relphot, relastro, uniphot, dvomerge aiming to the construction and calibration of PV3

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/dvomerge/src/replace_match.c

    r37046 r38986  
    11# include "dvomerge.h"
    22
     3// XXX this function does not work because it it loops over the average->Nmeasure entries
     4// as if they were sorted, but objects which have had entries added to them have elements
     5// out of sequence.  I probably need to step through next_meas to find the sequence.
     6
    37// average and measure pointers to the objects of interest and their first / current measurement
    4 int replace_match (Average *average_out, Measure *measure_out, Average *average_in, Measure *measure_in) {
     8int replace_match (Average *average_out, Measure *measure_out, off_t *next_meas, Average *average_in, Measure *measure_in) {
    59
    610  int Nout;
     
    812  unsigned int catID;
    913
     14  off_t m = average_out->measureOffset;
     15
    1016  // find the matching photcode in the object's list of measurements
    1117  for (Nout = 0; Nout < average_out[0].Nmeasure; Nout ++) {
    12     if (measure_out[Nout].photcode != measure_in[0].photcode) continue;
     18    myAssert (m > -1, "oops");
     19    if (measure_out[m].photcode != measure_in[0].photcode) {
     20      m = next_meas[m];
     21      continue;
     22    }
    1323   
    1424    // set the new measurements
    15     averef = measure_out[Nout].averef;
    16     catID  = measure_out[Nout].catID;
    17     measure_out[Nout] = measure_in[0];
     25    averef = measure_out[m].averef;
     26    catID  = measure_out[m].catID;
     27    measure_out[m] = measure_in[0];
    1828
    1929    // old code: find R,D using average_in[0], the get offset relative to average_out[0].  no longer
     
    2434    // measure_out[Nout].dD = 3600.0*(average_out[0].D - Din);
    2535
    26     measure_out[Nout].dbFlags  = 0;  // XXX why reset these?
    27     measure_out[Nout].averef   = averef;
    28     measure_out[Nout].objID    = average_out[0].objID;
    29     measure_out[Nout].catID    = catID;
     36    measure_out[m].dbFlags  = 0;  // XXX why reset these?
     37    measure_out[m].averef   = averef;
     38    measure_out[m].objID    = average_out[0].objID;
     39    measure_out[m].catID    = catID;
    3040
    31     float dRoff = dvoOffsetR(&measure_out[Nout], average_out);
     41    float dRoff = dvoOffsetR(&measure_out[m], average_out);
    3242
    3343    // rationalize dR
    3444    if (dRoff > +180.0*3600.0) {
    3545      // average on high end of boundary, move star up
    36       measure_out[Nout].R += 360.0;
     46      measure_out[m].R += 360.0;
    3747      dRoff -= 360.0*3600.0;
    3848    }
    3949    if (dRoff < -180.0*3600.0) {
    4050      // average on low end of boundary, move star down
    41       measure_out[Nout].R -= 360.0;
     51      measure_out[m].R -= 360.0;
    4252      dRoff += 360.0*3600.0;
    4353    }
     
    4959      if (fabs(dRoff*cosD) > 10*RADIUS) {
    5060        fprintf (stderr, "surprisingly distant detection: %10.6f,%10.6f vs %10.6f,%10.6f\n",
    51                  average_out[0].R, average_out[0].D, measure_out[Nout].R, measure_out[Nout].D);
     61                 average_out[0].R, average_out[0].D, measure_out[m].R, measure_out[m].D);
    5262      }
    5363    }
Note: See TracChangeset for help on using the changeset viewer.