IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28331


Ignore:
Timestamp:
Jun 15, 2010, 9:48:06 AM (16 years ago)
Author:
eugene
Message:

fix the IDs and metadata

Location:
trunk/Ohana/src/photdbc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/photdbc/include/photdbc.h

    r27435 r28331  
    5252double CHISQ_MAX;
    5353double SIGMA_MAX;
     54double AVE_SIGMA_LIM;
    5455int    NMEAS_MIN;
    5556double ZERO_POINT;
  • trunk/Ohana/src/photdbc/src/ConfigInit.c

    r25757 r28331  
    4242
    4343  ScanConfig (config, "SIGMA_MAX",              "%lf", 0, &SIGMA_MAX);
     44  ScanConfig (config, "AVE_SIGMA_LIM",          "%lf", 0, &AVE_SIGMA_LIM);
    4445  ScanConfig (config, "NMEAS_MIN",              "%d",  0, &NMEAS_MIN);
    4546
  • trunk/Ohana/src/photdbc/src/copy_images.c

    r28306 r28331  
    66  off_t Nimage;
    77  char *ImageOut;
     8  unsigned int imageID;
    89  FITS_DB in;
    910  FITS_DB out;
     
    4748  dvo_image_addrows (&out, image, Nimage);
    4849
     50  // note that imageID is unsigned int
     51  status = gfits_scan (&in.header, "IMAGEID", "%u", 1, &imageID);
     52  if (!status) {
     53    status = gfits_scan (&in.header, "NIMAGES", "%u", 1, &imageID);
     54    imageID++;
     55  }
     56  status = gfits_modify (&out.header, "IMAGEID", "%u", 1, imageID);
     57
    4958  dvo_image_update (&out, VERBOSE);
    5059  dvo_image_unlock (&out);
  • trunk/Ohana/src/photdbc/src/make_subcatalog.c

    r28306 r28331  
    88  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm, Nsecfilt;
    99  double mag, minMag;
    10 
     10  int keep;
     11 
    1112  Nsecfilt = GetPhotcodeNsecfilt ();
    1213  assert (catalog[0].Nsecfilt == Nsecfilt);
     
    2526    // exclude stars with too few measurements
    2627    if (NMEAS_MIN && (catalog[0].average[i].Nmeasure < NMEAS_MIN)) continue;
     28
     29    if (AVE_SIGMA_LIM) {
     30      // if all of the average magnitude errors are >AVE_SIGMA_LIM, drop the object
     31      keep = FALSE;
     32      for (j = 0; !keep && (j < Nsecfilt); j++) {
     33        if (catalog[0].secfilt[Nsecfilt*i+j].dM < AVE_SIGMA_LIM) {
     34          keep = TRUE;
     35        }
     36      }
     37      if (!keep) continue;
     38    }
    2739
    2840    /* assign average and secfilt values */
  • trunk/Ohana/src/photdbc/src/photdbc.c

    r28306 r28331  
    2121  skylist = SkyListByPatch (sky, -1, &REGION);
    2222  for (i = 0; i < skylist[0].Nregions; i++) {
    23     if (i % 100 == 0) fprintf (stderr, "%s\n", skylist[0].regions[i][0].name);
     23    if (VERBOSE) fprintf (stderr, "%s\n", skylist[0].regions[i][0].name);
    2424
    2525    // set the parameters which guide catalog open/load/create
     
    5656    }
    5757
     58    // the output catalog needs to have the same values for 'objID' and 'sorted' as the input
     59    outcatalog.objID = incatalog.objID;
     60    outcatalog.sorted = incatalog.sorted;
     61    if (!incatalog.sorted) {
     62      fprintf (stderr, "ERROR: input db must be sorted: %s\n", incatalog.filename);
     63      exit (2);
     64    }
     65
    5866    /* limit number of measures based on selections */
    5967    make_subcatalog (&outcatalog, &incatalog);
Note: See TracChangeset for help on using the changeset viewer.