Changeset 6751
- Timestamp:
- Mar 31, 2006, 4:47:20 PM (20 years ago)
- Location:
- branches/rel10_ifa/psModules/src/objects
- Files:
-
- 9 edited
-
pmGrowthCurve.c (modified) (4 diffs)
-
pmGrowthCurve.h (modified) (1 diff)
-
pmModel.c (modified) (3 diffs)
-
pmModel.h (modified) (2 diffs)
-
pmSourceFitModel.c (modified) (2 diffs)
-
pmSourceFitSet.c (modified) (2 diffs)
-
pmSourceIO_RAW.c (modified) (4 diffs)
-
pmSourcePhotometry.c (modified) (11 diffs)
-
pmSourcePhotometry.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/objects/pmGrowthCurve.c
r6556 r6751 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.1.4. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-0 3-09 03:14:23$7 * @version $Revision: 1.1.4.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-04-01 02:47:20 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 } 27 27 28 pmGrowthCurve *pmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 dRadius)28 pmGrowthCurve *pmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 refRadius) 29 29 { 30 30 … … 32 32 psMemSetDeallocator(growth, (psFreeFunc) pmGrowthCurveFree); 33 33 34 growth->radius = psVectorCreate (NULL, minRadius, maxRadius, dRadius, PS_TYPE_F32); 34 // fractional pixel radii are not well defined; use integer steps 35 growth->radius = psVectorCreate (NULL, minRadius, maxRadius, 1.0, PS_TYPE_F32); 35 36 growth->apMag = psVectorAlloc (growth->radius->n, PS_TYPE_F32); 36 37 37 38 // XXX may want to extend this to allow for a different refRadius; 38 growth->refRadius = maxRadius;39 growth->refRadius = refRadius; 39 40 growth->maxRadius = maxRadius; 40 41 growth->apLoss = 0.0; … … 111 112 112 113 if (n1 == 0) { 113 intn0 = psVectorBracket (index, key, FALSE);114 n0 = psVectorBracket (index, key, FALSE); 114 115 n1 = n0 + 1; 115 116 } -
branches/rel10_ifa/psModules/src/objects/pmGrowthCurve.h
r6556 r6751 15 15 pmGrowthCurve; 16 16 17 pmGrowthCurve *pmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 dRadius);17 pmGrowthCurve *pmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 refRadius); 18 18 int psVectorBracket (psVector *index, psF32 key, bool above); 19 19 psF32 psVectorInterpolate (psVector *index, psVector *value, psF32 key); -
branches/rel10_ifa/psModules/src/objects/pmModel.c
r6556 r6751 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 3-09 03:14:23$8 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-01 02:47:20 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 tmp->chisq = 0.0; 51 51 tmp->nIter = 0; 52 tmp->radius = 0;52 tmp->radiusTMP = 0; 53 53 tmp->status = PM_MODEL_UNTRIED; 54 54 … … 82 82 new->nIter = model->nIter; 83 83 new->status = model->status; 84 new->radius = model->radius;84 new->radiusTMP = model->radiusTMP; 85 85 86 86 for (int i = 0; i < new->params->n; i++) { -
branches/rel10_ifa/psModules/src/objects/pmModel.h
r6556 r6751 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 3-09 03:14:23$8 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-01 02:47:20 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 45 45 int nIter; ///< number of iterations to reach min 46 46 pmModelStatus status; ///< fit status 47 float radius ; ///< fit radius actually used47 float radiusTMP; ///< fit radius actually used 48 48 } 49 49 pmModel; -
branches/rel10_ifa/psModules/src/objects/pmSourceFitModel.c
r6556 r6751 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 3-09 03:14:23$8 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-01 02:47:20 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 117 117 psMinConstrain *constrain = psMinConstrainAlloc(); 118 118 119 // PSF model only fits first 4 parameters, EXT model fits all 119 // PSF model only fits x,y,Io, EXT model fits all (both skip sky) 120 paramMask = psVectorAlloc (params->n, PS_TYPE_U8); 121 paramMask->data.U8[0] = 1; 120 122 if (PSF) { 121 paramMask = psVectorAlloc (params->n, PS_TYPE_U8); 122 for (int i = 0; i < 4; i++) { 123 for (int i = 1; i < 4; i++) { 123 124 paramMask->data.U8[i] = 0; 124 125 } 125 126 for (int i = 4; i < paramMask->n; i++) { 126 127 paramMask->data.U8[i] = 1; 128 } 129 } else { 130 for (int i = 1; i < paramMask->n; i++) { 131 paramMask->data.U8[i] = 0; 127 132 } 128 133 } -
branches/rel10_ifa/psModules/src/objects/pmSourceFitSet.c
r6556 r6751 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 3-09 03:14:23$5 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-01 02:47:20 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 150 150 constrain->paramMin->data.F32[0] = oneParMin->data.F32[0]; 151 151 constrain->paramMax->data.F32[0] = oneParMax->data.F32[0]; 152 constrain->paramMask->data.U8[0] = 0; 152 153 // XXX all models skip the sky 154 constrain->paramMask->data.U8[0] = 1; 153 155 for (int i = 0; i < nSrc; i++) { 154 156 model = modelSet->data[i]; -
branches/rel10_ifa/psModules/src/objects/pmSourceIO_RAW.c
r6712 r6751 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 3-28 02:14:56$5 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-01 02:47:20 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 95 95 log10(model[0].chisq/model[0].nDOF), 96 96 source[0].moments->SN, 97 model[0].radius ,97 model[0].radiusTMP, 98 98 model[0].nDOF, 99 99 model[0].nIter); … … 125 125 if (source->type != PM_SOURCE_TYPE_EXTENDED) 126 126 continue; 127 model = pmSourceMagnitudes (source, NULL, 0.0);127 model = pmSourceMagnitudes (source, NULL, false, false); 128 128 if (model == NULL) 129 129 continue; … … 151 151 log10(model[0].chisq/model[0].nDOF), 152 152 source[0].moments->SN, 153 model[0].radius ,153 model[0].radiusTMP, 154 154 model[0].nDOF, 155 155 model[0].nIter); -
branches/rel10_ifa/psModules/src/objects/pmSourcePhotometry.c
r6556 r6751 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 3-09 03:14:23$5 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-01 02:47:20 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 55 55 // XXX EAM : masked region should be (optionally) elliptical 56 56 // XXX curve of growth is corrected to 57 pmModel *pmSourceMagnitudes (pmSource *source, pmPSF *psf, float apRadius)57 pmModel *pmSourceMagnitudes (pmSource *source, pmPSF *psf, bool growthCorr, bool apTrendCorr) 58 58 { 59 59 … … 62 62 float x, y; 63 63 float rflux; 64 float radius;65 64 float SN; 66 65 pmModel *model; … … 71 70 if (model == NULL) 72 71 return NULL; 73 radius = (apRadius > 0) ? apRadius : model->radius;74 72 isPSF = true; 75 73 break; … … 79 77 if (model == NULL) 80 78 return NULL; 81 radius = model->radius;82 79 isPSF = false; 83 80 break; … … 101 98 pmModelAdd (source->pixels, source->mask, model, false, false); 102 99 103 // set aperture mask circle to scaledradius104 psImageKeepCircle (source->mask, x, y, model->radius , "OR", PM_SOURCE_MASK_MARKED);100 // set aperture mask circle to model radius 101 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "OR", PM_SOURCE_MASK_MARKED); 105 102 106 103 // measure object model photometry … … 110 107 // measure object aperture photometry 111 108 if (SN > AP_MIN_SN) { 112 status = pmSourcePhotometryAper (&source->apMag, model, source->pixels, source->mask);109 status = pmSourcePhotometryAper (&source->apMag, model, source->pixels, source->mask); 113 110 } else { 114 111 source->apMag = 99.0; … … 118 115 if (isPSF && (psf != NULL)) { 119 116 if (SN > AP_MIN_SN) { 120 if ( psf->growth != NULL) {121 source->apMag += pmGrowthCurveCorrect (psf->growth, radius);117 if ((psf->growth != NULL) && growthCorr) { 118 source->apMag += pmGrowthCurveCorrect (psf->growth, model->radiusTMP); 122 119 } 123 rflux = pow (10.0, 0.4*source->psfMag); 124 source->apMag -= PS_SQR(model->radius)*rflux * psf->skyBias + psf->skySat / rflux; 125 } 126 source->psfMag += psPolynomial4DEval (psf->ApTrend, x, y, 0.0, 0.0); 120 if (apTrendCorr) { 121 rflux = pow (10.0, 0.4*source->psfMag); 122 source->apMag -= PS_SQR(model->radiusTMP)*rflux * psf->skyBias + psf->skySat / rflux; 123 } 124 } 125 if (apTrendCorr) { 126 source->psfMag += psPolynomial4DEval (psf->ApTrend, x, y, 0.0, 0.0); 127 } 127 128 } 128 129 129 130 // unmask aperture 130 psImageKeepCircle (source->mask, x, y, model->radius , "AND", ~PM_SOURCE_MASK_MARKED);131 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "AND", ~PM_SOURCE_MASK_MARKED); 131 132 132 133 // subtract object, leave local sky … … 168 169 } 169 170 171 # define DO_SKY 0 170 172 // return source aperture magnitude 171 173 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask) 172 174 { 173 174 175 float apSum = 0; 176 float sky = 0; 175 177 *apMag = 99.0; 176 178 … … 179 181 } 180 182 181 float sky = model->params->data.F32[0]; 183 if (DO_SKY) { 184 sky = model->params->data.F32[0]; 185 } else { 186 sky = 0; 187 } 182 188 183 189 // measure apMag … … 191 197 if (apSum <= 0) 192 198 return false; 199 193 200 *apMag = -2.5*log10(apSum); 194 195 201 return (true); 196 202 } -
branches/rel10_ifa/psModules/src/objects/pmSourcePhotometry.h
r6556 r6751 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1.2. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 3-09 03:14:23$5 * @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-01 02:47:20 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 32 32 bool pmSourcePhotometryAper( 33 float *apMag,///< aperture flux magnitude33 float *apMag, ///< aperture flux magnitude 34 34 pmModel *model, ///< model used for photometry 35 35 psImage *image, ///< image pixels to be used … … 37 37 ); 38 38 39 pmModel *pmSourceMagnitudes (pmSource *source, pmPSF *psf, float apRadius);39 pmModel *pmSourceMagnitudes (pmSource *source, pmPSF *psf, bool growthCorr, bool apTrendCorr); 40 40 float pmSourceCrossProduct (pmSource *Mi, pmSource *Mj); 41 41 float pmSourceCrossWeight (pmSource *Mi, pmSource *Mj);
Note:
See TracChangeset
for help on using the changeset viewer.
