IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35669


Ignore:
Timestamp:
Jun 17, 2013, 6:53:08 PM (13 years ago)
Author:
eugene
Message:

add options -min-bad-psfqf & -max-mean-offset

Location:
branches/eam_branches/ipp-20130509/Ohana/src/relastro
Files:
8 edited

Legend:

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

    r35416 r35669  
    194194
    195195int PhotFlagSelect, PhotFlagPoor, PhotFlagBad;
     196
     197float MinBadQF;
     198float MaxMeanOffset;
    196199
    197200int TimeSelect;
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/ImageOps.c

    r35665 r35669  
    10191019  } 
    10201020 
     1021  // if (MinBadQF > 0.0) {
     1022  //   if (measure[0].psfQF < MinBadQF) return FALSE;
     1023  // }
     1024
    10211025  /* select measurements by time */
    10221026  if (TimeSelect) {
     
    10811085  } 
    10821086 
     1087  if (MinBadQF > 0.0) {
     1088    if (measure[0].psfQF < MinBadQF) return FALSE;
     1089  }
     1090
    10831091  /* select measurements by time */
    10841092  if (TimeSelect) {
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r35494 r35669  
    128128    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
    129129
     130    if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
     131    if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
     132
    130133    if (TimeSelect) {
    131134      char *tstart = ohana_sec_to_date (TSTART);
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateObjects.c

    r35606 r35669  
    4848  PMFit fitAve, fitPM, fitPAR, fit;
    4949  time_t T2000;
    50   off_t Nave, Npm, Npar, Nskip;
    51   off_t NaveSum, NpmSum, NparSum, NskipSum;
     50  off_t Nave, Npm, Npar, Nskip, Noffset;
     51  off_t NaveSum, NpmSum, NparSum, NskipSum, NoffSum;
    5252  double Tmin, Tmax, Tmean, Trange;
    5353
     
    8080  }
    8181
    82   NaveSum = NparSum = NpmSum = NskipSum = 0;
     82  NaveSum = NparSum = NpmSum = NoffSum = NskipSum = 0;
    8383  for (i = 0; i < Ncatalog; i++) {
    8484
    8585    if (VERBOSE2) fprintf (stderr, "astrometrize catalog %d : "OFF_T_FMT" ave, "OFF_T_FMT" meas\n", i,  catalog[i].Naverage,  catalog[i].Nmeasure);
    8686
    87     Nave = Npar = Npm = Nskip = 0;
     87    Nave = Npar = Npm = Nskip = Noffset = 0;
    8888    for (j = 0; j < catalog[i].Naverage; j++) {
    8989      /* calculate the average value of R,D for a single star */
     
    121121
    122122        // does the measurement pass the supplied filtering constraints?
    123         if (!MeasFilterTestTiny(&measure[k], FALSE)) {
     123        // MeasFilterTestTiny does not test psfQF
     124        int keepMeasure = measureBig ? MeasFilterTest(&measureBig[k], FALSE) : MeasFilterTestTiny(&measure[k], FALSE);
     125        if (!keepMeasure) {
    124126          measure[k].dbFlags &= ~ID_MEAS_USED_OBJ;
    125127          if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; }
     
    345347        continue;
    346348      }
     349
     350      // what is the offset relative to the mean fit position?
     351      coords.crval1 = catalog[i].average[j].R;
     352      coords.crval2 = catalog[i].average[j].D;
     353
     354      double dXoff, dYoff;
     355      RD_to_XY (&dXoff, &dYoff, fit.Ro, fit.Do, &coords);
     356      float dPos = hypot (dXoff, dYoff);
     357      if (dPos > MaxMeanOffset) {
     358        Noffset ++;
     359        continue;
     360      }
     361
    347362
    348363      // the measure fields must be updated before the average fields
     
    390405    NparSum += Npar;
    391406    NskipSum += Nskip;
    392     if (VERBOSE) fprintf (stderr, "catalog %d : "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT"\n",  i,  Nave,  Npm,  Npar,  Nskip);
     407    NoffSum += Noffset;
     408    if (VERBOSE) fprintf (stderr, "catalog %d : "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT", Noffset "OFF_T_FMT"\n",  i,  Nave,  Npm,  Npar,  Nskip, Noffset);
    393409  }
    394410
    395   if (VERBOSE) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT"\n",  (NaveSum + NpmSum + NparSum),  NaveSum,  NpmSum,  NparSum,  NskipSum);
     411  if (VERBOSE) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT", "OFF_T_FMT" have too large an offset\n",  (NaveSum + NpmSum + NparSum),  NaveSum,  NpmSum,  NparSum,  NskipSum, NoffSum);
    396412  return (TRUE);
    397413}
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/args.c

    r35416 r35669  
    382382  }
    383383
     384  MinBadQF = 0.0;
     385  if ((N = get_argument (argc, argv, "-min-bad-psfqf"))) {
     386    remove_argument (N, &argc, argv);
     387    MinBadQF = atof (argv[N]);
     388    remove_argument (N, &argc, argv);
     389  }
     390
     391  MaxMeanOffset = 10.0;
     392  if ((N = get_argument (argc, argv, "-max-mean-offset"))) {
     393    remove_argument (N, &argc, argv);
     394    MaxMeanOffset = atof (argv[N]);
     395    remove_argument (N, &argc, argv);
     396  }
     397
    384398  NLOOP = 4;
    385399  if ((N = get_argument (argc, argv, "-nloop"))) {
     
    675689    remove_argument (N, &argc, argv);
    676690    PhotFlagPoor = atoi (argv[N]);
     691    remove_argument (N, &argc, argv);
     692  }
     693
     694  MinBadQF = 0.0;
     695  if ((N = get_argument (argc, argv, "-min-bad-psfqf"))) {
     696    remove_argument (N, &argc, argv);
     697    MinBadQF = atof (argv[N]);
     698    remove_argument (N, &argc, argv);
     699  }
     700
     701  MaxMeanOffset = 10.0;
     702  if ((N = get_argument (argc, argv, "-max-mean-offset"))) {
     703    remove_argument (N, &argc, argv);
     704    MaxMeanOffset = atof (argv[N]);
    677705    remove_argument (N, &argc, argv);
    678706  }
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/high_speed_catalogs.c

    r35105 r35669  
    162162    if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
    163163    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
     164
     165    if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
     166    if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
    164167
    165168    if (WHERE_A[0]) { snprintf (tmpline, 1024, "%s -D WHERE_A \"%s\"", command, WHERE_A);               strcpy (command, tmpline); }
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/hpm_catalogs.c

    r35416 r35669  
    160160    if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
    161161    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
     162
     163    if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
     164    if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
    162165
    163166    if (TimeSelect) {
  • branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro_objects.c

    r35105 r35669  
    154154    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    155155    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
    156     if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                     strcpy (command, tmpline); }
    157     if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);     strcpy (command, tmpline); }
    158     if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);   strcpy (command, tmpline); }
     156    if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                      strcpy (command, tmpline); }
     157    if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);      strcpy (command, tmpline); }
     158    if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
    159159    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
     160
     161    if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
     162    if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
    160163
    161164    if (TimeSelect) {
Note: See TracChangeset for help on using the changeset viewer.