Changeset 11702 for trunk/psphot/src
- Timestamp:
- Feb 7, 2007, 5:52:32 PM (19 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 12 edited
-
models/pmModel_STRAIL.c (modified) (4 diffs)
-
models/pmModel_TEST1.c (modified) (5 diffs)
-
psphotBlendFit.c (modified) (1 diff)
-
psphotChoosePSF.c (modified) (4 diffs)
-
psphotEnsemblePSF.c (modified) (3 diffs)
-
psphotModelTest.c (modified) (4 diffs)
-
psphotOutput.c (modified) (1 diff)
-
psphotRadiusChecks.c (modified) (3 diffs)
-
psphotSkyReplace.c (modified) (1 diff)
-
psphotSourceFits.c (modified) (5 diffs)
-
psphotTestPSF.c (modified) (2 diffs)
-
psphotWeightBias.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/models/pmModel_STRAIL.c
r10414 r11702 333 333 334 334 default: 335 psAbort ("psModules.pmModel_GAUSS","invalid parameter %d for beta test", nParam);335 psAbort("invalid parameter %d for beta test", nParam); 336 336 } 337 337 if (fabs(beta[nParam]) > fabs(beta_lim)) { … … 353 353 354 354 default: 355 psAbort ("psModules.pmModel_GAUSS","invalid parameter %d for param min test", nParam);355 psAbort("invalid parameter %d for param min test", nParam); 356 356 } 357 357 if (params[nParam] < params_min) { … … 372 372 case 8: params_max = M_PI; break; 373 373 default: 374 psAbort ("psModules.pmModel_GAUSS","invalid parameter %d for param max test", nParam);374 psAbort("invalid parameter %d for param max test", nParam); 375 375 } 376 376 if (params[nParam] > params_max) { … … 380 380 return true; 381 381 default: 382 psAbort ("psModules.pmModel_GAUSS","invalid choice for limits");382 psAbort("invalid choice for limits"); 383 383 } 384 psAbort ("psModules.pmModel_GAUSS","should not reach here");384 psAbort("should not reach here"); 385 385 return false; 386 386 } -
trunk/psphot/src/models/pmModel_TEST1.c
r10426 r11702 76 76 case PM_PAR_SXY: beta_lim = 0.5; break; 77 77 default: 78 psAbort ("psModules.pmModel_GAUSS","invalid parameter %d for beta test", nParam);78 psAbort("invalid parameter %d for beta test", nParam); 79 79 } 80 80 if (fabs(beta[nParam]) > fabs(beta_lim)) { … … 93 93 case PM_PAR_SXY: params_min = -5.0; break; 94 94 default: 95 psAbort ("psModules.pmModel_GAUSS","invalid parameter %d for param min test", nParam);95 psAbort("invalid parameter %d for param min test", nParam); 96 96 } 97 97 if (params[nParam] < params_min) { … … 110 110 case PM_PAR_SXY: params_max = +5.0; break; 111 111 default: 112 psAbort ("psModules.pmModel_GAUSS","invalid parameter %d for param max test", nParam);112 psAbort("invalid parameter %d for param max test", nParam); 113 113 } 114 114 if (params[nParam] > params_max) { … … 118 118 return true; 119 119 default: 120 psAbort ("psModules.pmModel_GAUSS","invalid choice for limits");121 } 122 psAbort ("psModules.pmModel_GAUSS","should not reach here");120 psAbort("invalid choice for limits"); 121 } 122 psAbort("should not reach here"); 123 123 return false; 124 124 } … … 201 201 psF64 radius = axes.major * sqrt (2.0 * log(params->data.F32[PM_PAR_I0] / flux)); 202 202 203 if (isnan(radius)) psAbort ("psphot.model","error in code: never return invalid radius");204 if (radius < 0) psAbort ("psphot.model","error in code: never return invalid radius");203 if (isnan(radius)) psAbort("error in code: never return invalid radius"); 204 if (radius < 0) psAbort("error in code: never return invalid radius"); 205 205 206 206 return (radius); -
trunk/psphot/src/psphotBlendFit.c
r11381 r11702 27 27 char *region = psMetadataLookupStr (&status, recipe, "ANALYSIS_REGION"); 28 28 psRegion AnalysisRegion = psRegionForImage (readout->image, psRegionFromString (region)); 29 if (psRegionIsNaN (AnalysisRegion)) psAbort ("psphot","analysis region mis-defined");29 if (psRegionIsNaN (AnalysisRegion)) psAbort("analysis region mis-defined"); 30 30 31 31 for (int i = 0; i < sources->n; i++) { -
trunk/psphot/src/psphotChoosePSF.c
r11306 r11702 15 15 psf = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.PSF"); 16 16 if (psf != NULL) { 17 if (!psphotPSFstats (readout, recipe, psf)) psAbort ("psphotChoosePSF","cannot measure PSF shape terms");17 if (!psphotPSFstats (readout, recipe, psf)) psAbort("cannot measure PSF shape terms"); 18 18 return psf; 19 19 } … … 96 96 psList *list = NULL; 97 97 psMetadataItem *mdi = psMetadataLookup (recipe, "PSF_MODEL"); 98 if (mdi == NULL) psAbort ("psphotChoosePSF","missing PSF_MODEL selection");98 if (mdi == NULL) psAbort("missing PSF_MODEL selection"); 99 99 100 100 if (mdi->type == PS_DATA_STRING) { … … 102 102 psListAdd (list, PS_LIST_HEAD, mdi); 103 103 } else { 104 if (mdi->type != PS_DATA_METADATA_MULTI) psAbort ("psphotChoosePSF","missing PSF_MODEL selection");104 if (mdi->type != PS_DATA_METADATA_MULTI) psAbort("missing PSF_MODEL selection"); 105 105 list = psMemIncrRefCounter(mdi->data.list); 106 106 } … … 247 247 psFree (models); 248 248 249 if (!psphotPSFstats (readout, recipe, psf)) psAbort ("psphotChoosePSF","cannot measure PSF shape terms");249 if (!psphotPSFstats (readout, recipe, psf)) psAbort("cannot measure PSF shape terms"); 250 250 251 251 modelName = pmModelGetType (psf->type); -
trunk/psphot/src/psphotEnsemblePSF.c
r11166 r11702 34 34 psRegion AnalysisRegion = psRegionFromString (region); 35 35 AnalysisRegion = psRegionForImage (readout->image, AnalysisRegion); 36 if (psRegionIsNaN (AnalysisRegion)) psAbort ("psphot","analysis region mis-defined");36 if (psRegionIsNaN (AnalysisRegion)) psAbort("analysis region mis-defined"); 37 37 38 38 bool CONSTANT_PHOTOMETRIC_WEIGHTS = 39 39 psMetadataLookupBool(&status, recipe, "CONSTANT_PHOTOMETRIC_WEIGHTS"); 40 40 if (!status) { 41 psAbort( PS_FILE_LINE,"You must provide a value for the BOOL recipe CONSTANT_PHOTOMETRIC_WEIGHTS");41 psAbort("You must provide a value for the BOOL recipe CONSTANT_PHOTOMETRIC_WEIGHTS"); 42 42 } 43 43 int SKY_FIT_ORDER = psMetadataLookupS32(&status, recipe, "SKY_FIT_ORDER"); … … 161 161 162 162 default: 163 psAbort( PS_FILE_LINE,"Invalid SKY_FIT_ORDER %d\n", SKY_FIT_ORDER);163 psAbort("Invalid SKY_FIT_ORDER %d\n", SKY_FIT_ORDER); 164 164 break; 165 165 } … … 211 211 // assign linearly-fitted normalization 212 212 if (isnan(norm->data.F32[i])) { 213 psAbort ("psphot","ensemble source is nan");213 psAbort("ensemble source is nan"); 214 214 } 215 215 model->params->data.F32[PM_PAR_I0] = norm->data.F32[i]; -
trunk/psphot/src/psphotModelTest.c
r11172 r11702 33 33 if (fitMode == PM_SOURCE_FIT_PSF) { 34 34 char *psfFile = psMetadataLookupStr (&status, recipe, "PSF_INPUT_FILE"); 35 if (!status) psAbort ("psphotModelTest","PSF_INPUT_FILE not supplied");35 if (!status) psAbort("PSF_INPUT_FILE not supplied"); 36 36 psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, psfFile, FALSE); 37 37 psf = pmPSFfromMetadata (psfData); … … 45 45 psList *list = NULL; 46 46 psMetadataItem *mdi = psMetadataLookup (recipe, "PSF_MODEL"); 47 if (mdi == NULL) psAbort ("psphotModelTest","missing PSF_MODEL selection");47 if (mdi == NULL) psAbort("missing PSF_MODEL selection"); 48 48 if (mdi->type == PS_DATA_STRING) { 49 49 list = psListAlloc(NULL); 50 50 psListAdd (list, PS_LIST_HEAD, mdi); 51 51 } else { 52 if (mdi->type != PS_DATA_METADATA_MULTI) psAbort ("psphotChoosePSF","missing PSF_MODEL selection");52 if (mdi->type != PS_DATA_METADATA_MULTI) psAbort("missing PSF_MODEL selection"); 53 53 list = psMemIncrRefCounter(mdi->data.list); 54 54 } … … 59 59 } 60 60 modelType = pmModelSetType (modelName); 61 if (modelType < 0) psAbort ("fitsource","unknown model %s", modelName);61 if (modelType < 0) psAbort("unknown model %s", modelName); 62 62 } 63 63 … … 94 94 // find the local sky 95 95 status = pmSourceLocalSky (source, PS_STAT_SAMPLE_MEDIAN, INNER); 96 if (!status) psAbort ("fitsource","pmSourceLocalSky error");96 if (!status) psAbort("pmSourceLocalSky error"); 97 97 98 98 // get the source moments 99 99 status = pmSourceMoments (source, mRADIUS); 100 if (!status) psAbort ("fitsource","pmSourceLocalSky error");100 if (!status) psAbort("pmSourceLocalSky error"); 101 101 source->peak->value = source->moments->Peak; 102 102 -
trunk/psphot/src/psphotOutput.c
r11583 r11702 51 51 52 52 FILE *f = fopen (name, "w"); 53 if (f == NULL) psAbort ("psphot","can't open file");53 if (f == NULL) psAbort("can't open file"); 54 54 55 55 for (int i = 0; i < source->pixels->numRows; i++) { -
trunk/psphot/src/psphotRadiusChecks.c
r11174 r11702 40 40 model->radiusFit = (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING); 41 41 42 if (isnan(model->radiusFit)) psAbort ("apply_psf_model","error in radius");42 if (isnan(model->radiusFit)) psAbort("error in radius"); 43 43 44 44 if (source->mode & PM_SOURCE_MODE_SATSTAR) { … … 57 57 // set the fit radius based on the object flux limit and the model 58 58 model->radiusFit = (RADIUS_TYPE) (modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING); 59 if (isnan(model->radiusFit)) psAbort ("apply_psf_model","error in radius");59 if (isnan(model->radiusFit)) psAbort("error in radius"); 60 60 61 61 if (source->mode & PM_SOURCE_MODE_SATSTAR) { … … 91 91 // set the fit radius based on the object flux limit and the model 92 92 model->radiusFit = (RADIUS_TYPE) (modelRadiusEXT (model->params, EXT_FIT_NSIGMA*moments->dSky) + EXT_FIT_PADDING); 93 if (isnan(model->radiusFit)) psAbort (__func__,"error in radius");93 if (isnan(model->radiusFit)) psAbort("error in radius"); 94 94 95 95 // redefine the pixels if needed -
trunk/psphot/src/psphotSkyReplace.c
r10801 r11702 9 9 // find the currently selected readout 10 10 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT"); 11 if (readout == NULL) psAbort ("psphot","input not defined");11 if (readout == NULL) psAbort("input not defined"); 12 12 13 13 // select background pixels, from output background file, or create 14 14 pmReadout *background = pmFPAfileThisReadout (config->files, view, "PSPHOT.BACKGND"); 15 if (background == NULL) psAbort ("psphot","background not defined");15 if (background == NULL) psAbort("background not defined"); 16 16 17 17 // select the corresponding images -
trunk/psphot/src/psphotSourceFits.c
r11381 r11702 34 34 pmModel *PSF = pmModelCopy (source->modelPSF); 35 35 36 if (isnan(PSF->params->data.F32[PM_PAR_I0])) psAbort ("psphot","nan in blend fit primary");36 if (isnan(PSF->params->data.F32[PM_PAR_I0])) psAbort("nan in blend fit primary"); 37 37 38 38 x = PSF->params->data.F32[PM_PAR_XPOS]; … … 67 67 // these should never be invalid values 68 68 // XXX drop these tests eventually 69 if (isnan(model->params->data.F32[PM_PAR_I0])) psAbort ("psphot","nan in blend fit");70 if (isnan(model->params->data.F32[PM_PAR_XPOS])) psAbort ("psphot","nan in blend fit");71 if (isnan(model->params->data.F32[PM_PAR_YPOS])) psAbort ("psphot","nan in blend fit");69 if (isnan(model->params->data.F32[PM_PAR_I0])) psAbort("nan in blend fit"); 70 if (isnan(model->params->data.F32[PM_PAR_XPOS])) psAbort("nan in blend fit"); 71 if (isnan(model->params->data.F32[PM_PAR_YPOS])) psAbort("nan in blend fit"); 72 72 73 73 // add this blend to the list … … 145 145 // save the PSF model from the Ensemble fit 146 146 pmModel *PSF = pmModelCopy (source->modelPSF); 147 if (isnan(PSF->params->data.F32[1])) psAbort ("psphot","nan in psf fit");147 if (isnan(PSF->params->data.F32[1])) psAbort("nan in psf fit"); 148 148 149 149 // extend source radius as needed … … 328 328 PSF = source->modelPSF; 329 329 psphotCheckRadiusPSFBlend (readout, source, PSF, 8.0); 330 if (isnan(PSF->params->data.F32[1])) psAbort ("psphot","nan in dbl fit");330 if (isnan(PSF->params->data.F32[1])) psAbort("nan in dbl fit"); 331 331 332 332 modelSet = psArrayAlloc (2); … … 365 365 assert (EXT != NULL); 366 366 367 // if (isnan(EXT->params->data.F32[1])) psAbort ("psphot","nan in ext fit");367 // if (isnan(EXT->params->data.F32[1])) psAbort("nan in ext fit"); 368 368 369 369 psphotCheckRadiusEXT (readout, source, EXT); -
trunk/psphot/src/psphotTestPSF.c
r10096 r11702 74 74 // for this test, require a single model 75 75 psMetadataItem *mdi = psMetadataLookup (recipe, "PSF_MODEL"); 76 if (mdi == NULL) psAbort ("psphotChoosePSF","missing PSF_MODEL selection");77 if (mdi->type != PS_DATA_STRING) psAbort ("psphotChoosePSF","choose a single PSF_MODEL");76 if (mdi == NULL) psAbort("missing PSF_MODEL selection"); 77 if (mdi->type != PS_DATA_STRING) psAbort("choose a single PSF_MODEL"); 78 78 modelName = mdi->data.V; 79 79 … … 95 95 pmModelType type = pmModelSetType (modelName); 96 96 pmPSF *psf = pmPSFAlloc (type, poissonErrors, psfTrendMask); 97 if (psf == NULL) psAbort ("psphotTestPSF","unknown model");97 if (psf == NULL) psAbort("unknown model"); 98 98 99 99 FILE *f = fopen ("params.dat", "w"); -
trunk/psphot/src/psphotWeightBias.c
r11200 r11702 34 34 char *region = psMetadataLookupStr (&status, recipe, "ANALYSIS_REGION"); 35 35 psRegion AnalysisRegion = psRegionForImage (readout->image, psRegionFromString (region)); 36 if (psRegionIsNaN (AnalysisRegion)) psAbort ("psphot","analysis region mis-defined");36 if (psRegionIsNaN (AnalysisRegion)) psAbort("analysis region mis-defined"); 37 37 38 38 FILE *f = fopen ("bias.dat", "w"); 39 if (f == NULL) psAbort ("psphot","can't open output file");39 if (f == NULL) psAbort("can't open output file"); 40 40 41 41 for (int i = 0; i < sources->n; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
