Changeset 16820 for trunk/psphot/src/pmFootprint.c
- Timestamp:
- Mar 4, 2008, 3:10:25 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/pmFootprint.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/pmFootprint.c
r16048 r16820 1241 1241 return peaks; 1242 1242 } 1243 1244 void pmDetectionsFree (pmDetections *detections) { 1245 1246 if (!detections) return; 1247 1248 psFree (detections->footprints); 1249 psFree (detections->peaks); 1250 psFree (detections->oldPeaks); 1251 return; 1252 } 1253 1254 // generate a pmDetections container with empty (allocated) footprints and peaks containers 1255 pmDetections *pmDetectionsAlloc() { 1256 1257 pmDetections *detections = (pmDetections *)psAlloc(sizeof(pmDetections)); 1258 psMemSetDeallocator(detections, (psFreeFunc) pmDetectionsFree); 1259 1260 detections->footprints = NULL; 1261 detections->peaks = NULL; 1262 detections->oldPeaks = NULL; 1263 detections->last = 0; 1264 1265 return (detections); 1266 } 1267 1268 /************************************************************************************************************/ 1269 /* 1270 * Cull a set of peaks contained in a psArray of pmFootprints 1271 */ 1272 psErrorCode 1273 psphotCullPeaks(const psImage *image, // the image wherein lives the footprint 1274 const psImage *weight, // corresponding variance image 1275 const psMetadata *recipe, 1276 psArray *footprints) { // array of pmFootprints 1277 bool status = false; 1278 float nsigma_delta = psMetadataLookupF32(&status, recipe, "FOOTPRINT_CULL_NSIGMA_DELTA"); 1279 if (!status) { 1280 nsigma_delta = 0; // min. 1281 } 1282 float nsigma_min = psMetadataLookupF32(&status, recipe, "FOOTPRINT_CULL_NSIGMA_MIN"); 1283 if (!status) { 1284 nsigma_min = 0; 1285 } 1286 const float skyStdev = psMetadataLookupF32(NULL, recipe, "SKY_STDEV"); 1287 1288 return pmFootprintArrayCullPeaks(image, weight, footprints, 1289 nsigma_delta, nsigma_min*skyStdev); 1290 } 1291
Note:
See TracChangeset
for help on using the changeset viewer.
