Changeset 26787
- Timestamp:
- Feb 5, 2010, 1:37:43 PM (16 years ago)
- Location:
- branches/eam_branches/20091201/psModules
- Files:
-
- 9 edited
-
. (modified) (1 prop)
-
src/objects/pmDetections.c (modified) (2 diffs)
-
src/objects/pmDetections.h (modified) (1 diff)
-
src/objects/pmSource.c (modified) (5 diffs)
-
src/objects/pmSource.h (modified) (2 diffs)
-
src/objects/pmSourceIO.c (modified) (4 diffs)
-
src/objects/pmSourcePlotApResid.c (modified) (3 diffs)
-
src/objects/pmSourcePlotMoments.c (modified) (3 diffs)
-
src/objects/pmSourcePlotPSFModel.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/psModules
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/eam_branches/psModules.stack.20100120 merged eligible /branches/eam_branches/20091113/psModules 26119-26255
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/eam_branches/20091201/psModules/src/objects/pmDetections.c
r26632 r26787 27 27 psFree (detections->oldPeaks); 28 28 psFree (detections->oldFootprints); 29 30 psFree (detections->newSources); 31 psFree (detections->allSources); 29 32 return; 30 33 } … … 40 43 detections->oldPeaks = NULL; 41 44 detections->oldFootprints = NULL; 45 detections->newSources = NULL; 46 detections->allSources = NULL; 42 47 detections->last = 0; 43 48 -
branches/eam_branches/20091201/psModules/src/objects/pmDetections.h
r26631 r26787 21 21 typedef struct { 22 22 psArray *footprints; // collection of footprints in the image 23 psArray *oldFootprints; // collection of footprints previously found 23 24 psArray *peaks; // collection of all peaks contained by the footprints 24 25 psArray *oldPeaks; // collection of all peaks previously found 25 psArray *oldFootprints; // collection of footprints previously found 26 psArray *newSources; // collection of sources 27 psArray *allSources; // collection of sources 26 28 int last; 27 29 } pmDetections; -
branches/eam_branches/20091201/psModules/src/objects/pmSource.c
r26623 r26787 275 275 // psphot-specific function which applies the recipe values 276 276 // only apply selection to sources within specified region 277 pmPSFClump pmSourcePSFClump(ps Region *region, psArray *sources, psMetadata *recipe)277 pmPSFClump pmSourcePSFClump(psImage **savedImage, psRegion *region, psArray *sources, float PSF_SN_LIM, float PSF_CLUMP_GRID_SCALE, psF32 SX_MAX, psF32 SY_MAX, psF32 AR_MAX) 278 278 { 279 279 psTrace("psModules.objects", 10, "---- begin ----\n"); … … 285 285 286 286 PS_ASSERT_PTR_NON_NULL(sources, errorClump); 287 PS_ASSERT_PTR_NON_NULL(recipe, errorClump);288 289 bool status = true; // Status of MD lookup290 float PSF_SN_LIM = psMetadataLookupF32(&status, recipe, "PSF_SN_LIM");291 if (!status) {292 PSF_SN_LIM = 0;293 }294 float PSF_CLUMP_GRID_SCALE = psMetadataLookupF32(&status, recipe, "PSF_CLUMP_GRID_SCALE");295 if (!status) {296 PSF_CLUMP_GRID_SCALE = 0.1;297 }298 287 299 288 // find the sigmaX, sigmaY clump 300 289 { 301 psF32 SX_MAX = psMetadataLookupF32(&status, recipe, "MOMENTS_SX_MAX");302 if (!status) {303 psWarning("MOMENTS_SX_MAX not set in recipe");304 SX_MAX = 10.0;305 }306 psF32 SY_MAX = psMetadataLookupF32(&status, recipe, "MOMENTS_SY_MAX");307 if (!status) {308 psWarning("MOMENTS_SY_MAX not set in recipe");309 SY_MAX = 10.0;310 }311 psF32 AR_MAX = psMetadataLookupF32(&status, recipe, "MOMENTS_AR_MAX");312 if (!status) {313 psWarning("MOMENTS_AR_MAX not set in recipe");314 AR_MAX = 3.0;315 }316 290 psF32 AR_MIN = 1.0 / AR_MAX; 317 291 … … 399 373 psfClump.nSigma = stats->sampleStdev; 400 374 401 const bool keep_psf_clump = psMetadataLookupBool(NULL, recipe, "KEEP_PSF_CLUMP"); 402 if (keep_psf_clump) 403 { 404 psMetadataAdd(recipe, PS_LIST_TAIL, 405 "PSF_CLUMP", PS_DATA_IMAGE, "Image of PSF coefficients", splane); 375 if (savedImage) { 376 *savedImage = psMemIncrRefCounter(splane); 406 377 } 407 378 psFree (splane); … … 530 501 *****************************************************************************/ 531 502 532 bool pmSourceRoughClass(psRegion *region, psArray *sources, psMetadata *recipe, pmPSFClump clump, psImageMaskType maskSat)503 bool pmSourceRoughClass(psRegion *region, psArray *sources, float PSF_SN_LIM, float PSF_CLUMP_NSIGMA, pmPSFClump clump, psImageMaskType maskSat) 533 504 { 534 505 psTrace("psModules.objects", 10, "---- begin ----"); 535 506 536 507 PS_ASSERT_PTR_NON_NULL(sources, false); 537 PS_ASSERT_PTR_NON_NULL(recipe, false);538 508 539 509 int Nsat = 0; … … 548 518 psVector *starsn_peaks = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 549 519 psVector *starsn_moments = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 550 551 // get basic parameters, or set defaults552 bool status;553 float PSF_SN_LIM = psMetadataLookupF32 (&status, recipe, "PSF_SN_LIM");554 if (!status) PSF_SN_LIM = 20.0;555 float PSF_CLUMP_NSIGMA = psMetadataLookupF32 (&status, recipe, "PSF_CLUMP_NSIGMA");556 if (!status) PSF_CLUMP_NSIGMA = 1.5;557 558 // float INNER_RADIUS = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS");559 520 560 521 pmSourceMode noMoments = PM_SOURCE_MODE_MOMENTS_FAILURE | PM_SOURCE_MODE_SKYVAR_FAILURE | PM_SOURCE_MODE_SKY_FAILURE | PM_SOURCE_MODE_BELOW_MOMENTS_SN; -
branches/eam_branches/20091201/psModules/src/objects/pmSource.h
r26594 r26787 176 176 * 177 177 * The return value indicates the success (TRUE) of the operation. 178 * 179 * XXX: Limit the S/N of the candidate sources (part of Metadata)? (TBD). 180 * XXX: Save the clump parameters on the Metadata (TBD) 181 * 182 */ 178 */ 179 183 180 pmPSFClump pmSourcePSFClump( 181 psImage **savedImage, 184 182 psRegion *region, ///< restrict measurement to specified region 185 183 psArray *source, ///< The input pmSource 186 psMetadata *metadata ///< Contains classification parameters 184 float PSF_SN_LIM, 185 float PSF_CLUMP_GRID_SCALE, 186 psF32 SX_MAX, 187 psF32 SY_MAX, 188 psF32 AR_MAX 187 189 ); 188 190 … … 200 202 psRegion *region, ///< restrict measurement to specified region 201 203 psArray *sources, ///< The input pmSources 202 psMetadata *metadata, ///< Contains classification parameters 204 float PSF_SN_LIM, ///< min S/N for source to be used for PSF model 205 float PSF_CLUMP_NSIGMA, ///< size of region around peak of clump for PSF stars 203 206 pmPSFClump clump, ///< Statistics about the PSF clump 204 207 psImageMaskType maskSat ///< Mask value for saturated pixels -
branches/eam_branches/20091201/psModules/src/objects/pmSourceIO.c
r26260 r26787 40 40 #include "pmPSF.h" 41 41 #include "pmModel.h" 42 #include "pmDetections.h" 42 43 #include "pmSource.h" 43 44 #include "pmModelClass.h" … … 344 345 345 346 // if sources is NULL, write out an empty table 346 // input / output sources are stored on the readout->analysis as "PSPHOT.SOURCES" -- a better name might be something like PM_SOURCE_DATA 347 psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES"); 347 // input / output sources are stored on the readout->analysis as "PSPHOT.DETECTIONS" 348 349 psArray *sources = NULL; 350 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 351 if (detections) { 352 sources = detections->allSources; 353 } 348 354 if (!sources) { 355 detections = pmDetectionsAlloc(); 349 356 sources = psArrayAlloc(0); 350 psMetadataAddArray(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "Blank array of sources", sources); 351 psFree(sources); // Held onto by the metadata, so we can continue to use 357 detections->allSources = sources; 358 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_UNKNOWN | PS_META_REPLACE, "Blank array of sources", detections); 359 psFree(detections); // Held onto by the metadata, so we can continue to use 352 360 } 353 361 … … 1031 1039 } 1032 1040 readout->data_exists = true; 1033 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "input sources", sources); 1034 psFree (sources); 1041 1042 pmDetections *detections = pmDetectionsAlloc(); 1043 detections->allSources = sources; 1044 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "input sources", detections); 1045 psFree (detections); 1035 1046 return true; 1036 1047 } … … 1124 1135 bool status; 1125 1136 1126 // select the psf of interest 1127 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES"); 1128 if (!psf) return false; 1129 return true; 1130 } 1131 1132 1137 // select the detections of interest 1138 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 1139 if (!detections) return false; 1140 if (!detections->allSources) return false; 1141 return true; 1142 } 1143 1144 -
branches/eam_branches/20091201/psModules/src/objects/pmSourcePlotApResid.c
r20937 r26787 34 34 #include "pmPSF.h" 35 35 #include "pmModel.h" 36 #include "pmDetections.h" 36 37 #include "pmSource.h" 37 38 #include "pmSourcePlots.h" … … 53 54 PS_ASSERT_PTR_NON_NULL(layout, false); 54 55 56 bool status; 55 57 Graphdata graphdata; 56 58 KapaSection section; … … 61 63 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT"); 62 64 63 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 64 if (sources == NULL) 65 return false; 65 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 66 if (detections == NULL) return false; 67 68 psArray *sources = detections->allSources; 69 if (sources == NULL) return false; 66 70 67 71 int kapa = pmKapaOpen (false); -
branches/eam_branches/20091201/psModules/src/objects/pmSourcePlotMoments.c
r20937 r26787 37 37 #include "pmPSF.h" 38 38 #include "pmModel.h" 39 #include "pmDetections.h" 39 40 #include "pmSource.h" 40 41 #include "pmSourcePlots.h" … … 54 55 PS_ASSERT_PTR_NON_NULL(layout, false); 55 56 57 bool status; 56 58 Graphdata graphdata; 57 59 KapaSection section; … … 62 64 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT"); 63 65 64 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 65 if (sources == NULL) 66 return false; 66 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 67 if (detections == NULL) return false; 68 69 psArray *sources = detections->allSources; 70 if (sources == NULL) return false; 67 71 68 72 int kapa = pmKapaOpen (false); -
branches/eam_branches/20091201/psModules/src/objects/pmSourcePlotPSFModel.c
r20937 r26787 37 37 #include "pmPSF.h" 38 38 #include "pmModel.h" 39 #include "pmDetections.h" 39 40 #include "pmSource.h" 40 41 #include "pmSourcePlots.h" … … 56 57 PS_ASSERT_PTR_NON_NULL(layout, false); 57 58 59 bool status; 58 60 Graphdata graphdata; 59 61 KapaSection section; … … 64 66 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT"); 65 67 66 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 67 if (sources == NULL) 68 return false; 68 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 69 if (detections == NULL) return false; 70 71 psArray *sources = detections->allSources; 72 if (sources == NULL) return false; 69 73 70 74 int kapa = pmKapaOpen (false);
Note:
See TracChangeset
for help on using the changeset viewer.
