IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 12, 2012, 9:37:27 PM (14 years ago)
Author:
Serge CHASTEL
Message:

Rolled back to previous version (34285)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppTranslate/src/ppMopsRead.c

    r34435 r34437  
    2222  long num = inNames->n;                   // Number of inputs
    2323  psArray *detections = psArrayAlloc(num); // Array of detections, to return
    24   double plateScale = 0.0;        // Plate scale
    25   long numGood = 0;               // Number of good rows
    2624  for (int i = 0; i < num; i++) {
    2725    const char *name = inNames->data[i];
     
    9896    det->mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + det->exptime / 2.0 / 3600 / 24;
    9997
    100     //It's recomputed
    10198    det->seeing = (float) 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") +
    10299                                 psMetadataLookupF32(NULL, header, "FWHM_MIN"));
     
    192189    psVector *angleV = psMetadataLookupVector(NULL, table, "POSANGLE");
    193190    psVector *flagsV = psMetadataLookupVector(NULL, table, "FLAGS");
    194     long localNumGood = 0;               // Number of good rows in the current skycell
     191
     192    double plateScale = 0.0;        // Plate scale
     193    long numGood = 0;               // Number of good rows
    195194    for (long row = 0; row < size; row++) {
    196195
     
    234233      plateScale += scale;
    235234      numGood++;
    236       localNumGood++;
    237     }
     235    }
     236    det->seeing *= ((float) plateScale) / ((float) numGood);
     237
     238    // Are we using numGood for anything outside of this function?
     239    det->numGood = numGood;
     240
    238241    if (isfinite(args->zp) && numGood > 0) {
    239242      psBinaryOp(mag, mag, "+", psScalarAlloc(args->zp, PS_TYPE_F32));
    240243    }
    241244
    242     psTrace("ppMops.read", 2, "Read %ld good rows from %s\n", localNumGood, (const char*)name);
     245    psTrace("ppMops.read", 2, "Read %ld good rows from %s\n", numGood, (const char*)name);
    243246  }
    244   //The seeing is the product of the mean of FWHM_MIN and FWHM_MAJ by
    245   //the mean of the scale values of all "good" detections.
    246   if (numGood > 0) {
    247     //Avoid dividing by 0
    248     det->seeing *= ((float) plateScale) / ((float) numGood);
    249   } else {
    250     det->seeing = NAN;
    251   }
    252   // Are we using numGood for anything outside of this function?
    253   det->numGood = numGood;
    254247
    255248  psTrace("ppMops.read", 1, "Done reading input detections\n");
Note: See TracChangeset for help on using the changeset viewer.