Changeset 15562 for trunk/psModules/src/objects
- Timestamp:
- Nov 9, 2007, 3:09:20 PM (19 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 2 added
- 41 edited
-
Makefile.am (modified) (2 diffs)
-
pmGrowthCurve.h (modified) (2 diffs)
-
pmModel.c (modified) (7 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) (13 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) (6 diffs)
-
pmSourceContour.c (modified) (2 diffs)
-
pmSourceExtendedPars.c (added)
-
pmSourceExtendedPars.h (added)
-
pmSourceFitSet.c (modified) (7 diffs)
-
pmSourceFitSet.h (modified) (2 diffs)
-
pmSourceIO.c (modified) (23 diffs)
-
pmSourceIO.h (modified) (2 diffs)
-
pmSourceIO_CMP.c (modified) (4 diffs)
-
pmSourceIO_OBJ.c (modified) (2 diffs)
-
pmSourceIO_PS1_DEV_0.c (modified) (3 diffs)
-
pmSourceIO_PS1_DEV_1.c (modified) (6 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.c (modified) (1 diff)
-
pmTrend2D.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/Makefile.am
r15039 r15562 10 10 pmModelUtils.c \ 11 11 pmSource.c \ 12 pmSourceExtendedPars.c \ 12 13 pmSourceUtils.c \ 13 14 pmSourceSky.c \ … … 50 51 pmModelUtils.h \ 51 52 pmSource.h \ 53 pmSourceExtendedPars.h \ 52 54 pmSourceUtils.h \ 53 55 pmSourceSky.h \ -
trunk/psModules/src/objects/pmGrowthCurve.h
r11253 r15562 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.8 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-11-10 01:09:20 $ 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); -
trunk/psModules/src/objects/pmModel.c
r14938 r15562 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-21 00:04:07$8 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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); … … 217 224 Ro = psImageInterpolateOptionsAlloc( 218 225 PS_INTERPOLATE_BILINEAR, 219 model->residuals->Ro, NULL, NULL, 0, 0.0, 0.0, 1, 0, 0.0);226 model->residuals->Ro, NULL, mask, 0, 0.0, 0.0, 1, 0, 0.0); 220 227 Rx = psImageInterpolateOptionsAlloc( 221 228 PS_INTERPOLATE_BILINEAR, … … 257 264 float oy = yBin*(imageRow + 0.5 - yCenter) + yResidCenter; 258 265 266 psU8 mflux = 0; 259 267 if (mode & PM_MODEL_OP_RES0) { 260 psU8 mflux = 0;261 268 double Fo = 0.0; 262 269 psImageInterpolate (&Fo, NULL, &mflux, ox, oy, Ro); … … 265 272 } 266 273 } 267 if (mode & PM_MODEL_OP_RES1) { 268 psU8 mflux = 0;274 // skip Rx,Ry if Ro is masked 275 if (!mflux && (mode & PM_MODEL_OP_RES1)) { 269 276 double Fx = 0.0; 270 277 double Fy = 0.0; -
trunk/psModules/src/objects/pmModel.h
r14652 r15562 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 08-24 00:11:02$7 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-11-10 01:09:20 $ 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 -
trunk/psModules/src/objects/pmModelClass.c
r14938 r15562 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.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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"); -
trunk/psModules/src/objects/pmModelClass.h
r14652 r15562 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.3 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2007-11-10 01:09:20 $ 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); -
trunk/psModules/src/objects/pmModelGroup.c
r14652 r15562 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 08-24 00:11:02$8 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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 { -
trunk/psModules/src/objects/pmModelGroup.h
r14652 r15562 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.9 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2007-11-10 01:09:20 $ 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); -
trunk/psModules/src/objects/pmModelUtils.c
r14938 r15562 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.4 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-11-10 01:09:20 $ 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 -
trunk/psModules/src/objects/pmPSF.c
r15089 r15562 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-29 00:15:32$8 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 76 76 } 77 77 78 bool psMemCheckPSFOptions(psPtr ptr) 79 { 80 PS_ASSERT_PTR(ptr, false); 81 return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmPSFOptionsFree); 82 } 83 78 84 /***************************************************************************** 79 85 pmPSFFree(psf): function to free a pmPSF structure … … 81 87 static void pmPSFFree (pmPSF *psf) 82 88 { 83 84 if (psf == NULL) 89 if (psf == NULL) { 85 90 return; 91 } 86 92 87 93 psFree (psf->ChiTrend); … … 98 104 pmPSFAlloc (type): allocate a pmPSF. 99 105 100 NOTE: PSF model parameters which are not modeled on an image are set to NULL in psf->params. 106 NOTE: PSF model parameters which are not modeled on an image are set to NULL 107 in psf->params. 101 108 102 109 These are normally: … … 109 116 pmPSF *pmPSFAlloc (pmPSFOptions *options) 110 117 { 118 PS_ASSERT_PTR_NON_NULL(options, NULL); 111 119 int Nparams; 112 120 … … 205 213 } 206 214 215 bool psMemCheckPSF(psPtr ptr) 216 { 217 PS_ASSERT_PTR(ptr, false); 218 return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmPSFFree); 219 } 220 207 221 // the PSF models the \sigma_{xy} variation of the elliptical contour as a function of position in the image with a 208 222 // polynomial. an individual object has a contour of the form (x^2/2sx^2) + (y^2/2sy^2) + sxy*x*y … … 217 231 double pmPSF_SXYfromModel (psF32 *modelPar) 218 232 { 233 PS_ASSERT_PTR_NON_NULL(modelPar, NAN); 219 234 220 235 double SXX = modelPar[PM_PAR_SXX]; … … 229 244 double pmPSF_SXYtoModel (psF32 *fittedPar) 230 245 { 246 PS_ASSERT_PTR_NON_NULL(fittedPar, NAN); 231 247 232 248 double SXX = fittedPar[PM_PAR_SXX]; … … 247 263 bool pmPSF_FitToModel (psF32 *fittedPar, float minMinorAxis) 248 264 { 265 PS_ASSERT_PTR_NON_NULL(fittedPar, false); 266 249 267 psEllipsePol pol; 250 268 … … 272 290 psEllipsePol pmPSF_ModelToFit (psF32 *modelPar) 273 291 { 292 // XXX: must assert non-NULL input parameter 293 // PS_ASSERT_PTR_NON_NULL(modelPar, NAN); 294 274 295 psEllipseShape shape; 275 296 … … 289 310 psEllipseShape shape; 290 311 psEllipseAxes axes; 312 // XXX: must assert non-NULL input parameter 313 // PS_ASSERT_PTR_NON_NULL(modelPar, axes); 291 314 292 315 shape.sx = modelPar[PM_PAR_SXX] / M_SQRT2; … … 310 333 bool pmPSF_AxesToModel (psF32 *modelPar, psEllipseAxes axes) 311 334 { 335 PS_ASSERT_PTR_NON_NULL(modelPar, false); 336 312 337 if ((axes.major <= 0) || (axes.minor <= 0)) { 313 338 modelPar[PM_PAR_SXX] = 0.0; … … 374 399 bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psMaskType maskVal, psMaskType mark) 375 400 { 401 PS_ASSERT_PTR_NON_NULL(readout, false); 402 PS_ASSERT_PTR_NON_NULL(readout->image, false); 376 403 377 404 // bool status; -
trunk/psModules/src/objects/pmPSF.h
r15016 r15562 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-25 22:05:05$8 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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(); 93 bool psMemCheckPSFOptions(psPtr ptr); 91 94 92 95 double pmPSF_SXYfromModel (psF32 *modelPar); -
trunk/psModules/src/objects/pmPSF_IO.c
r15254 r15562 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-1 0-09 19:26:25$8 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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; … … 95 106 bool pmPSFmodelWriteForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 96 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); 97 112 98 113 pmFPA *fpa = file->fpa; … … 126 141 bool pmPSFmodelWriteFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 127 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); 128 146 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 129 147 *thisView = *view; … … 145 163 bool pmPSFmodelWriteChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 146 164 { 165 PS_ASSERT_PTR_NON_NULL(view, false); 166 PS_ASSERT_PTR_NON_NULL(chip, false); 167 147 168 if (!pmPSFmodelWrite (chip->analysis, view, file, config)) { 148 169 psError(PS_ERR_IO, false, "Failed to write PSF for chip"); … … 162 183 bool pmPSFmodelWrite (psMetadata *analysis, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 163 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); 164 188 bool status; 165 189 pmHDU *hdu; … … 450 474 451 475 // if this file needs to have a PHU written out, write one 452 bool pmPSFmodelWritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) { 453 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); 454 481 // not needed if already written 455 482 if (file->wrote_phu) return true; … … 494 521 bool pmPSFmodelReadForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 495 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); 496 526 497 527 pmFPA *fpa = file->fpa; … … 517 547 bool pmPSFmodelReadFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 518 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 519 553 bool success = true; // Was everything successful? 520 554 for (int i = 0; i < fpa->chips->n; i++) { … … 528 562 bool pmPSFmodelReadChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 529 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 530 568 if (!pmPSFmodelRead (chip->analysis, view, file, config)) { 531 569 psError(PS_ERR_IO, false, "Failed to write PSF for chip"); … … 539 577 bool pmPSFmodelRead (psMetadata *analysis, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 540 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 541 583 bool status; 542 584 char *rule = NULL; … … 763 805 } 764 806 765 // create a psMetadata representation (human-readable) of a psf model766 807 // XXX pmPSF to/from Metadata functions were defined for 1.22 and earlier, but were dropped -
trunk/psModules/src/objects/pmPSFtry.c
r15254 r15562 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-1 0-09 19:26:25$7 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-11-10 01:09:20 $ 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 -
trunk/psModules/src/objects/pmPSFtry.h
r15016 r15562 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-25 22:05:05$8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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() -
trunk/psModules/src/objects/pmPeaks.c
r15039 r15562 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-27 03:35:29$8 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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 { -
trunk/psModules/src/objects/pmPeaks.h
r15039 r15562 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.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2007-11-10 01:09:20 $ 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() -
trunk/psModules/src/objects/pmResiduals.c
r12949 r15562 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.3 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-11-10 01:09:20 $ 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 -
trunk/psModules/src/objects/pmResiduals.h
r12949 r15562 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.3 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-11-10 01:09:20 $ 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 /// @} -
trunk/psModules/src/objects/pmSource.c
r15232 r15562 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-1 0-06 02:29:47$8 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSource.h
r15039 r15562 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-27 03:35:29$5 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 7 7 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 8 8 */ … … 10 10 # ifndef PM_SOURCE_H 11 11 # define PM_SOURCE_H 12 13 # include "pmSourceExtendedPars.h" 12 14 13 15 /// @addtogroup Objects Object Detection / Analysis Functions … … 84 86 psRegion region; ///< area on image covered by selected pixels 85 87 float sky, skyErr; ///< The sky and its error at the center of the object 88 pmSourceExtendedPars *extpars; ///< extended source parameters 86 89 }; 87 90 … … 111 114 * 112 115 */ 116 117 bool psMemCheckSource(psPtr ptr); 118 113 119 pmSource *pmSourceCopy(pmSource *source); 114 120 … … 178 184 */ 179 185 pmPSFClump pmSourcePSFClump( 180 psArray *source, ///< The input pmSource 181 psMetadata *metadata ///< Contains classification parameters 182 ); 183 186 psArray *source, ///< The input pmSource 187 psMetadata *metadata ///< Contains classification parameters 188 ); 184 189 185 190 /** pmSourceRoughClass() … … 194 199 */ 195 200 bool pmSourceRoughClass( 196 psArray *source, ///< The input pmSource197 psMetadata *metadata, ///< Contains classification parameters198 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 199 204 psMaskType maskSat ///< Mask value for saturated pixels 200 205 ); -
trunk/psModules/src/objects/pmSourceContour.c
r14938 r15562 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.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourceFitSet.c
r15055 r15562 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.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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 -
trunk/psModules/src/objects/pmSourceFitSet.h
r15055 r15562 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.6 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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 -
trunk/psModules/src/objects/pmSourceIO.c
r15227 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-1 0-05 22:46:34$5 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; 226 char *exttype;227 char *dataname;228 char *headname;229 249 pmHDU *hdu; 230 250 psMetadata *updates; 231 251 psMetadata *outhead; 252 253 char *exttype = NULL; 254 char *dataname = NULL; 255 char *xsrcname = NULL; 256 char *headname = NULL; 232 257 233 258 // XXX if sources is NULL, skip the cell or write out empty tables? … … 284 309 // get the current header 285 310 hdu = pmFPAviewThisHDU (view, file->fpa); 311 312 // determine the output table format 313 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT"); 314 if (!status) { 315 psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data"); 316 return false; 317 } 318 319 // if this is not TRUE, the output files only contain the psf measurements. 320 bool XSRC_OUTPUT = psMetadataLookupBool(&status, recipe, "SAVE.XSRC"); 286 321 287 322 // define the EXTNAME values for the different data segments: … … 312 347 } 313 348 dataname = pmFPAfileNameFromRule (rule, file, view); 349 350 if (XSRC_OUTPUT) { 351 // EXTNAME for extended source data table 352 rule = psMetadataLookupStr(&status, menu, "CMF.XSRC"); 353 if (!rule) { 354 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.XSRC in EXTNAME.RULES in camera.config"); 355 return false; 356 } 357 xsrcname = pmFPAfileNameFromRule (rule, file, view); 358 } 314 359 } 315 360 … … 350 395 outhead = psMetadataAlloc (); 351 396 352 // determine the output table format353 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT");354 if (!status) {355 psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data");356 return false;357 }358 397 exttype = psMemIncrRefCounter (psMetadataLookupStr(&status, recipe, "OUTPUT.FORMAT")); 359 398 if (!exttype) { … … 375 414 } 376 415 if (!strcmp (exttype, "PS1_DEV_1")) { 377 status = pmSourcesWrite_PS1_DEV_1 (file->fits, sources, file->header, outhead, dataname );416 status = pmSourcesWrite_PS1_DEV_1 (file->fits, sources, file->header, outhead, dataname, xsrcname); 378 417 } 379 380 418 if (!status) { 381 419 psError(PS_ERR_IO, false, "writing CMF data to %s with format %s\n", file->filename, exttype); … … 403 441 404 442 // if this file needs to have a PHU written out, write one 405 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); 406 447 407 448 bool status; … … 512 553 bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 513 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 514 559 pmFPA *fpa = file->fpa; 515 560 … … 551 596 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 552 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 553 603 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 554 604 *thisView = *view; … … 572 622 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 573 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 574 628 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 575 629 *thisView = *view; … … 596 650 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 597 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 598 656 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 599 657 *thisView = *view; … … 637 695 bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 638 696 { 697 PS_ASSERT_PTR_NON_NULL(view, false); 698 PS_ASSERT_PTR_NON_NULL(file, false); 639 699 640 700 bool status; … … 774 834 bool pmFPAviewCheckDataStatusForSources (const pmFPAview *view, const pmFPAfile *file) 775 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 776 840 pmFPA *fpa = file->fpa; 777 841 … … 811 875 } 812 876 813 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); 814 881 815 882 for (int i = 0; i < fpa->chips->n; i++) { … … 821 888 } 822 889 823 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); 824 894 825 895 for (int i = 0; i < chip->cells->n; i++) { … … 831 901 } 832 902 833 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); 834 907 835 908 for (int i = 0; i < cell->readouts->n; i++) { … … 841 914 } 842 915 843 bool pmReadoutCheckDataStatusForSources (const pmReadout *readout) { 916 bool pmReadoutCheckDataStatusForSources (const pmReadout *readout) 917 { 918 PS_ASSERT_PTR_NON_NULL(readout, false); 844 919 845 920 bool status; -
trunk/psModules/src/objects/pmSourceIO.h
r15039 r15562 4 4 * @author EAM, IfA; GLG, MHPCC 5 5 * 6 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $7 * @date $Date: 2007- 09-27 03:35:29$6 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-11-10 01:09:20 $ 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 9 9 * … … 26 26 bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 27 27 bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 28 bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname); 28 bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, char *xsrcname); 29 bool pmSourcesWrite_PS1_DEV_1_XSRC (psFits *fits, psArray *sources, char *extname); 29 30 30 31 bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); -
trunk/psModules/src/objects/pmSourceIO_CMP.c
r14938 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourceIO_OBJ.c
r14938 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r14938 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c
r15250 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-1 0-09 03:10:05$5 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 // XXX how do I generate the source tables which I need to send to PSPS? 48 48 49 bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname )49 bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, char *xsrcname) 50 50 { 51 51 … … 57 57 psF32 xPos, yPos; 58 58 psF32 xErr, yErr; 59 60 // if we request XSRC output, add the XSRC name to this header 61 if (xsrcname) { 62 psMetadataAddStr (tableHeader, PS_LIST_TAIL, "XSRCNAME", PS_META_REPLACE, "name of XSRC table extension", xsrcname); 63 } 59 64 60 65 // let's write these out in S/N order … … 144 149 return false; 145 150 } 146 147 151 psFree (table); 152 153 if (xsrcname) { 154 pmSourcesWrite_PS1_DEV_1_XSRC (fits, sources, xsrcname); 155 } 156 148 157 return true; 149 158 } … … 165 174 } 166 175 assert (modelType > -1); 176 177 // XXX need to look up the XSRCNAME entries 167 178 168 179 // validate a single row of the table (must match SMP) … … 241 252 return sources; 242 253 } 254 255 bool pmSourcesWrite_PS1_DEV_1_XSRC (psFits *fits, psArray *sources, char *extname) 256 { 257 258 psArray *table; 259 psMetadata *row; 260 int i; 261 psF32 *PAR, *dPAR; 262 psEllipseAxes axes; 263 psF32 xPos, yPos; 264 psF32 xErr, yErr; 265 266 // create a header to hold the output data 267 psMetadata *outhead = psMetadataAlloc (); 268 269 // write the links to the image header 270 psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTNAME", PS_META_REPLACE, "xsrc table extension", extname); 271 272 // let's write these out in S/N order 273 sources = psArraySort (sources, pmSourceSortBySN); 274 275 table = psArrayAllocEmpty (sources->n); 276 277 // we write out all sources, regardless of quality. the source flags tell us the state 278 for (i = 0; i < sources->n; i++) { 279 pmSource *source = (pmSource *) sources->data[i]; 280 source->seq = i; 281 282 // skip source if it is not a ext sourc 283 284 // no difference between PSF and non-PSF model 285 // XXX the PSF output should report the value for the psf, not the ext, model 286 pmModel *model = source->modelEXT; 287 if (model == NULL) continue; 288 289 PAR = model->params->data.F32; 290 dPAR = model->dparams->data.F32; 291 xPos = PAR[PM_PAR_XPOS]; 292 yPos = PAR[PM_PAR_YPOS]; 293 xErr = dPAR[PM_PAR_XPOS]; 294 yErr = dPAR[PM_PAR_YPOS]; 295 296 axes = pmPSF_ModelToAxes (PAR, 20.0); 297 298 row = psMetadataAlloc (); 299 // XXX we are not writing out the mode (flags) or the type (psf, ext, etc) 300 psMetadataAdd (row, PS_LIST_TAIL, "IPP_IDET", PS_DATA_U32, "IPP detection identifier index", source->seq); 301 psMetadataAdd (row, PS_LIST_TAIL, "X_EXT", PS_DATA_F32, "PSF x coordinate", xPos); 302 psMetadataAdd (row, PS_LIST_TAIL, "Y_EXT", PS_DATA_F32, "PSF y coordinate", yPos); 303 psMetadataAdd (row, PS_LIST_TAIL, "X_EXT_SIG", PS_DATA_F32, "Sigma in PSF x coordinate", xErr); 304 psMetadataAdd (row, PS_LIST_TAIL, "Y_EXT_SIG", PS_DATA_F32, "Sigma in PSF y coordinate", yErr); 305 psMetadataAdd (row, PS_LIST_TAIL, "EXT_INST_MAG", PS_DATA_F32, "PSF fit instrumental magnitude", PS_MIN (99.0, source->extMag)); 306 // XXX need to calculate psfMag, psfMagErr, extMag, extMagErr... 307 psMetadataAdd (row, PS_LIST_TAIL, "EXT_INST_MAG_SIG", PS_DATA_F32, "Sigma of PSF instrumental magnitude", PS_MIN (99.0, source->errMag)); 308 309 // XXX these should be major and minor, not 'x' and 'y' 310 psMetadataAdd (row, PS_LIST_TAIL, "EXT_WIDTH_X", PS_DATA_F32, "PSF width in x coordinate", axes.major); 311 psMetadataAdd (row, PS_LIST_TAIL, "EXT_WIDTH_Y", PS_DATA_F32, "PSF width in y coordinate", axes.minor); 312 psMetadataAdd (row, PS_LIST_TAIL, "EXT_THETA", PS_DATA_F32, "PSF orientation angle", axes.theta); 313 314 // other values that I need to report: 315 // R, Mag Petrosian, ..... 316 317 psArrayAdd (table, 100, row); 318 psFree (row); 319 } 320 321 if (table->n == 0) { 322 psFitsWriteBlank (fits, outhead, extname); 323 psFree (table); 324 return true; 325 } 326 327 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 328 if (!psFitsWriteTable (fits, outhead, table, extname)) { 329 psError(PS_ERR_IO, false, "writing ext data %s\n", extname); 330 psFree(table); 331 return false; 332 } 333 psFree (table); 334 335 return true; 336 } -
trunk/psModules/src/objects/pmSourceIO_RAW.c
r14938 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourceIO_SMPDATA.c
r14938 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourceIO_SX.c
r14938 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-21 00:09:05$5 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourcePhotometry.c
r15107 r15562 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-29 03:14:55$5 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourcePlotApResid.c
r14938 r15562 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.5 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-11-10 01:09:20 $ 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"); -
trunk/psModules/src/objects/pmSourcePlotMoments.c
r14938 r15562 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.10 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourcePlotPSFModel.c
r14938 r15562 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 09-21 00:09:05$7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-11-10 01:09:20 $ 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; -
trunk/psModules/src/objects/pmSourcePlots.c
r13214 r15562 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.5 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-11-10 01:09:20 $ 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: -
trunk/psModules/src/objects/pmSourcePlots.h
r13214 r15562 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.5 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-11-10 01:09:20 $ 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); -
trunk/psModules/src/objects/pmSourceUtils.c
r14938 r15562 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.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 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 (); -
trunk/psModules/src/objects/pmTrend2D.c
r15417 r15562 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:50:00 $ 7 * 5 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-11-10 01:09:20 $ 8 7 * Copyright 2004 Institute for Astronomy, University of Hawaii 9 8 * -
trunk/psModules/src/objects/pmTrend2D.h
r15000 r15562 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.4 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-11-10 01:09:20 $ 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.
