Changeset 34437
- Timestamp:
- Sep 12, 2012, 9:37:27 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ppTranslate/src/ppMopsRead.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppTranslate/src/ppMopsRead.c
r34435 r34437 22 22 long num = inNames->n; // Number of inputs 23 23 psArray *detections = psArrayAlloc(num); // Array of detections, to return 24 double plateScale = 0.0; // Plate scale25 long numGood = 0; // Number of good rows26 24 for (int i = 0; i < num; i++) { 27 25 const char *name = inNames->data[i]; … … 98 96 det->mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + det->exptime / 2.0 / 3600 / 24; 99 97 100 //It's recomputed101 98 det->seeing = (float) 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") + 102 99 psMetadataLookupF32(NULL, header, "FWHM_MIN")); … … 192 189 psVector *angleV = psMetadataLookupVector(NULL, table, "POSANGLE"); 193 190 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 195 194 for (long row = 0; row < size; row++) { 196 195 … … 234 233 plateScale += scale; 235 234 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 238 241 if (isfinite(args->zp) && numGood > 0) { 239 242 psBinaryOp(mag, mag, "+", psScalarAlloc(args->zp, PS_TYPE_F32)); 240 243 } 241 244 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); 243 246 } 244 //The seeing is the product of the mean of FWHM_MIN and FWHM_MAJ by245 //the mean of the scale values of all "good" detections.246 if (numGood > 0) {247 //Avoid dividing by 0248 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;254 247 255 248 psTrace("ppMops.read", 1, "Done reading input detections\n");
Note:
See TracChangeset
for help on using the changeset viewer.
