Changeset 34435
- Timestamp:
- Sep 12, 2012, 11:07:45 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/ppTranslate/src/ppMopsRead.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppTranslate/src/ppMopsRead.c
r34285 r34435 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 scale 25 long numGood = 0; // Number of good rows 24 26 for (int i = 0; i < num; i++) { 25 27 const char *name = inNames->data[i]; … … 96 98 det->mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + det->exptime / 2.0 / 3600 / 24; 97 99 100 //It's recomputed 98 101 det->seeing = (float) 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") + 99 102 psMetadataLookupF32(NULL, header, "FWHM_MIN")); … … 189 192 psVector *angleV = psMetadataLookupVector(NULL, table, "POSANGLE"); 190 193 psVector *flagsV = psMetadataLookupVector(NULL, table, "FLAGS"); 191 192 double plateScale = 0.0; // Plate scale 193 long numGood = 0; // Number of good rows 194 long localNumGood = 0; // Number of good rows in the current skycell 194 195 for (long row = 0; row < size; row++) { 195 196 … … 233 234 plateScale += scale; 234 235 numGood++; 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 236 localNumGood++; 237 } 241 238 if (isfinite(args->zp) && numGood > 0) { 242 239 psBinaryOp(mag, mag, "+", psScalarAlloc(args->zp, PS_TYPE_F32)); 243 240 } 244 241 245 psTrace("ppMops.read", 2, "Read %ld good rows from %s\n", numGood, (const char*)name);242 psTrace("ppMops.read", 2, "Read %ld good rows from %s\n", localNumGood, (const char*)name); 246 243 } 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; 247 254 248 255 psTrace("ppMops.read", 1, "Done reading input detections\n");
Note:
See TracChangeset
for help on using the changeset viewer.
