IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36798


Ignore:
Timestamp:
Jun 2, 2014, 12:42:58 PM (12 years ago)
Author:
eugene
Message:

write out bogus measurements to text files for testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/bcatalog.c

    r36797 r36798  
    66static int Nskip2 = 0;
    77
     8FILE *fbogus = NULL;
    89static int NskipBogus = 0;
    910
     
    5758    ID_STAR_USE_PAR   |
    5859    ID_STAR_NO_ASTROM ;
     60
     61  if (ExcludeBogus && (fbogus == NULL)) {
     62    char name[1024];
     63    snprintf (name, 1024, "%s/bogus.%02d.dat", CATDIR, HOST_ID);
     64    fbogus = fopen (name, "w");
     65    if (!fbogus) {
     66      fprintf (stderr, "trouble opening bogus detection dump : %s\n", name);
     67    }
     68  }
    5969
    6070  /* exclude stars not in range or with too few measurements */
     
    116126              NskipBogus ++;
    117127              if (TRUE || VERBOSE2) {
    118                   fprintf (stderr, "exclude bogus: %10.6f %10.6f : %10.6f %10.6f : %6.2f %6.2f : %6.2f\n", catalog[0].average[i].R, catalog[0].average[i].D, Ri, Di, Xi, Yi, radius);
     128                FILE *foutput = fbogus ? fbogus : stderr;
     129                char *date = ohana_sec_to_date(catalog[0].measure[offset].t);
     130                fprintf (foutput, "exclude bogus: %10.6f %10.6f : %10.6f %10.6f : %6.2f %6.2f : %6.2f : %5d %s\n", catalog[0].average[i].R, catalog[0].average[i].D, Ri, Di, Xi, Yi, radius, catalog[0].measure[offset].photcode, date);
     131                free (date);
    119132              }
    120133              continue;
     
    192205
    193206void bcatalog_show_skips () {
     207  if (ExcludeBogus) {
     208    if (fbogus) fclose (fbogus);
    194209    fprintf (stderr, "NskipBogus: %d\n", NskipBogus);
    195210    // fprintf (stderr, "Nskip: %d, %d\n", Nskip1, Nskip2);
    196211    // fprintf (stderr, "Nkeep: %d, %d\n", Nkeep1, Nkeep2);
     212  }
    197213}
    198214
Note: See TracChangeset for help on using the changeset viewer.