Changeset 15418
- Timestamp:
- Oct 29, 2007, 2:59:23 PM (19 years ago)
- Location:
- branches/eam_branch_20071023/psModules/src/objects
- Files:
-
- 37 edited
-
pmGrowthCurve.h (modified) (2 diffs)
-
pmModel.c (modified) (4 diffs)
-
pmModel.h (modified) (2 diffs)
-
pmModelClass.c (modified) (9 diffs)
-
pmModelClass.h (modified) (2 diffs)
-
pmModelGroup.c (modified) (2 diffs)
-
pmModelGroup.h (modified) (2 diffs)
-
pmModelUtils.c (modified) (4 diffs)
-
pmPSF.c (modified) (10 diffs)
-
pmPSF.h (modified) (2 diffs)
-
pmPSF_IO.c (modified) (15 diffs)
-
pmPSFtry.c (modified) (4 diffs)
-
pmPSFtry.h (modified) (2 diffs)
-
pmPeaks.c (modified) (4 diffs)
-
pmPeaks.h (modified) (2 diffs)
-
pmResiduals.c (modified) (2 diffs)
-
pmResiduals.h (modified) (2 diffs)
-
pmSource.c (modified) (8 diffs)
-
pmSource.h (modified) (4 diffs)
-
pmSourceContour.c (modified) (2 diffs)
-
pmSourceFitSet.c (modified) (7 diffs)
-
pmSourceFitSet.h (modified) (2 diffs)
-
pmSourceIO.c (modified) (19 diffs)
-
pmSourceIO_CMP.c (modified) (4 diffs)
-
pmSourceIO_OBJ.c (modified) (2 diffs)
-
pmSourceIO_PS1_DEV_0.c (modified) (3 diffs)
-
pmSourceIO_RAW.c (modified) (6 diffs)
-
pmSourceIO_SMPDATA.c (modified) (3 diffs)
-
pmSourceIO_SX.c (modified) (2 diffs)
-
pmSourcePhotometry.c (modified) (14 diffs)
-
pmSourcePlotApResid.c (modified) (3 diffs)
-
pmSourcePlotMoments.c (modified) (2 diffs)
-
pmSourcePlotPSFModel.c (modified) (2 diffs)
-
pmSourcePlots.c (modified) (3 diffs)
-
pmSourcePlots.h (modified) (2 diffs)
-
pmSourceUtils.c (modified) (2 diffs)
-
pmTrend2D.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071023/psModules/src/objects/pmGrowthCurve.h
r11253 r15418 4 4 * @author EAM, IfA 5 5 * 6 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $7 * @date $Date: 2007- 01-24 02:54:15$6 * @version $Revision: 1.7.22.1 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-10-30 00:59:23 $ 8 8 * Copyright 2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 27 27 pmGrowthCurve; 28 28 29 bool psMemCheckGrowthCurve(psPtr ptr); 30 29 31 pmGrowthCurve *pmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 refRadius); 30 32 psF32 pmGrowthCurveCorrect (pmGrowthCurve *growth, psF32 radius); -
branches/eam_branch_20071023/psModules/src/objects/pmModel.c
r15398 r15418 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.15.6. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-10- 29 01:37:48$8 * @version $Revision: 1.15.6.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 46 46 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__); 47 47 48 pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel));49 psMemSetDeallocator(tmp, (psFreeFunc) modelFree);50 51 48 pmModelClass *class = pmModelClassSelect (type); 52 49 if (class == NULL) { … … 54 51 return(NULL); 55 52 } 53 54 pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel)); 55 psMemSetDeallocator(tmp, (psFreeFunc) modelFree); 56 56 57 57 tmp->type = type; … … 89 89 } 90 90 91 bool psMemCheckModel(psPtr ptr) 92 { 93 PS_ASSERT_PTR(ptr, false); 94 return ( psMemGetDeallocator(ptr) == (psFreeFunc) modelFree); 95 } 96 91 97 // copy model to a new structure 92 98 pmModel *pmModelCopy (pmModel *model) 93 99 { 100 PS_ASSERT_PTR_NON_NULL(model, NULL); 94 101 95 102 pmModel *new = pmModelAlloc (model->type); -
branches/eam_branch_20071023/psModules/src/objects/pmModel.h
r14652 r15418 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 08-24 00:11:02$7 * @version $Revision: 1.12.8.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-10-30 00:59:23 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 122 122 */ 123 123 pmModel *pmModelAlloc(pmModelType type); 124 bool psMemCheckModel(psPtr ptr); 124 125 125 126 // copy model to a new structure -
branches/eam_branch_20071023/psModules/src/objects/pmModelClass.c
r14938 r15418 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-21 00:09:05$8 * @version $Revision: 1.3.6.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 57 57 static void ModelClassFree (pmModelClass *modelClass) 58 58 { 59 60 59 if (modelClass == NULL) 61 60 return; … … 70 69 } 71 70 71 bool psMemCheckModelClass(psPtr ptr) 72 { 73 PS_ASSERT_PTR(ptr, false); 74 return ( psMemGetDeallocator(ptr) == (psFreeFunc) ModelClassFree); 75 } 76 72 77 void pmModelClassAdd (pmModelClass *model) 73 78 { 74 79 if (models == NULL) { 75 pmModelClassInit ();80 pmModelClassInit(); 76 81 } 77 82 … … 85 90 { 86 91 // if we do not need to init, return false; 87 if (models != NULL) 92 if (models != NULL) { 88 93 return false; 94 } 89 95 90 96 int Nnew = sizeof (defaultModels) / sizeof (pmModelClass); … … 100 106 pmModelClass *pmModelClassSelect (pmModelType type) 101 107 { 108 if (models == NULL) { 109 pmModelClassInit(); 110 } 111 102 112 if ((type < 0) || (type >= Nmodels)) { 103 113 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); … … 111 121 psFree (models); 112 122 models = NULL; 123 Nmodels = 0; 113 124 return; 114 125 } … … 116 127 psS32 pmModelClassParameterCount (pmModelType type) 117 128 { 129 if (models == NULL) { 130 pmModelClassInit(); 131 } 132 118 133 if ((type < 0) || (type >= Nmodels)) { 119 134 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); … … 125 140 psS32 pmModelClassGetType (char *name) 126 141 { 142 if (models == NULL) { 143 pmModelClassInit(); 144 } 145 127 146 for (int i = 0; i < Nmodels; i++) { 128 147 if (!strcmp(models[i].name, name)) { … … 135 154 char *pmModelClassGetName (pmModelType type) 136 155 { 156 if (models == NULL) { 157 pmModelClassInit(); 158 } 159 137 160 if ((type < 0) || (type >= Nmodels)) { 138 161 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); -
branches/eam_branch_20071023/psModules/src/objects/pmModelClass.h
r14652 r15418 21 21 * @author EAM, IfA 22 22 * 23 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $24 * @date $Date: 2007- 08-24 00:11:02$23 * @version $Revision: 1.2.8.1 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2007-10-30 00:59:23 $ 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 26 26 */ … … 49 49 pmModelClass *pmModelClassAlloc (int nModels); 50 50 51 // 52 bool psMemCheckModelClass(psPtr ptr); 53 51 54 // initialize the internal (static) model class with the default models 52 55 bool pmModelClassInit (void); -
branches/eam_branch_20071023/psModules/src/objects/pmModelGroup.c
r14652 r15418 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 08-24 00:11:02$8 * @version $Revision: 1.18.8.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 68 68 } 69 69 70 bool psMemCheckModelGroup(psPtr ptr) 71 { 72 PS_ASSERT_PTR(ptr, false); 73 return ( psMemGetDeallocator(ptr) == (psFreeFunc) ModelGroupFree); 74 } 75 70 76 void pmModelGroupAdd (pmModelGroup *model) 71 77 { -
branches/eam_branch_20071023/psModules/src/objects/pmModelGroup.h
r14652 r15418 21 21 * @author EAM, IfA 22 22 * 23 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $24 * @date $Date: 2007- 08-24 00:11:02$23 * @version $Revision: 1.8.8.1 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2007-10-30 00:59:23 $ 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 26 26 */ … … 78 78 pmModelGroup *pmModelGroupAlloc (int nModels); 79 79 80 bool psMemCheckModelGroup(psPtr ptr); 81 80 82 // initialize the internal (static) model group with the default models 81 83 bool pmModelGroupInit (void); -
branches/eam_branch_20071023/psModules/src/objects/pmModelUtils.c
r14938 r15418 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 09-21 00:04:30$7 * @version $Revision: 1.3.6.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-10-30 00:59:23 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 36 36 pmModel *pmModelFromPSF (pmModel *modelEXT, pmPSF *psf) 37 37 { 38 PS_ASSERT_PTR_NON_NULL(psf, NULL); 39 PS_ASSERT_PTR_NON_NULL(modelEXT, NULL); 40 38 41 // allocate a new pmModel to hold the PSF version 39 42 pmModel *modelPSF = pmModelAlloc (psf->type); … … 53 56 // instantiate a model for the PSF at this location with peak flux 54 57 // NOTE: psf and (Xo,Yo) are defined wrt chip coordinates 55 pmModel *pmModelFromPSFforXY (pmPSF *psf, float Xo, float Yo, float Io) {56 57 assert (psf);58 pmModel *pmModelFromPSFforXY (pmPSF *psf, float Xo, float Yo, float Io) 59 { 60 PS_ASSERT_PTR_NON_NULL(psf, NULL); 58 61 59 62 // allocate a new pmModel to hold the PSF version … … 75 78 // set this model to have the requested flux 76 79 bool pmModelSetFlux (pmModel *model, float flux) { 80 PS_ASSERT_PTR_NON_NULL(model, NULL); 81 PS_ASSERT_PTR_NON_NULL(model->params, NULL); 77 82 78 83 // set Io to be 1.0 -
branches/eam_branch_20071023/psModules/src/objects/pmPSF.c
r15089 r15418 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-29 00:15:32$8 * @version $Revision: 1.32.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 81 81 static void pmPSFFree (pmPSF *psf) 82 82 { 83 84 if (psf == NULL) 83 if (psf == NULL) { 85 84 return; 85 } 86 86 87 87 psFree (psf->ChiTrend); … … 205 205 } 206 206 207 bool psMemCheckPSF(psPtr ptr) 208 { 209 PS_ASSERT_PTR(ptr, false); 210 return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmPSFFree); 211 } 212 213 214 207 215 // the PSF models the \sigma_{xy} variation of the elliptical contour as a function of position in the image with a 208 216 // polynomial. an individual object has a contour of the form (x^2/2sx^2) + (y^2/2sy^2) + sxy*x*y … … 217 225 double pmPSF_SXYfromModel (psF32 *modelPar) 218 226 { 227 PS_ASSERT_PTR_NON_NULL(modelPar, NAN); 219 228 220 229 double SXX = modelPar[PM_PAR_SXX]; … … 229 238 double pmPSF_SXYtoModel (psF32 *fittedPar) 230 239 { 240 PS_ASSERT_PTR_NON_NULL(fittedPar, NAN); 231 241 232 242 double SXX = fittedPar[PM_PAR_SXX]; … … 247 257 bool pmPSF_FitToModel (psF32 *fittedPar, float minMinorAxis) 248 258 { 259 PS_ASSERT_PTR_NON_NULL(fittedPar, false); 260 249 261 psEllipsePol pol; 250 262 … … 272 284 psEllipsePol pmPSF_ModelToFit (psF32 *modelPar) 273 285 { 286 // XXX: must assert non-NULL input parameter 287 // PS_ASSERT_PTR_NON_NULL(modelPar, NAN); 288 274 289 psEllipseShape shape; 275 290 … … 289 304 psEllipseShape shape; 290 305 psEllipseAxes axes; 306 // XXX: must assert non-NULL input parameter 307 // PS_ASSERT_PTR_NON_NULL(modelPar, axes); 291 308 292 309 shape.sx = modelPar[PM_PAR_SXX] / M_SQRT2; … … 310 327 bool pmPSF_AxesToModel (psF32 *modelPar, psEllipseAxes axes) 311 328 { 329 PS_ASSERT_PTR_NON_NULL(modelPar, false); 330 312 331 if ((axes.major <= 0) || (axes.minor <= 0)) { 313 332 modelPar[PM_PAR_SXX] = 0.0; … … 374 393 bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psMaskType maskVal, psMaskType mark) 375 394 { 395 PS_ASSERT_PTR_NON_NULL(readout, false); 396 PS_ASSERT_PTR_NON_NULL(readout->image, false); 376 397 377 398 // bool status; -
branches/eam_branch_20071023/psModules/src/objects/pmPSF.h
r15016 r15418 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-25 22:05:05$8 * @version $Revision: 1.18.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 11 11 */ … … 87 87 * 88 88 */ 89 89 90 pmPSF *pmPSFAlloc (pmPSFOptions *options); 90 pmPSFOptions *pmPSFOptionsAlloc (); 91 bool psMemCheckPSF(psPtr ptr); 92 pmPSFOptions *pmPSFOptionsAlloc(); 91 93 92 94 double pmPSF_SXYfromModel (psF32 *modelPar); -
branches/eam_branch_20071023/psModules/src/objects/pmPSF_IO.c
r15359 r15418 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.27.2. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-10- 23 20:54:53 $8 * @version $Revision: 1.27.2.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 bool pmPSFmodelCheckDataStatusForView (const pmFPAview *view, const pmFPAfile *file) 51 51 { 52 PS_ASSERT_PTR_NON_NULL(view, false); 53 PS_ASSERT_PTR_NON_NULL(file, false); 54 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 55 PS_ASSERT_PTR_NON_NULL(file->fpa->chips, false); 56 52 57 pmFPA *fpa = file->fpa; 53 58 … … 61 66 } 62 67 pmChip *chip = fpa->chips->data[view->chip]; 68 PS_ASSERT_PTR_NON_NULL(chip, false); 69 PS_ASSERT_PTR_NON_NULL(chip->cells, false); 63 70 64 71 if (view->cell == -1) { … … 75 82 76 83 bool pmPSFmodelCheckDataStatusForFPA (const pmFPA *fpa) { 84 85 PS_ASSERT_PTR_NON_NULL(fpa, false); 86 PS_ASSERT_PTR_NON_NULL(fpa->chips, false); 77 87 78 88 for (int i = 0; i < fpa->chips->n; i++) { … … 85 95 86 96 bool pmPSFmodelCheckDataStatusForChip (const pmChip *chip) { 97 PS_ASSERT_PTR_NON_NULL(chip, false); 87 98 88 99 bool status; … … 93 104 } 94 105 95 bool pmPSFmodelWriteForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) { 106 bool pmPSFmodelWriteForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 107 { 108 PS_ASSERT_PTR_NON_NULL(view, false); 109 PS_ASSERT_PTR_NON_NULL(file, false); 110 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 111 PS_ASSERT_PTR_NON_NULL(file->fpa->chips, false); 96 112 97 113 pmFPA *fpa = file->fpa; … … 125 141 bool pmPSFmodelWriteFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 126 142 { 143 PS_ASSERT_PTR_NON_NULL(view, false); 144 PS_ASSERT_PTR_NON_NULL(fpa, false); 145 PS_ASSERT_PTR_NON_NULL(fpa->chips, false); 127 146 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 128 147 *thisView = *view; … … 144 163 bool pmPSFmodelWriteChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 145 164 { 165 PS_ASSERT_PTR_NON_NULL(view, false); 166 PS_ASSERT_PTR_NON_NULL(chip, false); 167 146 168 if (!pmPSFmodelWrite (chip->analysis, view, file, config)) { 147 169 psError(PS_ERR_IO, false, "Failed to write PSF for chip"); … … 161 183 bool pmPSFmodelWrite (psMetadata *analysis, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 162 184 { 185 PS_ASSERT_PTR_NON_NULL(view, false); 186 PS_ASSERT_PTR_NON_NULL(file, false); 187 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 163 188 bool status; 164 189 pmHDU *hdu; … … 449 474 450 475 // if this file needs to have a PHU written out, write one 451 bool pmPSFmodelWritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) { 452 476 bool pmPSFmodelWritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 477 { 478 PS_ASSERT_PTR_NON_NULL(view, false); 479 PS_ASSERT_PTR_NON_NULL(file, false); 480 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 453 481 // not needed if already written 454 482 if (file->wrote_phu) return true; … … 493 521 bool pmPSFmodelReadForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 494 522 { 523 PS_ASSERT_PTR_NON_NULL(view, false); 524 PS_ASSERT_PTR_NON_NULL(file, false); 525 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 495 526 496 527 pmFPA *fpa = file->fpa; … … 516 547 bool pmPSFmodelReadFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 517 548 { 549 PS_ASSERT_PTR_NON_NULL(view, false); 550 PS_ASSERT_PTR_NON_NULL(file, false); 551 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 552 518 553 bool success = true; // Was everything successful? 519 554 for (int i = 0; i < fpa->chips->n; i++) { … … 527 562 bool pmPSFmodelReadChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 528 563 { 564 PS_ASSERT_PTR_NON_NULL(view, false); 565 PS_ASSERT_PTR_NON_NULL(file, false); 566 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 567 529 568 if (!pmPSFmodelRead (chip->analysis, view, file, config)) { 530 569 psError(PS_ERR_IO, false, "Failed to write PSF for chip"); … … 538 577 bool pmPSFmodelRead (psMetadata *analysis, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 539 578 { 579 PS_ASSERT_PTR_NON_NULL(view, false); 580 PS_ASSERT_PTR_NON_NULL(file, false); 581 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 582 540 583 bool status; 541 584 char *rule = NULL; … … 762 805 } 763 806 764 // create a psMetadata representation (human-readable) of a psf model765 807 // XXX pmPSF to/from Metadata functions were defined for 1.22 and earlier, but were dropped -
branches/eam_branch_20071023/psModules/src/objects/pmPSFtry.c
r15254 r15418 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.49 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007-10- 09 19:26:25$7 * @version $Revision: 1.49.2.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-10-30 00:59:23 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 81 81 } 82 82 83 bool psMemCheckPSFtry(psPtr ptr) 84 { 85 PS_ASSERT_PTR(ptr, false); 86 return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmPSFtryFree); 87 } 88 89 83 90 // build a pmPSFtry for the given model: 84 91 // - fit each source with the free-floating model … … 249 256 bool pmPSFtryMetric (pmPSFtry *psfTry, float RADIUS) 250 257 { 258 PS_ASSERT_PTR_NON_NULL(psfTry, false); 259 PS_ASSERT_PTR_NON_NULL(psfTry->sources, false); 260 251 261 // the measured (aperture - fit) magnitudes (dA == psfTry->metric) 252 262 // depend on both the true ap-fit (dAo) and the bias in the sky measurement: … … 346 356 bool pmPSFFromPSFtry (pmPSFtry *psfTry) 347 357 { 358 PS_ASSERT_PTR_NON_NULL(psfTry, false); 359 PS_ASSERT_PTR_NON_NULL(psfTry->sources, false); 360 348 361 pmPSF *psf = psfTry->psf; 349 362 -
branches/eam_branch_20071023/psModules/src/objects/pmPSFtry.h
r15016 r15418 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-25 22:05:05$8 * @version $Revision: 1.16.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 11 11 */ … … 78 78 * 79 79 */ 80 80 81 pmPSFtry *pmPSFtryAlloc (psArray *sources, pmPSFOptions *options); 82 bool psMemCheckPSFtry(psPtr ptr); 81 83 82 84 /** pmPSFtryModel() -
branches/eam_branch_20071023/psModules/src/objects/pmPeaks.c
r15039 r15418 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-27 03:35:29$8 * @version $Revision: 1.17.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 150 150 } 151 151 152 // XXX: Get rid of this: 152 153 bool pmPeakTest(const psPtr ptr) 153 154 { … … 155 156 } 156 157 158 bool psMemCheckPeak(psPtr ptr) 159 { 160 PS_ASSERT_PTR(ptr, false); 161 return ( psMemGetDeallocator(ptr) == (psFreeFunc) peakFree); 162 } 163 164 157 165 // psSort comparison function for peaks 166 // XXX: Add error-checking for NULL args 158 167 int pmPeaksCompareAscend (const void **a, const void **b) 159 168 { … … 177 186 178 187 // psSort comparison function for peaks 188 // XXX: Add error-checking for NULL args 179 189 int pmPeaksCompareDescend (const void **a, const void **b) 180 190 { -
branches/eam_branch_20071023/psModules/src/objects/pmPeaks.h
r15039 r15418 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $13 * @date $Date: 2007- 09-27 03:35:29$12 * @version $Revision: 1.8.2.1 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2007-10-30 00:59:23 $ 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 15 */ … … 75 75 76 76 bool pmPeakTest(const psPtr ptr); 77 bool psMemCheckPeak(psPtr ptr); 77 78 78 79 /** pmPeaksInVector() -
branches/eam_branch_20071023/psModules/src/objects/pmResiduals.c
r12949 r15418 4 4 * 5 5 * @author EAM, IfA 6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $7 * @date $Date: 2007- 04-21 19:47:14$6 * @version $Revision: 1.2.16.1 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-10-30 00:59:23 $ 8 8 * Copyright 2004 IfA, University of Hawaii 9 9 */ … … 51 51 return resid; 52 52 } 53 54 bool psMemCheckResiduals(psPtr ptr) 55 { 56 PS_ASSERT_PTR(ptr, false); 57 return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmResidualsFree); 58 } 59 -
branches/eam_branch_20071023/psModules/src/objects/pmResiduals.h
r12949 r15418 4 4 * 5 5 * @author EAM, IfA 6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $7 * @date $Date: 2007- 04-21 19:47:14$6 * @version $Revision: 1.2.16.1 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-10-30 00:59:23 $ 8 8 * Copyright 2004 IfA, University of Hawaii 9 9 */ … … 29 29 30 30 pmResiduals *pmResidualsAlloc (int xSize, int ySize, int xBin, int yBin); 31 bool psMemCheckResiduals(psPtr ptr); 31 32 32 33 /// @} -
branches/eam_branch_20071023/psModules/src/objects/pmSource.c
r15232 r15418 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007-10- 06 02:29:47$8 * @version $Revision: 1.40.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 77 77 } 78 78 79 bool psMemCheckSource(psPtr ptr) 80 { 81 PS_ASSERT_PTR(ptr, false); 82 return ( psMemGetDeallocator(ptr) == (psFreeFunc) sourceFree); 83 } 84 79 85 /****************************************************************************** 80 86 pmSourceAlloc(): Allocate the pmSource structure and initialize its members 81 87 to NULL. 82 88 *****************************************************************************/ 89 83 90 pmSource *pmSourceAlloc() 84 91 { … … 132 139 pmSource *pmSourceCopy(pmSource *in) 133 140 { 141 if (in == NULL) { 142 return(NULL); 143 } 134 144 // this copy is used to allow multiple fit attempts on the 135 145 // same object. the pixels, weight, and mask arrays all point to … … 139 149 140 150 // this is actually the same peak as the original, is this the correct way to handle this? 141 source->peak = pmPeakAlloc (in->peak->x, in->peak->y, in->peak->value, in->peak->type); 142 source->peak->xf = in->peak->xf; 143 source->peak->yf = in->peak->yf; 144 source->peak->flux = in->peak->flux; 145 source->peak->SN = in->peak->SN; 151 if (in->peak != NULL) { 152 source->peak = pmPeakAlloc (in->peak->x, in->peak->y, in->peak->value, in->peak->type); 153 source->peak->xf = in->peak->xf; 154 source->peak->yf = in->peak->yf; 155 source->peak->flux = in->peak->flux; 156 source->peak->SN = in->peak->SN; 157 } 146 158 147 159 // copy the values in the moments structure 148 source->moments = pmMomentsAlloc(); 149 *source->moments = *in->moments; 160 if (in->moments != NULL) { 161 source->moments = pmMomentsAlloc(); 162 *source->moments = *in->moments; 163 } 150 164 151 165 // These images are all views to the parent. 152 166 // We want a new view, but pointing at the same pixels. 153 source->pixels = psImageCopyView (NULL, in->pixels);154 source->weight = psImageCopyView (NULL, in->weight);155 source->maskView = psImageCopyView (NULL, in->maskView);167 source->pixels = psImageCopyView(NULL, in->pixels); 168 source->weight = psImageCopyView(NULL, in->weight); 169 source->maskView = psImageCopyView(NULL, in->maskView); 156 170 157 171 // the maskObj is a unique mask array; create a new mask image … … 173 187 psF32 Radius) 174 188 { 189 PS_ASSERT_PTR_NON_NULL(mySource, false); 190 PS_ASSERT_PTR_NON_NULL(readout, false); 191 PS_ASSERT_PTR_NON_NULL(readout->image, false); 192 PS_ASSERT_INT_POSITIVE(Radius, false); 193 175 194 psRegion srcRegion; 176 195 … … 200 219 psF32 Radius) 201 220 { 221 PS_ASSERT_PTR_NON_NULL(mySource, false); 222 PS_ASSERT_PTR_NON_NULL(readout, false); 223 PS_ASSERT_PTR_NON_NULL(readout->image, false); 224 PS_ASSERT_INT_POSITIVE(Radius, false); 225 202 226 bool extend; 203 227 psRegion newRegion; 204 205 if (Radius == 0)206 return false;207 228 208 229 // check to see if new region is completely contained within old region … … 814 835 815 836 // should we call pmSourceCacheModel if it does not exist? 816 bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psMaskType maskVal, int dx, int dy) { 817 837 bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, 838 psMaskType maskVal, int dx, int dy) 839 { 840 PS_ASSERT_PTR_NON_NULL(source, false); 818 841 bool status; 819 842 … … 904 927 pmModel *pmSourceGetModel (bool *isPSF, const pmSource *source) 905 928 { 929 PS_ASSERT_PTR_NON_NULL(source, NULL); 906 930 907 931 pmModel *model; -
branches/eam_branch_20071023/psModules/src/objects/pmSource.h
r15398 r15418 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.18.2. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-10- 29 01:37:48$5 * @version $Revision: 1.18.2.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 8 8 */ … … 114 114 * 115 115 */ 116 117 bool psMemCheckSource(psPtr ptr); 118 116 119 pmSource *pmSourceCopy(pmSource *source); 117 120 … … 181 184 */ 182 185 pmPSFClump pmSourcePSFClump( 183 psArray *source, ///< The input pmSource 184 psMetadata *metadata ///< Contains classification parameters 185 ); 186 186 psArray *source, ///< The input pmSource 187 psMetadata *metadata ///< Contains classification parameters 188 ); 187 189 188 190 /** pmSourceRoughClass() … … 197 199 */ 198 200 bool pmSourceRoughClass( 199 psArray *source, ///< The input pmSource200 psMetadata *metadata, ///< Contains classification parameters201 pmPSFClump clump, ///< Statistics about the PSF clump201 psArray *source, ///< The input pmSource 202 psMetadata *metadata, ///< Contains classification parameters 203 pmPSFClump clump, ///< Statistics about the PSF clump 202 204 psMaskType maskSat ///< Mask value for saturated pixels 203 205 ); -
branches/eam_branch_20071023/psModules/src/objects/pmSourceContour.c
r14938 r15418 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-21 00:09:05$8 * @version $Revision: 1.9.6.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 220 220 psArray *pmSourceContour (psImage *image, int xc, int yc, float threshold) 221 221 { 222 PS_ASSERT_PTR_NON_NULL(image, NULL); 222 223 223 224 int xR, yR, x0, x1, x0s, x1s; -
branches/eam_branch_20071023/psModules/src/objects/pmSourceFitSet.c
r15055 r15418 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-28 00:39:41$8 * @version $Revision: 1.7.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 79 79 } 80 80 81 bool psMemCheckSourceFitSetData(psPtr ptr) 82 { 83 PS_ASSERT_PTR(ptr, false); 84 return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmSourceFitSetDataFree); 85 } 86 87 81 88 // this function is called with the full set of parameters and the beta values in a single vector 82 bool pmSourceFitSetCheckLimits (psMinConstraintMode mode, int nParam, float *params, float *betas) 83 { 84 assert (thisSet); 89 bool pmSourceFitSetCheckLimits (psMinConstraintMode mode, int nParam, float *params, 90 float *betas) 91 { 92 PS_ASSERT_PTR_NON_NULL(thisSet, false); 85 93 86 94 // nParam is the parameter in the full sequence. determine which single model this comes from … … 109 117 110 118 // merge parameters from FitSet models into single param and deriv vectors 111 bool pmSourceFitSetJoin (psVector *deriv, psVector *param, pmSourceFitSetData *set) { 112 113 assert (set); 119 bool pmSourceFitSetJoin (psVector *deriv, psVector *param, pmSourceFitSetData *set) 120 { 121 PS_ASSERT_PTR_NON_NULL(set, false); 122 PS_ASSERT_PTR_NON_NULL(param, false); 123 114 124 assert (set->paramSet->n == set->derivSet->n); 115 125 … … 138 148 // distribute parameters from single param and deriv vectors into FitSet models 139 149 bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param) { 140 141 assert (set); 150 PS_ASSERT_PTR_NON_NULL(set, false); 151 PS_ASSERT_PTR_NON_NULL(param, false); 152 142 153 assert (set->paramSet->n == set->derivSet->n); 143 154 … … 159 170 } 160 171 161 bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam, const psVector *param, pmSource *source, psMinimization *myMin, int nPix, bool fitStatus) { 162 172 bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam, 173 const psVector *param, pmSource *source, 174 psMinimization *myMin, int nPix, bool fitStatus) 175 { 176 PS_ASSERT_PTR_NON_NULL(set, false); 163 177 bool onPic = true; 164 165 assert (set);166 178 167 179 int n = 0; … … 203 215 psF32 pmSourceFitSetFunction(psVector *deriv, const psVector *param, const psVector *x) 204 216 { 217 PS_ASSERT_PTR_NON_NULL(thisSet, NAN); 205 218 float chisqSum = 0.0; 206 219 float chisqOne = 0.0; 207 208 assert (thisSet);209 220 pmSourceFitSetSplit (thisSet, deriv, param); 210 221 … … 225 236 226 237 // XXX allow the mode to be a function of the object (eg, S/N) 227 bool pmSourceFitSetMasks (psMinConstraint *constraint, pmSourceFitSetData *set, pmSourceFitMode mode) { 238 bool pmSourceFitSetMasks (psMinConstraint *constraint, pmSourceFitSetData *set, 239 pmSourceFitMode mode) 240 { 241 PS_ASSERT_PTR_NON_NULL(set, false); 242 PS_ASSERT_PTR_NON_NULL(constraint, false); 228 243 229 244 // unmask everyone -
branches/eam_branch_20071023/psModules/src/objects/pmSourceFitSet.h
r15055 r15418 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-28 00:39:47$5 * @version $Revision: 1.5.2.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 8 8 */ … … 23 23 // initialize data for a group of object models 24 24 pmSourceFitSetData *pmSourceFitSetDataAlloc (psArray *modelSet); 25 bool psMemCheckSourceFitSetData(psPtr ptr); 25 26 26 27 // function used to set limits for a group of models -
branches/eam_branch_20071023/psModules/src/objects/pmSourceIO.c
r15398 r15418 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.52.2. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-10- 29 01:37:48$5 * @version $Revision: 1.52.2.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 int pmSourceGetDophotType (pmSource *source) 48 48 { 49 PS_ASSERT_PTR_NON_NULL(source, -1); 50 49 51 switch (source->type) { 50 52 … … 74 76 bool pmSourceSetDophotType (pmSource *source, int type) 75 77 { 78 PS_ASSERT_PTR_NON_NULL(source, false); 79 76 80 if (type == 4) { 77 81 source->mode |= PM_SOURCE_MODE_FAIL; … … 106 110 bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 107 111 { 112 PS_ASSERT_PTR_NON_NULL(view, false); 113 PS_ASSERT_PTR_NON_NULL(file, false); 114 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 108 115 109 116 pmFPA *fpa = file->fpa; … … 165 172 bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 166 173 { 174 PS_ASSERT_PTR_NON_NULL(view, false); 175 PS_ASSERT_PTR_NON_NULL(fpa, false); 176 PS_ASSERT_PTR_NON_NULL(fpa->chips, false); 177 167 178 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 168 179 *thisView = *view; … … 184 195 bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 185 196 { 197 PS_ASSERT_PTR_NON_NULL(chip, false); 198 PS_ASSERT_PTR_NON_NULL(chip->cells, false); 199 PS_ASSERT_PTR_NON_NULL(view, false); 200 186 201 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 187 202 *thisView = *view; … … 203 218 bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 204 219 { 220 PS_ASSERT_PTR_NON_NULL(cell, false); 221 PS_ASSERT_PTR_NON_NULL(cell->readouts, false); 222 PS_ASSERT_PTR_NON_NULL(view, false); 223 205 224 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 206 225 *thisView = *view; … … 222 241 bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 223 242 { 243 PS_ASSERT_PTR_NON_NULL(readout, false); 244 PS_ASSERT_PTR_NON_NULL(view, false); 245 PS_ASSERT_PTR_NON_NULL(file, false); 246 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 224 247 225 248 bool status; … … 418 441 419 442 // if this file needs to have a PHU written out, write one 420 bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) { 443 bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 444 { 445 PS_ASSERT_PTR_NON_NULL(view, false); 446 PS_ASSERT_PTR_NON_NULL(file, false); 421 447 422 448 bool status; … … 527 553 bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 528 554 { 555 PS_ASSERT_PTR_NON_NULL(view, false); 556 PS_ASSERT_PTR_NON_NULL(file, false); 557 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 558 529 559 pmFPA *fpa = file->fpa; 530 560 … … 566 596 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 567 597 { 598 PS_ASSERT_PTR_NON_NULL(view, false); 599 PS_ASSERT_PTR_NON_NULL(file, false); 600 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 601 PS_ASSERT_PTR_NON_NULL(file->fpa->chips, false); 602 568 603 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 569 604 *thisView = *view; … … 587 622 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 588 623 { 624 PS_ASSERT_PTR_NON_NULL(view, false); 625 PS_ASSERT_PTR_NON_NULL(chip, false); 626 PS_ASSERT_PTR_NON_NULL(chip->cells, false); 627 589 628 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 590 629 *thisView = *view; … … 611 650 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 612 651 { 652 PS_ASSERT_PTR_NON_NULL(view, false); 653 PS_ASSERT_PTR_NON_NULL(cell, false); 654 PS_ASSERT_PTR_NON_NULL(cell->readouts, false); 655 613 656 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 614 657 *thisView = *view; … … 652 695 bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 653 696 { 697 PS_ASSERT_PTR_NON_NULL(view, false); 698 PS_ASSERT_PTR_NON_NULL(file, false); 654 699 655 700 bool status; … … 789 834 bool pmFPAviewCheckDataStatusForSources (const pmFPAview *view, const pmFPAfile *file) 790 835 { 836 PS_ASSERT_PTR_NON_NULL(view, false); 837 PS_ASSERT_PTR_NON_NULL(file, false); 838 PS_ASSERT_PTR_NON_NULL(file->fpa, false); 839 791 840 pmFPA *fpa = file->fpa; 792 841 … … 826 875 } 827 876 828 bool pmFPACheckDataStatusForSources (const pmFPA *fpa) { 877 bool pmFPACheckDataStatusForSources (const pmFPA *fpa) 878 { 879 PS_ASSERT_PTR_NON_NULL(fpa, false); 880 PS_ASSERT_PTR_NON_NULL(fpa->chips, false); 829 881 830 882 for (int i = 0; i < fpa->chips->n; i++) { … … 836 888 } 837 889 838 bool pmChipCheckDataStatusForSources (const pmChip *chip) { 890 bool pmChipCheckDataStatusForSources (const pmChip *chip) 891 { 892 PS_ASSERT_PTR_NON_NULL(chip, false); 893 PS_ASSERT_PTR_NON_NULL(chip->cells, false); 839 894 840 895 for (int i = 0; i < chip->cells->n; i++) { … … 846 901 } 847 902 848 bool pmCellCheckDataStatusForSources (const pmCell *cell) { 903 bool pmCellCheckDataStatusForSources (const pmCell *cell) 904 { 905 PS_ASSERT_PTR_NON_NULL(cell, false); 906 PS_ASSERT_PTR_NON_NULL(cell->readouts, false); 849 907 850 908 for (int i = 0; i < cell->readouts->n; i++) { … … 856 914 } 857 915 858 bool pmReadoutCheckDataStatusForSources (const pmReadout *readout) { 916 bool pmReadoutCheckDataStatusForSources (const pmReadout *readout) 917 { 918 PS_ASSERT_PTR_NON_NULL(readout, false); 859 919 860 920 bool status; -
branches/eam_branch_20071023/psModules/src/objects/pmSourceIO_CMP.c
r14938 r15418 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.31.6.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 48 48 bool pmSourcesWriteCMP (psArray *sources, char *filename, psMetadata *header) 49 49 { 50 PS_ASSERT_PTR_NON_NULL(sources, false); 51 PS_ASSERT_PTR_NON_NULL(filename, false); 52 PS_ASSERT_PTR_NON_NULL(header, false); 50 53 51 54 int i, type; … … 58 61 // find config information for output header 59 62 float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT"); 60 if (!status) 63 if (!status) { 61 64 ZERO_POINT = 25.0; 65 } 62 66 63 67 // MEF elements have XTENSION, not SIMPLE: remove this (replace with SIMPLE) 64 68 psMetadataLookupStr (&status, header, "XTENSION"); 65 if (status) 69 if (status) { 66 70 psMetadataRemoveKey (header, "XTENSION"); 71 } 67 72 68 73 // create file, write-out header … … 148 153 psArray *pmSourcesReadCMP (char *filename, psMetadata *header) 149 154 { 155 PS_ASSERT_PTR_NON_NULL(filename, false); 156 PS_ASSERT_PTR_NON_NULL(header, false); 150 157 151 158 bool status; -
branches/eam_branch_20071023/psModules/src/objects/pmSourceIO_OBJ.c
r14938 r15418 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.15.6.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 bool pmSourcesWriteOBJ (psArray *sources, char *filename) 43 43 { 44 PS_ASSERT_PTR_NON_NULL(sources, false); 45 PS_ASSERT_PTR_NON_NULL(filename, false); 44 46 45 47 int type; -
branches/eam_branch_20071023/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r14938 r15418 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.13.6.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 46 46 // values derived in the DVO database. 47 47 // XXX how do I generate the source tables which I need to send to PSPS? 48 49 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname) 48 // XXX: input parameter imageHeader is never used. 49 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, 50 psMetadata *tableHeader, char *extname) 50 51 { 52 PS_ASSERT_PTR_NON_NULL(fits, false); 53 PS_ASSERT_PTR_NON_NULL(sources, false); 54 PS_ASSERT_PTR_NON_NULL(extname, false); 51 55 52 56 psArray *table; … … 147 151 psArray *pmSourcesRead_PS1_DEV_0 (psFits *fits, psMetadata *header) 148 152 { 153 PS_ASSERT_PTR_NON_NULL(fits, false); 154 PS_ASSERT_PTR_NON_NULL(header, false); 149 155 150 156 bool status; -
branches/eam_branch_20071023/psModules/src/objects/pmSourceIO_RAW.c
r14938 r15418 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.17.6.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 { 45 45 46 PS_ASSERT_PTR_NON_NULL(sources, false); 47 PS_ASSERT_PTR_NON_NULL(filename, false); 48 46 49 char *name = (char *) psAlloc (strlen(filename) + 10); 47 50 … … 65 68 bool pmSourcesWritePSFs (psArray *sources, char *filename) 66 69 { 70 PS_ASSERT_PTR_NON_NULL(sources, false); 71 PS_ASSERT_PTR_NON_NULL(filename, false); 67 72 68 73 double dPos; … … 124 129 bool pmSourcesWriteEXTs (psArray *sources, char *filename, bool requireEXT) 125 130 { 131 PS_ASSERT_PTR_NON_NULL(sources, false); 132 PS_ASSERT_PTR_NON_NULL(filename, false); 126 133 127 134 double dPos; … … 184 191 bool pmSourcesWriteNULLs (psArray *sources, char *filename) 185 192 { 193 PS_ASSERT_PTR_NON_NULL(sources, false); 194 PS_ASSERT_PTR_NON_NULL(filename, false); 186 195 187 196 int i; … … 230 239 bool pmMomentsWriteText (psArray *sources, char *filename) 231 240 { 241 PS_ASSERT_PTR_NON_NULL(sources, false); 242 PS_ASSERT_PTR_NON_NULL(filename, false); 232 243 233 244 int i; -
branches/eam_branch_20071023/psModules/src/objects/pmSourceIO_SMPDATA.c
r14938 r15418 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.11.6.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 // this format consists of a header derived from the image header 43 43 // followed by a zero-size matrix, followed by the table data 44 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname) 44 // XXX: input parameter imageHeader is never used 45 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, 46 psMetadata *tableHeader, char *extname) 45 47 { 48 PS_ASSERT_PTR_NON_NULL(fits, false); 49 PS_ASSERT_PTR_NON_NULL(sources, false); 50 PS_ASSERT_PTR_NON_NULL(extname, false); 46 51 47 52 psArray *table; … … 126 131 psArray *pmSourcesRead_SMPDATA (psFits *fits, psMetadata *header) 127 132 { 133 PS_ASSERT_PTR_NON_NULL(fits, false); 134 PS_ASSERT_PTR_NON_NULL(header, false); 128 135 129 136 bool status; -
branches/eam_branch_20071023/psModules/src/objects/pmSourceIO_SX.c
r14938 r15418 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.13.6.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 bool pmSourcesWriteSX (psArray *sources, char *filename) 43 43 { 44 PS_ASSERT_PTR_NON_NULL(sources, false); 45 PS_ASSERT_PTR_NON_NULL(filename, false); 44 46 45 47 psF32 *PAR, *dPAR; -
branches/eam_branch_20071023/psModules/src/objects/pmSourcePhotometry.c
r15107 r15418 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-29 03:14:55$5 * @version $Revision: 1.36.2.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 bool pmSourceMagnitudesInit (psMetadata *config) 40 40 { 41 41 PS_ASSERT_PTR_NON_NULL(config, false); 42 42 bool status; 43 43 … … 64 64 65 65 // XXX masked region should be (optionally) elliptical 66 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psMaskType maskVal, psMaskType mark) 67 { 66 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, 67 psMaskType maskVal, psMaskType mark) 68 { 69 PS_ASSERT_PTR_NON_NULL(source, false); 70 PS_ASSERT_PTR_NON_NULL(psf, false); 68 71 69 72 int status = false; … … 269 272 bool pmSourcePhotometryModel (float *fitMag, pmModel *model) 270 273 { 274 PS_ASSERT_PTR_NON_NULL(fitMag, false); 275 if (model == NULL) { 276 return false; 277 } 271 278 272 279 float fitSum = 0; 273 280 *fitMag = NAN; 274 275 if (model == NULL) {276 return false;277 }278 281 279 282 // measure fitMag … … 289 292 290 293 // return source aperture magnitude 291 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, psMaskType maskVal) 292 { 294 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, 295 psMaskType maskVal) 296 { 297 PS_ASSERT_PTR_NON_NULL(apMag, false); 298 PS_ASSERT_PTR_NON_NULL(image, false); 299 PS_ASSERT_PTR_NON_NULL(mask, false); 300 PS_ASSERT_PTR_NON_NULL(model, false); 301 293 302 float apSum = 0; 294 303 float sky = 0; 295 304 *apMag = NAN; 296 297 if (model == NULL) {298 psError(PM_ERR_OBJECTS, true, "Model is NULL");299 return false;300 }301 305 302 306 if (DO_SKY) { … … 327 331 328 332 // return source aperture magnitude 329 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, psMaskType maskVal) 330 { 333 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, 334 psMaskType maskVal) 335 { 336 PS_ASSERT_PTR_NON_NULL(pixWeight, false); 337 PS_ASSERT_PTR_NON_NULL(image, false); 338 PS_ASSERT_PTR_NON_NULL(mask, false); 339 PS_ASSERT_PTR_NON_NULL(model, false); 340 331 341 float modelSum = 0; 332 342 float validSum = 0; … … 339 349 340 350 *pixWeight = 0.0; 341 342 if (model == NULL)343 return false;344 351 345 352 // we only care about the value of the object model, not the local sky … … 412 419 const bool unweighted_sum) // should the cross product be weighted? 413 420 { 421 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 422 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 414 423 415 424 int Xs, Xe, Ys, Ye; … … 475 484 const bool unweighted_sum) // should the cross product be weighted? 476 485 { 486 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 487 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 477 488 478 489 int Xs, Xe, Ys, Ye; … … 538 549 const bool unweighted_sum) // should the cross product be weighted? 539 550 { 551 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 540 552 double flux = 0, wt = 0, factor = 0; 541 553 … … 587 599 # endif 588 600 589 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, psMaskType maskVal) 590 { 601 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, 602 psMaskType maskVal) 603 { 604 PS_ASSERT_PTR_NON_NULL(model, false); 605 PS_ASSERT_PTR_NON_NULL(image, false); 606 PS_ASSERT_PTR_NON_NULL(mask, false); 607 PS_ASSERT_PTR_NON_NULL(weight, false); 591 608 592 609 double dC = 0.0; … … 613 630 const bool unweighted_sum) // should the cross product be weighted? 614 631 { 632 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 615 633 double flux = 0, wt = 0, factor = 0; 616 634 … … 662 680 const bool unweighted_sum) // should the cross product be weighted? 663 681 { 682 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 683 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 664 684 int Xs, Xe, Ys, Ye; 665 685 int xi, xj, yi, yj; … … 724 744 const bool unweighted_sum) // should the cross product be weighted? 725 745 { 726 746 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 747 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 727 748 int Xs, Xe, Ys, Ye; 728 749 int xi, xj, yi, yj; -
branches/eam_branch_20071023/psModules/src/objects/pmSourcePlotApResid.c
r14938 r15418 4 4 * @author EAM, IfA 5 5 * 6 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $7 * @date $Date: 2007- 09-21 00:09:05$6 * @version $Revision: 1.4.6.1 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-10-30 00:59:23 $ 8 8 * Copyright 2006 IfA, University of Hawaii 9 9 */ … … 40 40 # include <kapa.h> 41 41 42 // plot the sx, sy, sxy as vector field, 43 // plot the PSF measured sx, sy, sxy as vector field 44 // pull the sources from the config / file? 45 bool pmSourcePlotApResid (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 42 // plot the sx, sy, sxy as vector field, 43 // plot the PSF measured sx, sy, sxy as vector field 44 // pull the sources from the config / file? 45 bool pmSourcePlotApResid (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, 46 pmSourcePlotLayout *layout) 46 47 { 48 PS_ASSERT_PTR_NON_NULL(view, false); 49 PS_ASSERT_PTR_NON_NULL(file, false); 50 PS_ASSERT_PTR_NON_NULL(config, false); 51 PS_ASSERT_PTR_NON_NULL(layout, false); 47 52 48 53 Graphdata graphdata; … … 150 155 # else 151 156 152 bool pmSourcePlotApResid (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout)157 bool pmSourcePlotApResid (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 153 158 { 154 159 psLogMsg ("psphot", 3, "skipping ap-mag resid plot"); -
branches/eam_branch_20071023/psModules/src/objects/pmSourcePlotMoments.c
r14938 r15418 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 09-21 00:09:05$7 * @version $Revision: 1.9.6.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-10-30 00:59:23 $ 9 9 * 10 10 * Copyright 2006 IfA, University of Hawaii … … 41 41 // this variable is defined in psmodules.h if ohana-config is found 42 42 # if (HAVE_KAPA) 43 # include <kapa.h>43 # include <kapa.h> 44 44 45 // plot the sx, sy moments plane (faint and bright sources) 46 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 45 // plot the sx, sy moments plane (faint and bright sources) 46 bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, 47 pmSourcePlotLayout *layout) 47 48 { 49 PS_ASSERT_PTR_NON_NULL(view, false); 50 PS_ASSERT_PTR_NON_NULL(file, false); 51 PS_ASSERT_PTR_NON_NULL(config, false); 52 PS_ASSERT_PTR_NON_NULL(layout, false); 48 53 49 54 Graphdata graphdata; -
branches/eam_branch_20071023/psModules/src/objects/pmSourcePlotPSFModel.c
r14938 r15418 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 09-21 00:09:05$7 * @version $Revision: 1.11.6.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-10-30 00:59:23 $ 9 9 * 10 10 * Copyright 2006 IfA, University of Hawaii … … 41 41 // this variable is defined in psmodules.h if ohana-config is found 42 42 # if (HAVE_KAPA) 43 # include <kapa.h> 44 45 // plot the sx, sy, sxy as vector field, 46 // plot the PSF measured sx, sy, sxy as vector field 47 // pull the sources from the config / file? 48 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, pmSourcePlotLayout *layout) 43 # include <kapa.h> 44 45 // plot the sx, sy, sxy as vector field, 46 // plot the PSF measured sx, sy, sxy as vector field 47 // pull the sources from the config / file? 48 bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, const pmConfig *config, 49 pmSourcePlotLayout *layout) 49 50 { 51 PS_ASSERT_PTR_NON_NULL(view, false); 52 PS_ASSERT_PTR_NON_NULL(file, false); 53 PS_ASSERT_PTR_NON_NULL(config, false); 54 PS_ASSERT_PTR_NON_NULL(layout, false); 50 55 51 56 Graphdata graphdata; -
branches/eam_branch_20071023/psModules/src/objects/pmSourcePlots.c
r13214 r15418 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 05-04 00:54:09$7 * @version $Revision: 1.4.16.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-10-30 00:59:23 $ 9 9 * 10 10 * Copyright 2006 IfA, University of Hawaii … … 36 36 PS_ASSERT_PTR_NON_NULL(view, false); 37 37 PS_ASSERT_PTR_NON_NULL(file, false); 38 PS_ASSERT_PTR_NON_NULL(config, false); 38 39 39 40 if ((view->readout != -1) || (view->cell != -1)) { … … 149 150 } 150 151 152 bool psMemCheckSourcePlotLayout(psPtr ptr) 153 { 154 PS_ASSERT_PTR(ptr, false); 155 return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmSourcePlotLayoutFree); 156 } 157 158 151 159 /* we have three types of plots to produce (maybe more?) 152 160 * for each plot, we need to supply the following information: -
branches/eam_branch_20071023/psModules/src/objects/pmSourcePlots.h
r13214 r15418 4 4 * @author EAM, IfA 5 5 * 6 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $7 * @date $Date: 2007- 05-04 00:54:09$6 * @version $Revision: 1.4.16.1 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-10-30 00:59:23 $ 8 8 * Copyright 2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 30 30 31 31 pmSourcePlotLayout *pmSourcePlotLayoutAlloc(); 32 bool psMemCheckSourcePlotLayout(psPtr ptr); 32 33 33 34 bool pmFPAviewWriteSourcePlot(const pmFPAview *view, pmFPAfile *file, const pmConfig *config); -
branches/eam_branch_20071023/psModules/src/objects/pmSourceUtils.c
r14938 r15418 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-21 00:09:05$8 * @version $Revision: 1.3.6.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-10-30 00:59:23 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 63 63 } 64 64 65 pmSource *pmSourceFromModel (pmModel *model, pmReadout *readout, float radius, pmSourceType type) { 65 pmSource *pmSourceFromModel (pmModel *model, pmReadout *readout, float radius, 66 pmSourceType type) 67 { 68 PS_ASSERT_PTR_NON_NULL(model, NULL); 69 PS_ASSERT_PTR_NON_NULL(readout, NULL); 66 70 67 71 pmSource *source = pmSourceAlloc (); -
branches/eam_branch_20071023/psModules/src/objects/pmTrend2D.h
r15000 r15418 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 09-24 21:27:58$7 * @version $Revision: 1.3.4.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-10-30 00:59:23 $ 9 9 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 10 10 */ … … 34 34 pmTrend2D *pmTrend2DAlloc (pmTrend2DMode mode, psImage *image, int nXtrend, int nYtrend, psStats *stats); 35 35 36 bool psMemCheckTrend2D(psPtr ptr); 37 36 38 pmTrend2D *pmTrend2DNoImageAlloc (pmTrend2DMode mode, psImageBinning *binning, psStats *stats); 37 39
Note:
See TracChangeset
for help on using the changeset viewer.
