Changeset 36314 for branches/eam_branches/ipp-20130904/psModules
- Timestamp:
- Nov 26, 2013, 5:51:56 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904/psModules/src/objects
- Files:
-
- 5 edited
-
pmModel.c (modified) (1 diff)
-
pmPCM_MinimizeChisq.c (modified) (1 diff)
-
pmPCMdata.c (modified) (1 diff)
-
pmSourceFitPCM.c (modified) (2 diffs)
-
pmSourcePhotometry.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psModules/src/objects/pmModel.c
r34498 r36314 217 217 // the options allow us to modify various aspects of the model 218 218 if (mode & PM_MODEL_OP_NORM) { 219 // if we are including the sky, renormalizing should force use to normalized down the sky flux 220 params->data.F32[PM_PAR_SKY] /= params->data.F32[PM_PAR_I0]; 219 221 params->data.F32[PM_PAR_I0] = 1.0; 220 222 } 221 223 if (!(mode & PM_MODEL_OP_SKY)) { 222 224 params->data.F32[PM_PAR_SKY] = 0.0; 223 } 225 } 224 226 if (mode & PM_MODEL_OP_CENTER) { 225 227 params->data.F32[PM_PAR_XPOS] = image->col0 + 0.5*image->numCols; -
branches/eam_branches/ipp-20130904/psModules/src/objects/pmPCM_MinimizeChisq.c
r36311 r36314 135 135 } 136 136 137 if ( 1) {137 if (0) { 138 138 fprintf (stderr, "%d : ", min->iter); 139 139 for (int ti = 0; ti < params->n; ti++) { -
branches/eam_branches/ipp-20130904/psModules/src/objects/pmPCMdata.c
r36307 r36314 597 597 598 598 // modelFlux always has unity normalization (I0 = 1.0) 599 pmModelAdd (source->modelFlux, source->maskObj, model, PM_MODEL_OP_FULL | PM_MODEL_OP_NORM, maskVal); 599 // pmModelAdd (source->modelFlux, source->maskObj, model, PM_MODEL_OP_FULL | PM_MODEL_OP_NORM, maskVal); 600 pmModelAdd (source->modelFlux, NULL, model, PM_MODEL_OP_FULL | PM_MODEL_OP_SKY | PM_MODEL_OP_NORM, maskVal); 600 601 601 602 // convolve the model image with the PSF -
branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceFitPCM.c
r36085 r36314 51 51 # define TIMING 0 52 52 53 bool pmSourceChisqModelFlux (pmSource *source, pmModel *model, psImageMaskType maskVal); 54 53 55 bool pmSourceFitPCM (pmPCMdata *pcm, pmSource *source, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, psImageMaskType markVal, int psfSize) { 54 56 … … 113 115 } else { 114 116 // xxx this is wrong because it does not convolve with the psf 115 pmSourceChisqUnsubtracted (source, pcm->modelConv, maskVal); 117 pmPCMMakeModel (source, pcm->modelConv, maskVal, psfSize); 118 pmSourceChisqModelFlux (source, pcm->modelConv, maskVal); 116 119 } 117 120 if (TIMING) { t4 = psTimerMark ("pmSourceFitPCM"); } -
branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourcePhotometry.c
r34498 r36314 902 902 } 903 903 904 bool pmSourceChisqModelFlux (pmSource *source, pmModel *model, psImageMaskType maskVal) 905 { 906 PS_ASSERT_PTR_NON_NULL(source, false); 907 PS_ASSERT_PTR_NON_NULL(model, false); 908 909 float dC = 0.0; 910 int Npix = 0; 911 912 psVector *params = model->params; 913 psImage *image = source->pixels; 914 psImage *modelFlux = source->modelFlux; 915 psImage *mask = source->maskObj; 916 psImage *variance = source->variance; 917 918 float Io = params->data.F32[PM_PAR_I0]; 919 920 for (int iy = 0; iy < image->numRows; iy++) { 921 for (int ix = 0; ix < image->numCols; ix++) { 922 923 // skip pixels which are masked 924 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal) continue; 925 926 if (variance->data.F32[iy][ix] <= 0) continue; 927 928 dC += PS_SQR (image->data.F32[iy][ix] - Io*modelFlux->data.F32[iy][ix]) / variance->data.F32[iy][ix]; 929 Npix ++; 930 } 931 } 932 model->nPix = Npix; 933 model->nDOF = Npix - model->nPar; 934 model->chisq = dC; 935 model->chisqNorm = dC / model->nDOF; 936 937 return (true); 938 } 939 904 940 double pmSourceModelWeight(const pmSource *Mi, int term, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal) 905 941 {
Note:
See TracChangeset
for help on using the changeset viewer.
