IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33364


Ignore:
Timestamp:
Feb 24, 2012, 7:54:02 AM (14 years ago)
Author:
eugene
Message:

clean up some of the verbosity; skip NaN values when making bcatalog; pass secfilt data to bcatalog; add camera to relphot_client args; skip NAN dM values in stats analysis

Location:
branches/eam_branches/ipp-20111122/Ohana/src/relphot
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/include/relphot.h

    r33328 r33364  
    8181char   CATFORMAT[16];  /* internal, elixir, loneos, panstarrs */
    8282char   CameraConfig[MAX_PATH_LENGTH];
     83char   CAMERA[64];    /* eg, gpc1 */
    8384char   SKY_TABLE[MAX_PATH_LENGTH];
    8485int    SKY_DEPTH;  /** XXX EAM : depth of catalog tables, fix usage */
     
    256257int           reload_catalogs_parallel PROTO((SkyList *sky));
    257258int           reload_images       PROTO((FITS_DB *db));
    258 int           setExclusions       PROTO((Catalog *catalog, int Ncatalog));
     259int           setExclusions       PROTO((Catalog *catalog, int Ncatalog, int verbose));
    259260void          setMcal             PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr));
    260261void          setMcalFinal        PROTO((void));
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/BrightCatalog.c

    r33274 r33364  
    9898      measure[i].photcode = photcode[i];
    9999    }
    100     fprintf (stderr, "loaded data for %lld measures\n", (long long) Nrow);
     100    // fprintf (stderr, "loaded data for %lld measures\n", (long long) Nrow);
    101101
    102102    free (dR      );
     
    535535
    536536  for (i = 0; i < catalogs->NCATALOG; i++) {
     537    dvo_catalog_init (&catalogs->catalog[i], TRUE);
    537538    catalogs->catIDs[i] = 0;
    538539    catalogs->NAVERAGE[i] = 100;
     
    609610    if (catalogs->Ncatalog >= catalogs->NCATALOG) {
    610611      catalogs->NCATALOG += 16;
    611       fprintf (stderr, "realloc catalogs->catalog: old: %llx  ", (long long) catalogs->catalog);
     612      // fprintf (stderr, "realloc catalogs->catalog: old: %llx  ", (long long) catalogs->catalog);
    612613      REALLOCATE (catalogs->catalog, Catalog, catalogs->NCATALOG);
    613       fprintf (stderr, "new: %llx  -  %llx\n", (long long) catalogs->catalog, (long long) (catalogs->catalog + sizeof(Catalog)*catalogs->NCATALOG));
    614 
    615       fprintf (stderr, "realloc catalogs->NAVERAGE: old: %llx  ", (long long) catalogs->NAVERAGE);
     614      // fprintf (stderr, "new: %llx  -  %llx\n", (long long) catalogs->catalog, (long long) (catalogs->catalog + sizeof(Catalog)*catalogs->NCATALOG));
     615
     616      // fprintf (stderr, "realloc catalogs->NAVERAGE: old: %llx  ", (long long) catalogs->NAVERAGE);
    616617      REALLOCATE (catalogs->NAVERAGE, off_t,  catalogs->NCATALOG);
    617       fprintf (stderr, "new: %llx  -  %llx\n", (long long) catalogs->NAVERAGE, (long long) (catalogs->NAVERAGE + sizeof(off_t)*catalogs->NCATALOG));
    618 
    619       fprintf (stderr, "realloc catalogs->NMEASURE: old: %llx  ", (long long) catalogs->NMEASURE);
     618      // fprintf (stderr, "new: %llx  -  %llx\n", (long long) catalogs->NAVERAGE, (long long) (catalogs->NAVERAGE + sizeof(off_t)*catalogs->NCATALOG));
     619
     620      // fprintf (stderr, "realloc catalogs->NMEASURE: old: %llx  ", (long long) catalogs->NMEASURE);
    620621      REALLOCATE (catalogs->NMEASURE, off_t,  catalogs->NCATALOG);
    621       fprintf (stderr, "new: %llx  -  %llx\n", (long long) catalogs->NMEASURE, (long long) (catalogs->NMEASURE + sizeof(off_t)*catalogs->NCATALOG));
     622      // fprintf (stderr, "new: %llx  -  %llx\n", (long long) catalogs->NMEASURE, (long long) (catalogs->NMEASURE + sizeof(off_t)*catalogs->NCATALOG));
    622623
    623624      REALLOCATE (catalogs->catIDs,   int,   catalogs->NCATALOG);
     
    625626      int j;
    626627      for (j = catalogs->NCATALOG - 16; j < catalogs->NCATALOG; j++) {
    627         // XXX call the catalog init function in libdvo?
     628        dvo_catalog_init (&catalogs->catalog[j], TRUE);
    628629        catalogs->catIDs[j] = 0;
    629630        catalogs->NAVERAGE[j] = 100;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/ConfigInit.c

    r33301 r33364  
    4040  free (tmpcatdir);
    4141
    42   GetConfig (config, "GSCFILE",                "%s",  0, GSCFILE);
     42  GetConfig (config, "CAMERA",                  "%s",  0, CAMERA);
     43
     44  GetConfig (config, "GSCFILE",                 "%s",  0, GSCFILE);
    4345  ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
    4446  ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/ImageSubset.c

    r33303 r33364  
    142142    tzero[i]   = image[i].tzero;
    143143    trate[i]   = image[i].trate;
    144     fprintf (stderr, "time: %d, trate: %d\n", image[i].tzero, image[i].trate);
    145144  }
    146145
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c

    r33328 r33364  
    697697      list[n] = pow (10.0, 0.01*Xm);
    698698      dlist[n] = 1;
     699      if (list[n] > 100000) {
     700        fprintf (stderr, "!");
     701      }
    699702      n++;
    700703    }
     
    733736
    734737      dM = catalog[i].secfilt[Nsecfilt*j+Nsec].dM;
     738      if (isnan(dM)) continue;
     739      if (dM > 100) {
     740        fprintf (stderr, ".");
     741      }
    735742      list[n] = dM;
    736743      dlist[n] = 1;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c

    r33274 r33364  
    4242  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
    4343  float mag;
    44   int Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Ngalaxy, Npsfqf;
     44  int Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Ngalaxy, Npsfqf, Nnan;
    4545
    4646  int Nsecfilt = GetPhotcodeNsecfilt ();
     
    5656  Nmeasure = Naverage = 0;
    5757
    58   Ncode = Ntime = Ndophot = Nmag = Nsigma = Nimag = Nfew = Npsfqf = Ngalaxy = 0;
     58  Ncode = Ntime = Ndophot = Nmag = Nsigma = Nimag = Nfew = Npsfqf = Ngalaxy = Nnan = 0;
    5959
    6060  // copy the following fields to the subcatalog:
     
    8383        subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].M  = NAN;
    8484        subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].dM = NAN;
     85        subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].Xm = NAN_S_SHORT;
    8586        subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].flags &= ~ID_STAR_FEW;
    8687        subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec].flags &= ~ID_STAR_POOR;
     
    117118      // skip garbage measurements
    118119      if (catalog[0].measure[offset].psfQual < 0.85) { Npsfqf ++; continue; }
     120      if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; }
    119121
    120122      // check for galaxies
     
    196198    fprintf (stderr, "using "OFF_T_FMT" stars ("OFF_T_FMT" measures) of "OFF_T_FMT" for catalog %s\n",
    197199             subcatalog[0].Naverage,  subcatalog[0].Nmeasure,  i, catalog[0].filename);
    198     fprintf (stderr, "rejections: %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d few, %d psfqf, %d galaxies\n",
    199              Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Npsfqf, Ngalaxy);
     200    fprintf (stderr, "rejections: %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d few, %d psfqf, %d Nnan, %d galaxies\n",
     201             Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Npsfqf, Nnan, Ngalaxy);
    200202  }
    201203  return (TRUE);
     
    269271      tmpcatalog.measureT[Nmeasure].averef = i;
    270272      Nmeasure ++;
     273    }
     274    for (j = 0; j < Nsecfilt; j++) {
     275      tmpcatalog.secfilt[i*Nsecfilt + j] = subcatalog[0].secfilt[ave*Nsecfilt + j];
    271276    }
    272277  }
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/load_catalogs.c

    r33303 r33364  
    132132
    133133    char command[1024];
    134     snprintf (command, 1024, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D MAG_LIM %f -D SIGMA_LIM %f",
    135               PhotcodeList, catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, MAG_LIM, SIGMA_LIM);
     134    snprintf (command, 1024, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D CAMERA %s -D MAG_LIM %f -D SIGMA_LIM %f",
     135              PhotcodeList, catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM);
    136136
    137137    char tmpline[1024];
     
    210210  BrightCatalogSplitFree (catalogs);
    211211
     212  int Nmeasure = 0;
     213  int Naverage = 0;
     214  for (i = 0; i < catalogs->Ncatalog; i++) {
     215    Nmeasure += catalogs->catalog[i].Nmeasure;
     216    Naverage += catalogs->catalog[i].Naverage;
     217  }
     218
     219  fprintf (stderr, "loaded %d catalogs, using a total of %d stars (%d measures)\n", catalogs->Ncatalog, Naverage, Nmeasure);
     220
    212221  return (catalog);
    213222}     
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/reload_catalogs.c

    r33303 r33364  
    139139
    140140    char command[1024];
    141     snprintf (command, 1024, "relphot_client %s -update %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D STAR_TOOFEW %d -minerror %f",
    142               PhotcodeList, imageFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, STAR_TOOFEW, MIN_ERROR);
     141    snprintf (command, 1024, "relphot_client %s -update %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f",
     142              PhotcodeList, imageFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
    143143
    144144    // options & configs which affect relphot_client -update
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot.c

    r33328 r33364  
    8888  SAVEPLOT = FALSE;
    8989
    90   setExclusions (catalog, Ncatalog);
     90  setExclusions (catalog, Ncatalog, TRUE);
    9191
    9292  global_stats (catalog, Ncatalog, flatcorr);
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/setExclusions.c

    r31450 r33364  
    66// and uses the bits read from disk as the test
    77
    8 int setExclusions (Catalog *catalog, int Ncatalog) {
     8int setExclusions (Catalog *catalog, int Ncatalog, int verbose) {
    99
    1010  off_t i, j, k, m, Narea, Nnocal, Ngood;
     
    5959    }
    6060  }
    61   if (VERBOSE) fprintf (stderr, OFF_T_FMT" measurements marked by area\n",    Narea);
    62   if (VERBOSE) fprintf (stderr, OFF_T_FMT" measurements marked nocal\n",      Nnocal);
    63   if (VERBOSE) fprintf (stderr, OFF_T_FMT" measurements kept for analysis\n", Ngood);
     61  if (verbose) fprintf (stderr, OFF_T_FMT" measurements marked by area\n",    Narea);
     62  if (verbose) fprintf (stderr, OFF_T_FMT" measurements marked nocal\n",      Nnocal);
     63  if (verbose) fprintf (stderr, OFF_T_FMT" measurements kept for analysis\n", Ngood);
    6464  return (TRUE);
    6565}
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/setMrelFinal.c

    r33117 r33364  
    5151
    5252  // this sets flags in the measureT element, not the measure element
    53   setExclusions (catalog, 1);  /* mark by area */
     53  setExclusions (catalog, 1, VERBOSE);  /* mark by area */
    5454
    5555  /* set catalog[0].found[i] = FALSE */
Note: See TracChangeset for help on using the changeset viewer.