Changeset 5992
- Timestamp:
- Jan 15, 2006, 8:23:13 AM (20 years ago)
- Location:
- branches/eam_rel9_p0/psModules/src/objects
- Files:
-
- 3 edited
-
pmObjects.c (modified) (10 diffs)
-
pmPSFtry.c (modified) (8 diffs)
-
pmPSFtry.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_p0/psModules/src/objects/pmObjects.c
r5958 r5992 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.5.4. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-01-1 0 04:46:03$8 * @version $Revision: 1.5.4.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-01-15 18:21:49 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 77 77 psFree(tmp->moments); 78 78 psFree(tmp->modelPSF); 79 psFree(tmp->model FLT);79 psFree(tmp->modelEXT); 80 80 psTrace(__func__, 4, "---- %s() end ----\n", __func__); 81 81 } … … 211 211 // XXX EAM : i changed this to match pmModelEval above, but see 212 212 // XXX EAM the note below in pmSourceContour 213 psF32 oldValue = pmModelEval(source->model FLT, source->pixels, subCol, subRow);213 psF32 oldValue = pmModelEval(source->modelEXT, source->pixels, subCol, subRow); 214 214 if (oldValue == level) { 215 215 psTrace(__func__, 4, "---- %s() end ----\n", __func__); … … 233 233 234 234 while (subCol != lastColumn) { 235 psF32 newValue = pmModelEval(source->model FLT, source->pixels, subCol, subRow);235 psF32 newValue = pmModelEval(source->modelEXT, source->pixels, subCol, subRow); 236 236 if (oldValue == level) { 237 237 psTrace(__func__, 4, "---- %s() end ----\n", __func__); … … 312 312 tmp->blends = NULL; 313 313 tmp->modelPSF = NULL; 314 tmp->model FLT = NULL;314 tmp->modelEXT = NULL; 315 315 tmp->type = PM_SOURCE_UNKNOWN; 316 316 tmp->mode = PM_SOURCE_DEFAULT; … … 1163 1163 1164 1164 int Nsat = 0; 1165 int N gal= 0;1165 int Next = 0; 1166 1166 int Nstar = 0; 1167 1167 int Npsf = 0; … … 1223 1223 } 1224 1224 1225 // likely unsaturated galaxy(too large to be stellar)1225 // likely unsaturated extended source (too large to be stellar) 1226 1226 if ((sigX > (clump.X + 3*clump.dX)) || (sigY > (clump.Y + 3*clump.dY))) { 1227 tmpSrc->type = PM_SOURCE_ GALAXY;1227 tmpSrc->type = PM_SOURCE_EXTENDED; 1228 1228 tmpSrc->mode = PM_SOURCE_DEFAULT; 1229 N gal++;1229 Next ++; 1230 1230 continue; 1231 1231 } … … 1261 1261 psTrace (".pmObjects.pmSourceRoughClass", 2, "Nstar: %3d\n", Nstar); 1262 1262 psTrace (".pmObjects.pmSourceRoughClass", 2, "Npsf: %3d\n", Npsf); 1263 psTrace (".pmObjects.pmSourceRoughClass", 2, "N gal: %3d\n", Ngal);1263 psTrace (".pmObjects.pmSourceRoughClass", 2, "Next: %3d\n", Next); 1264 1264 psTrace (".pmObjects.pmSourceRoughClass", 2, "Nsatstar: %3d\n", Nsatstar); 1265 1265 psTrace (".pmObjects.pmSourceRoughClass", 2, "Nsat: %3d\n", Nsat); … … 1471 1471 PS_ASSERT_PTR_NON_NULL(source->peak, false); 1472 1472 PS_ASSERT_PTR_NON_NULL(source->pixels, false); 1473 PS_ASSERT_PTR_NON_NULL(source->model FLT, false);1474 // XXX EAM : what is the purpose of modelPSF/model FLT?1473 PS_ASSERT_PTR_NON_NULL(source->modelEXT, false); 1474 // XXX EAM : what is the purpose of modelPSF/modelEXT? 1475 1475 1476 1476 // … … 1641 1641 PM_SOURCE_FIT_MODEL_TOLERANCE); 1642 1642 1643 // PSF model only fits first 4 parameters, FLT model fits all1643 // PSF model only fits first 4 parameters, EXT model fits all 1644 1644 if (PSF) { 1645 1645 paramMask = psVectorAlloc (params->n, PS_TYPE_U8); -
branches/eam_rel9_p0/psModules/src/objects/pmPSFtry.c
r5985 r5992 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.3.4. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-01-1 4 07:02:53 $7 * @version $Revision: 1.3.4.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-01-15 18:23:13 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 psFree (test->psf); 34 34 psFree (test->sources); 35 psFree (test->model FLT);35 psFree (test->modelEXT); 36 36 psFree (test->modelPSF); 37 37 psFree (test->metric); … … 53 53 test->psf = pmPSFAlloc (type); 54 54 test->sources = psMemIncrRefCounter(sources); 55 test->model FLT = psArrayAlloc (sources->n);55 test->modelEXT = psArrayAlloc (sources->n); 56 56 test->modelPSF = psArrayAlloc (sources->n); 57 57 test->metric = psVectorAlloc (sources->n, PS_TYPE_F64); … … 59 59 test->mask = psVectorAlloc (sources->n, PS_TYPE_U8); 60 60 61 for (int i = 0; i < test->model FLT->n; i++) {61 for (int i = 0; i < test->modelEXT->n; i++) { 62 62 test->mask->data.U8[i] = 0; 63 test->model FLT->data[i] = NULL;63 test->modelEXT->data[i] = NULL; 64 64 test->modelPSF->data[i] = NULL; 65 65 test->metric->data.F64[i] = 0; … … 87 87 float x; 88 88 float y; 89 int N flt = 0;89 int Next = 0; 90 90 int Npsf = 0; 91 91 … … 102 102 103 103 // set temporary object mask and fit object 104 // fit model as FLT, not PSF104 // fit model as EXT, not PSF 105 105 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PSPHOT_MASK_MARKED); 106 106 status = pmSourceFitModel (source, model, false); … … 109 109 // exclude the poor fits 110 110 if (!status) { 111 psfTry->mask->data.U8[i] = PSFTRY_MASK_ FLT_FAIL;111 psfTry->mask->data.U8[i] = PSFTRY_MASK_EXT_FAIL; 112 112 psFree (model); 113 113 continue; 114 114 } 115 psfTry->model FLT->data[i] = model;116 N flt ++;117 } 118 psLogMsg ("psphot.psftry", 4, "fit flt: %f sec for %d sources\n", psTimerMark ("fit"), sources->n);119 psTrace ("psphot.psftry", 3, "keeping %d of %d PSF candidates ( FLT)\n", Nflt, sources->n);115 psfTry->modelEXT->data[i] = model; 116 Next ++; 117 } 118 psLogMsg ("psphot.psftry", 4, "fit ext: %f sec for %d sources\n", psTimerMark ("fit"), sources->n); 119 psTrace ("psphot.psftry", 3, "keeping %d of %d PSF candidates (EXT)\n", Next, sources->n); 120 120 121 121 // stage 2: construct a psf (pmPSF) from this collection of model fits 122 pmPSFFromModels (psfTry->psf, psfTry->model FLT, psfTry->mask);122 pmPSFFromModels (psfTry->psf, psfTry->modelEXT, psfTry->mask); 123 123 124 124 // stage 3: refit with fixed shape parameters … … 130 130 131 131 pmSource *source = psfTry->sources->data[i]; 132 pmModel *model FLT = psfTry->modelFLT->data[i];132 pmModel *modelEXT = psfTry->modelEXT->data[i]; 133 133 134 134 // set shape for this model based on PSF 135 pmModel *modelPSF = pmModelFromPSF (model FLT, psfTry->psf);135 pmModel *modelPSF = pmModelFromPSF (modelEXT, psfTry->psf); 136 136 x = source->peak->x; 137 137 y = source->peak->y; -
branches/eam_rel9_p0/psModules/src/objects/pmPSFtry.h
r5958 r5992 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.2.4. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-01-1 0 04:46:03 $8 * @version $Revision: 1.2.4.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-01-15 18:23:13 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 * being tests, and contains an element to store the resulting psf 24 24 * representation. In addition, this structure carries the complete collection of 25 * FLT (floating parameter) and PSF (fixed parameter) model fits to each of the26 * sources model FLT and modelPSF. It also contains a mask which is set by the25 * EXT (floating parameter) and PSF (fixed parameter) model fits to each of the 26 * sources modelEXT and modelPSF. It also contains a mask which is set by the 27 27 * model fitting and psf fitting steps. For each model, the value of the quality 28 28 * metric is stored in the vector metric and the fitted instrumental magnitude is … … 48 48 pmPSF *psf; ///< Add comment. 49 49 psArray *sources; ///< pointers to the original sources 50 psArray *model FLT; ///< model fits, floating parameters50 psArray *modelEXT; ///< model fits, floating parameters 51 51 psArray *modelPSF; ///< model fits, PSF parameters 52 52 psVector *mask; ///< Add comment. … … 66 66 PSFTRY_MASK_CLEAR = 0x00, ///< Add comment. 67 67 PSFTRY_MASK_OUTLIER = 0x01, ///< 1: outlier in psf polynomial fit (provided by psPolynomials) 68 PSFTRY_MASK_ FLT_FAIL = 0x02, ///< 2: flt model failed to converge68 PSFTRY_MASK_EXT_FAIL = 0x02, ///< 2: ext model failed to converge 69 69 PSFTRY_MASK_PSF_FAIL = 0x04, ///< 3: psf model failed to converge 70 70 PSFTRY_MASK_BAD_PHOT = 0x08, ///< 4: invalid source photometry
Note:
See TracChangeset
for help on using the changeset viewer.
