IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38705


Ignore:
Timestamp:
Sep 3, 2015, 6:23:17 AM (11 years ago)
Author:
eugene
Message:

clarify flagging of 2mass objects; add some test points

Location:
branches/eam_branches/ipp-20150625/Ohana/src/relastro
Files:
3 edited

Legend:

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

    r38697 r38705  
    223223} ICRFobj;
    224224
     225# define ID_MEAS_OBJECT_HAS_2MASS ID_MEAS_POOR_PHOTOM
     226
    225227/* global variables set in parameter file */
    226228# define DVO_MAX_PATH 1024
     
    265267
    266268int    PARALLEL_OUTPUT;
     269
     270int    VERBOSE_IMAGE;
    267271
    268272int    VERBOSE;
  • branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/UpdateObjects.c

    r38697 r38705  
    11# include "relastro.h"
    22# define PAR_TOOFEW 5
     3
     4int DumpObjectsWith2MASS (Catalog *catalog, int Ncatalog);
    35
    46// This function operates on both Measure and MeasureTiny.  In the big stages, this should
     
    4042      SecFilt *secfilt = &catalog[i].secfilt[j*Nsecfilt];
    4143
    42       int XVERB = FALSE;
    43       XVERB |= (average[0].objID == OBJ_ID_SRC) && (average[0].catID == CAT_ID_SRC);
    44       XVERB |= (average[0].objID == OBJ_ID_DST) && (average[0].catID == CAT_ID_DST);
    45       if ((OBJ_ID_SRC || OBJ_ID_DST) && !XVERB) continue;
    46 
    4744      UpdateObjects_Stack(average, secfilt, measure, measureBig, Nsecfilt, fitStatsStack);
    4845      UpdateObjects_Chips(average, secfilt, measure, measureBig, Nsecfilt, fitStatsChips, i, m);
     
    5451  }
    5552
     53  // DumpObjectsWith2MASS (catalog, Ncatalog);
     54
    5655  FitStatsFree (fitStatsChips);
    5756  FitStatsFree (fitStatsStack);
     
    6362  FitStatsFree (sumStatsStack);
    6463
     64  return (TRUE);
     65}
     66
     67// This function operates on both Measure and MeasureTiny.  In the big stages, this should
     68// be called with just MeasureTiny set and Measure == NULL
     69int DumpObjectsWith2MASS (Catalog *catalog, int Ncatalog) {
     70
     71  int i;
     72  for (i = 0; i < Ncatalog; i++) {
     73    off_t j;
     74    for (j = 0; j < catalog[i].Naverage; j++) {
     75      /* calculate the average value of R,D for a single star */
     76      off_t m = catalog[i].average[j].measureOffset;
     77
     78      off_t k;
     79      for (k = 0; k < catalog[i].average[j].Nmeasure; k++) {
     80        MeasureTiny *measure = &catalog[i].measureT[m+k];
     81        if (measure->dbFlags & ID_MEAS_OBJECT_HAS_2MASS) {
     82          fprintf (stderr, "0x%08x 0x%08x : %12.8f %12.8f %5d\n", catalog[i].average[j].objID, catalog[i].average[j].catID, measure->R, measure->D, measure->photcode);
     83        }
     84      }
     85    }
     86  }
    6587  return (TRUE);
    6688}
     
    471493  FitAstromPoint *points = fit->points;
    472494
     495  int TESTPT2 = FALSE;
     496  TESTPT2 |= CAT_ID_SRC && OBJ_ID_SRC && (average[0].catID == CAT_ID_SRC) && (average[0].objID == OBJ_ID_SRC);
     497  TESTPT2 |= CAT_ID_DST && OBJ_ID_DST && (average[0].catID == CAT_ID_DST) && (average[0].objID == OBJ_ID_DST);
     498  if (TESTPT2) {
     499    fprintf (stderr, "got test det\n");
     500  }
     501
    473502  // find the basic properties of the detections for this object (Tmin, Tmax, Tmean)
    474503  off_t k;
     
    559588    Npoints++;
    560589
    561     if ((measure[0].photcode >= 2011) && (measure[0].photcode <= 2013)) {
     590    if ((measure[k].photcode >= 2011) && (measure[k].photcode <= 2013)) {
    562591      has2MASS = TRUE;
    563592    }
     
    566595  } // loop over measurements : average[0].Nmeasure
    567596
     597  int TESTPT = FALSE;
     598  TESTPT |= CAT_ID_SRC && OBJ_ID_SRC && (average[0].catID == CAT_ID_SRC) && (average[0].objID == OBJ_ID_SRC);
     599  TESTPT |= CAT_ID_DST && OBJ_ID_DST && (average[0].catID == CAT_ID_DST) && (average[0].objID == OBJ_ID_DST);
     600  if (TESTPT) {
     601    fprintf (stderr, "got test det\n");
     602  }
     603 
    568604  // XXX flag measurements from stars with 2MASS
    569605  for (k = 0; k < average[0].Nmeasure; k++) {
    570606    // reset the bit to note that a detection was used (or not)
    571607    if (has2MASS) {
    572       measure[k].dbFlags &= ~ID_MEAS_POOR_PHOTOM;
     608      measure[k].dbFlags |=  ID_MEAS_OBJECT_HAS_2MASS;
    573609    } else {
    574       measure[k].dbFlags |=  ID_MEAS_POOR_PHOTOM;
     610      measure[k].dbFlags &= ~ID_MEAS_OBJECT_HAS_2MASS;
    575611    }
    576612  }
     
    596632
    597633  *Tmean = 0.0;
     634
     635  double Tsum = 0.0;
     636  double Wsum = 0.0;
    598637  for (k = 0; k < Npoints; k++) {
    599638    Tmin = MIN(Tmin, points[k].T);
    600639    Tmax = MAX(Tmax, points[k].T);
    601     *Tmean += points[k].T;
     640
     641    float wx = 1.0 / SQ(points[k].dX);
     642
     643    Tsum += points[k].T * wx;
     644    Wsum += wx;
    602645
    603646    // at this point, T is in years since J2000
     
    611654
    612655  // mean epoch
    613   *Tmean /= (float) Npoints;
     656  *Tmean = Tsum / Wsum;
    614657
    615658  // for HIGH_SPEED, just use the center of the range
  • branches/eam_branches/ipp-20150625/Ohana/src/relastro/src/bcatalog.c

    r38665 r38705  
    119119    }
    120120
     121    int TESTPT = FALSE;
     122    TESTPT |= CAT_ID_SRC && OBJ_ID_SRC && (catalog[0].average[i].catID == CAT_ID_SRC) && (catalog[0].average[i].objID == OBJ_ID_SRC);
     123    TESTPT |= CAT_ID_DST && OBJ_ID_DST && (catalog[0].average[i].catID == CAT_ID_DST) && (catalog[0].average[i].objID == OBJ_ID_DST);
     124    if (TESTPT) {
     125      fprintf (stderr, "got test det\n");
     126    }
     127
    121128    Nm = 0;
    122129    for (j = 0; j < catalog[0].average[i].Nmeasure; j++) {
Note: See TracChangeset for help on using the changeset viewer.