IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36796


Ignore:
Timestamp:
Jun 2, 2014, 6:07:00 AM (12 years ago)
Author:
eugene
Message:

add basic bogus-detection code

Location:
branches/eam_branches/ipp-20140423/Ohana/src/relastro
Files:
5 edited

Legend:

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

    r36746 r36796  
    233233int    CLIP_THRESH;
    234234int USE_BASIC_CHECK;
     235
     236int ExcludeBogus;
     237double ExcludeBogusRadius;
    235238
    236239FitMode FIT_MODE;
     
    417420int setMeanR (double ra_fit, MeasureTiny *measure, Average *average, SecFilt *secfilt);
    418421int setMeanD (double dec_fit, MeasureTiny *measure, Average *average, SecFilt *secfilt);
     422double getMeanR_Big (Measure *measure, Average *average, SecFilt *secfilt);
     423double getMeanD_Big (Measure *measure, Average *average, SecFilt *secfilt);
    419424int setMeanR_Big (double ra_fit, Measure *measure, Average *average, SecFilt *secfilt);
    420425int setMeanD_Big (double dec_fit, Measure *measure, Average *average, SecFilt *secfilt);
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/args.c

    r36746 r36796  
    183183    remove_argument (N, &argc, argv);
    184184    FlagOutlier = TRUE;
     185  }
     186
     187  ExcludeBogus = FALSE;
     188  ExcludeBogusRadius = 0.0;
     189  if ((N = get_argument (argc, argv, "-exclude-bogus"))) {
     190    remove_argument (N, &argc, argv);
     191    ExcludeBogusRadius = atof (argv[N]);
     192    remove_argument (N, &argc, argv);
     193    ExcludeBogus = TRUE;
    185194  }
    186195
     
    593602    remove_argument (N, &argc, argv);
    594603    FlagOutlier = TRUE;
     604  }
     605
     606  ExcludeBogus = FALSE;
     607  ExcludeBogusRadius = 0.0;
     608  if ((N = get_argument (argc, argv, "-exclude-bogus"))) {
     609    remove_argument (N, &argc, argv);
     610    ExcludeBogusRadius = atof (argv[N]);
     611    remove_argument (N, &argc, argv);
     612    ExcludeBogus = TRUE;
    595613  }
    596614
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/bcatalog.c

    r36790 r36796  
    66static int Nskip2 = 0;
    77
     8static int NskipBogus = 0;
     9
    810// test image: 2013/06/15,13:25:51, GPC1.r.XY50
    911static int CHECK_TEST_IMAGE = TRUE;
     
    2123  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
    2224  int Nsecfilt;
     25  Coords coords;
     26
     27  /* for outlier rejection, project coordinates to a plane centered on the object with units of arcsec */
     28  coords.crval1 = 0;
     29  coords.crval2 = 0;
     30  coords.crpix1 = 0;
     31  coords.crpix2 = 0;
     32  coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0;
     33  coords.pc1_1  = coords.pc2_2 = 1.0;
     34  coords.pc1_2  = coords.pc2_1 = 0.0;
     35  coords.Npolyterms = 1;
     36  strcpy (coords.ctype, "DEC--SIN");
    2337
    2438  // XXX in the future, use catalog[0].Nsecfilt only?  allow catalogs to have variable Nsecfilt?
     
    7993      }
    8094
    81       // filter out outliers
     95      // filter out outliers - these are detections inconsistent with the offset distribution
    8296      if (FlagOutlier && (catalog[0].measure[offset].dbFlags & ID_MEAS_POOR_ASTROM)) {
    8397        catalog[0].measure[offset].dbFlags &= ~ID_MEAS_USED_CHIP;
     
    88102      }
    89103      catalog[0].measure[offset].dbFlags |= ID_MEAS_USED_CHIP;
     104
     105      // exclude bogus
     106      if (ExcludeBogus) {
     107          double Ri = getMeanR_Big (&catalog[0].measure[offset], &catalog[0].average[i], &catalog[0].secfilt[i*Nsecfilt]);
     108          double Di = getMeanD_Big (&catalog[0].measure[offset], &catalog[0].average[i], &catalog[0].secfilt[i*Nsecfilt]);
     109          coords.crval1 = catalog[0].average[i].R;
     110          coords.crval2 = catalog[0].average[i].D;
     111          double Xi, Yi;
     112          RD_to_XY (&Xi, &Yi, Ri, Di, &coords);
     113          double radius = hypot(Xi, Yi);
     114          // XXX this radius needs to be configurable
     115          if (radius > ExcludeBogusRadius) {
     116              NskipBogus ++;
     117              continue;
     118          }
     119      }
    90120
    91121      // re-assess on each run of relastro if a measurement should be used
     
    159189
    160190void bcatalog_show_skips () {
    161   fprintf (stderr, "Nskip: %d, %d\n", Nskip1, Nskip2);
    162   fprintf (stderr, "Nkeep: %d, %d\n", Nkeep1, Nkeep2);
     191    fprintf (stderr, "NskipBogus: %d\n", NskipBogus);
     192    // fprintf (stderr, "Nskip: %d, %d\n", Nskip1, Nskip2);
     193    // fprintf (stderr, "Nkeep: %d, %d\n", Nkeep1, Nkeep2);
    163194}
    164195
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/dvo_astrom_ops.c

    r33652 r36796  
    9191}
    9292
     93double getMeanR_Big (Measure *measure, Average *average, SecFilt *secfilt) {
     94
     95  double ra;
     96
     97  /* the measure carries the instantaneous mean position at the epoch t */
     98  ra = average[0].R - measure[0].dR / 3600.0;
     99
     100  /* possible corrections to mean ra:
     101
     102  - proper-motion and parallax
     103  - abberation
     104  - precession and nutation, etc
     105  - refraction
     106  - DCR
     107
     108  */
     109
     110  return (ra);
     111}
     112
     113double getMeanD_Big (Measure *measure, Average *average, SecFilt *secfilt) {
     114
     115  double dec;
     116
     117  /* the measure carries the instantaneous mean position at the epoch t */
     118  dec = average[0].D - measure[0].dD / 3600.0;
     119
     120  /* possible corrections to mean ra:
     121
     122  - proper-motion and parallax
     123  - abberation
     124  - precession and nutation, etc
     125  - refraction
     126  - DCR
     127
     128  */
     129
     130  return (dec);
     131}
     132
    93133int setMeanR_Big (double ra_fit, Measure *measure, Average *average, SecFilt *secfilt) {
    94134
     
    144184  return (TRUE);
    145185}
     186
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/load_catalogs.c

    r36630 r36796  
    8484  }
    8585
    86   // XXX TEST : bcatalog_show_skips();
     86  bcatalog_show_skips();
    8787
    8888  Nstar = 0;
     
    162162   
    163163    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       strcpy (command, tmpline); }
     164    if (ExcludeBogus)  { snprintf (tmpline, 1024, "%s -exclude-bogus %f", command, ExcludeBogusRadius); strcpy (command, tmpline); }
    164165   
    165166    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
Note: See TracChangeset for help on using the changeset viewer.