Changeset 4770
- Timestamp:
- Aug 15, 2005, 3:10:36 PM (21 years ago)
- Location:
- trunk/psModules
- Files:
-
- 31 edited
-
src/pmAstrometry.c (modified) (8 diffs)
-
src/pmAstrometry.h (modified) (18 diffs)
-
src/pmFlatField.c (modified) (3 diffs)
-
src/pmFlatField.h (modified) (2 diffs)
-
src/pmMaskBadPixels.c (modified) (2 diffs)
-
src/pmMaskBadPixels.h (modified) (2 diffs)
-
src/pmNonLinear.c (modified) (5 diffs)
-
src/pmNonLinear.h (modified) (2 diffs)
-
src/pmObjects.c (modified) (49 diffs)
-
src/pmObjects.h (modified) (14 diffs)
-
src/pmReadoutCombine.c (modified) (5 diffs)
-
src/pmSubtractBias.c (modified) (4 diffs)
-
src/pmSubtractBias.h (modified) (3 diffs)
-
src/pmSubtractSky.c (modified) (3 diffs)
-
src/pmSubtractSky.h (modified) (2 diffs)
-
test/tst_pmFlatField.c (modified) (15 diffs)
-
test/tst_pmImageCombine.c (modified) (2 diffs)
-
test/tst_pmMaskBadPixels.c (modified) (13 diffs)
-
test/tst_pmNonLinear.c (modified) (22 diffs)
-
test/tst_pmObjects01.c (modified) (57 diffs)
-
test/tst_pmReadoutCombine.c (modified) (6 diffs)
-
test/tst_pmSubtractBias.c (modified) (27 diffs)
-
test/tst_pmSubtractSky.c (modified) (10 diffs)
-
test/verified/tst_pmImageCombine.stderr (modified) (1 diff)
-
test/verified/tst_pmImageSubtract.stdout (modified) (3 diffs)
-
test/verified/tst_pmNonLinear.stderr (modified) (2 diffs)
-
test/verified/tst_pmNonLinear.stdout (modified) (2 diffs)
-
test/verified/tst_pmObjects01.stderr (modified) (11 diffs)
-
test/verified/tst_pmObjects01.stdout (modified) (6 diffs)
-
test/verified/tst_pmSubtractSky.stderr (modified) (2 diffs)
-
test/verified/tst_pmSubtractSky.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmAstrometry.c
r4754 r4770 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-08-1 1 00:03:51$10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-08-16 01:10:34 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "pmAstrometry.h" 24 24 25 psDB wow;26 27 25 /***************************************************************************** 28 checkValidImageCoords(): this is a private function which simply 29 determines if the supplied x,y coordinates are in the range for the supplied 30 psImage. 26 checkValidImageCoords(): this is a private function which simply determines if 27 the supplied x,y coordinates are in the range for the supplied psImage. 28 29 XXX: What about col0 and row0 30 XXX: This should return a psBool. 31 31 *****************************************************************************/ 32 /*33 32 static psS32 checkValidImageCoords(double x, 34 33 double y, … … 36 35 { 37 36 PS_ASSERT_IMAGE_NON_NULL(tmpImage, 0); 38 37 39 38 if ((x < 0.0) || (x > (double)tmpImage->numCols) || 40 39 (y < 0.0) || (y > (double)tmpImage->numRows)) { 41 40 return (0); 42 41 } 43 42 44 43 return (1); 45 44 } 46 */ 47 /* 48 static void FPAFree(psFPA* fpa) 45 46 /****************************************************************************** 47 XXX: Is this the correct way to free metadata? 48 XXX: Is this the correct way to free database structs? 49 *****************************************************************************/ 50 51 static void FPAFree(pmFPA *fpa) 49 52 { 50 53 if (fpa != NULL) { 51 psFree(fpa->chips);52 psFree(fpa->grommit);53 psFree(fpa->exposure);54 psFree(fpa->metadata);55 54 psFree(fpa->fromTangentPlane); 56 55 psFree(fpa->toTangentPlane); 57 psFree(fpa->pattern);58 psFree(fpa->colorPlus);59 psFree(fpa->colorMinus);60 56 psFree(fpa->projection); 61 } 62 } 63 */ 64 65 /* 66 static void chipFree(psChip* chip) 57 psFree(fpa->concepts); 58 psFree(fpa->analysis); 59 psFree(fpa->camera); 60 psFree(fpa->chips); 61 psFree(fpa->header); 62 psFree(fpa->db); 63 } 64 } 65 66 static void chipFree(pmChip* chip) 67 67 { 68 68 if (chip != NULL) { 69 psFree(chip->cells);70 psFree(chip->metadata);71 69 psFree(chip->toFPA); 72 70 psFree(chip->fromFPA); 73 } 74 } 75 */ 76 77 /* 78 static void cellFree(psCell* cell) 71 psFree(chip->concepts); 72 psFree(chip->analysis); 73 psFree(chip->cells); 74 psFree(chip->parent); 75 psFree(chip->extname); 76 psFree(chip->pixels); 77 psFree(chip->header); 78 } 79 } 80 81 static void cellFree(pmCell *cell) 79 82 { 80 83 if (cell != NULL) { 84 psFree(cell->toChip); 85 psFree(cell->toFPA); 86 psFree(cell->toSky); 87 psFree(cell->concepts); 88 psFree(cell->analysis); 81 89 psFree(cell->readouts); 82 psFree(cell->metadata); 83 psFree(cell->toChip); 84 psFree(cell->fromChip); 85 psFree(cell->toFPA); 86 psFree(cell->toTP); 87 psFree(cell->toSky); 88 } 89 } 90 */ 91 92 static void readoutFree(psReadout* readout) 90 psFree(cell->parent); 91 psFree(cell->extname); 92 psFree(cell->pixels); 93 psFree(cell->header); 94 } 95 } 96 97 static void readoutFree(pmReadout *readout) 93 98 { 94 99 if (readout != NULL) { 95 100 psFree(readout->image); 96 101 psFree(readout->mask); 97 psFree(readout->objects); 98 psFree(readout->metadata); 99 } 100 } 101 102 /* 103 static void observatoryFree(psObservatory* obs) 104 { 105 if (obs != NULL) { 106 psFree(obs->name); 107 } 108 } 109 */ 110 /* 111 static void exposureFree(psExposure* exp) 112 { 113 if (exp != NULL) { 114 psFree(exp->time); 115 psFree(exp->observatory); 116 psFree(exp->cameraName); 117 psFree(exp->telescopeName); 118 } 119 } 120 */ 121 /* 122 static void fixedPatternFree(psFixedPattern* fp) 123 { 124 if (fp != NULL) { 125 for (psS32 i = 0; i < fp->p_ps_xRows; i++) { 126 psFree(fp->x[i]); 127 } 128 129 for (psS32 j = 0; j < fp->p_ps_yRows; j++) { 130 psFree(fp->y[j]); 131 } 132 133 psFree(fp->x); 134 psFree(fp->y); 135 } 136 } 137 */ 102 psFree(readout->analysis); 103 psFree(readout->concepts); 104 psFree(readout->parent); 105 } 106 } 107 108 109 pmReadout *pmReadoutAlloc(pmCell *cell) 110 { 111 pmReadout *tmpReadout = (pmReadout *) psAlloc(sizeof(pmReadout)); 112 113 tmpReadout->col0 = -1; 114 tmpReadout->row0 = -1; 115 tmpReadout->colBins = -1; 116 tmpReadout->rowBins = -1; 117 tmpReadout->image = NULL; 118 tmpReadout->mask = NULL; 119 tmpReadout->analysis = psMetadataAlloc(); 120 tmpReadout->concepts = psMetadataAlloc(); 121 tmpReadout->parent = cell; 122 123 if (cell != NULL) { 124 cell->readouts = psArrayAdd(cell->readouts, 1, (psPtr) tmpReadout); 125 } 126 psMemSetDeallocator(tmpReadout, (psFreeFunc) readoutFree); 127 return(tmpReadout); 128 } 129 130 pmCell *pmCellAlloc(pmChip *chip) 131 { 132 pmCell *tmpCell = (pmCell *) psAlloc(sizeof(pmCell)); 133 134 tmpCell->col0 = -1; 135 tmpCell->row0 = -1; 136 tmpCell->toChip = NULL; 137 tmpCell->toFPA = NULL; 138 tmpCell->toSky = NULL; 139 tmpCell->analysis = psMetadataAlloc(); 140 tmpCell->concepts = psMetadataAlloc(); 141 tmpCell->readouts = psArrayAlloc(0); 142 tmpCell->parent = chip; 143 if (chip != NULL) { 144 chip->cells = psArrayAdd(chip->cells, 1, (psPtr) tmpCell); 145 } 146 tmpCell->valid = false; 147 tmpCell->extname = NULL; 148 tmpCell->pixels = NULL; 149 tmpCell->header = NULL; 150 151 psMemSetDeallocator(tmpCell, (psFreeFunc) cellFree); 152 return(tmpCell); 153 } 154 155 pmChip *pmChipAlloc(pmFPA *fpa) 156 { 157 pmChip *tmpChip = (pmChip *) psAlloc(sizeof(pmChip)); 158 159 tmpChip->col0 = -1; 160 tmpChip->row0 = -1; 161 tmpChip->toFPA = NULL; 162 tmpChip->fromFPA = NULL; 163 tmpChip->concepts = psMetadataAlloc(); 164 tmpChip->analysis = psMetadataAlloc(); 165 tmpChip->cells = psArrayAlloc(0); 166 tmpChip->parent = fpa; 167 if (fpa != NULL) { 168 fpa->chips = psArrayAdd(fpa->chips, 1, (psPtr) tmpChip); 169 } 170 tmpChip->valid = false; 171 tmpChip->extname = NULL; 172 tmpChip->pixels = NULL; 173 tmpChip->header = NULL; 174 175 psMemSetDeallocator(tmpChip, (psFreeFunc) chipFree); 176 return(tmpChip); 177 } 178 179 pmFPA *pmFPAAlloc( 180 const psMetadata *camera, 181 psDB *db) 182 { 183 pmFPA *tmpFPA = (pmFPA *) psAlloc(sizeof(pmFPA)); 184 185 tmpFPA->fromTangentPlane = NULL; 186 tmpFPA->toTangentPlane = NULL; 187 tmpFPA->projection = NULL; 188 tmpFPA->concepts = psMetadataAlloc(); 189 tmpFPA->analysis = psMetadataAlloc(); 190 tmpFPA->camera = camera; 191 tmpFPA->chips = psArrayAlloc(0); 192 tmpFPA->header = NULL; 193 tmpFPA->db = db; 194 195 psMemSetDeallocator(tmpFPA, (psFreeFunc) FPAFree); 196 return(tmpFPA); 197 } 198 199 bool cellCheckParents(pmCell *cell) 200 { 201 if (cell == NULL) { 202 return(true); 203 } 204 psBool flag = true; 205 206 for (psS32 i = 0 ; i < cell->readouts->n ; i++) { 207 pmReadout *tmpReadout = (pmReadout *) cell->readouts->data[i]; 208 PS_ASSERT_PTR_NON_NULL(tmpReadout, false); 209 if (tmpReadout->parent != cell) { 210 tmpReadout->parent = cell; 211 flag = false; 212 } 213 } 214 return(flag); 215 } 216 217 bool chipCheckParents(pmChip *chip) 218 { 219 if (chip == NULL) { 220 return(true); 221 } 222 psBool flag = true; 223 224 for (psS32 i = 0 ; i < chip->cells->n ; i++) { 225 pmCell *tmpCell = (pmCell *) chip->cells->data[i]; 226 PS_ASSERT_PTR_NON_NULL(tmpCell, false); 227 if (tmpCell->parent != chip) { 228 tmpCell->parent = chip; 229 flag = false; 230 } 231 232 flag &= cellCheckParents(tmpCell); 233 } 234 return(flag); 235 } 236 237 bool pmFPACheckParents(pmFPA *fpa) 238 { 239 if (fpa == NULL) { 240 return(true); 241 } 242 psBool flag = true; 243 244 for (psS32 i = 0 ; i < fpa->chips->n ; i++) { 245 pmChip *tmpChip = (pmChip *) fpa->chips->data[i]; 246 PS_ASSERT_PTR_NON_NULL(tmpChip, false); 247 if (tmpChip->parent != fpa) { 248 tmpChip->parent = fpa; 249 flag = false; 250 } 251 252 flag &= chipCheckParents(tmpChip); 253 } 254 return(flag); 255 } 256 257 258 259 // HEY 138 260 /*****************************************************************************/ 139 261 /* FUNCTION IMPLEMENTATION - PUBLIC */ 140 262 /*****************************************************************************/ 141 263 142 /* 143 * XXX: Verify that you interpreted the SDR correctly. 144 * 145 * XXX: This assumes that x,y must be of type F64 146 */ 147 /* 148 psFixedPattern* psFixedPatternAlloc(double x0, 149 double y0, 150 double xScale, 151 double yScale, 152 const psImage *x, 153 const psImage *y) 154 { 155 psFixedPattern *tmp; 156 psS32 i; 157 psS32 j; 158 159 PS_ASSERT_IMAGE_NON_NULL(x, NULL); 160 PS_ASSERT_IMAGE_NON_NULL(y, NULL); 161 PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL); 162 PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL); 163 164 tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern)); 165 // XXX: Is this correct? 166 tmp->nX = (x->numCols * x->numRows); 167 tmp->nY = (y->numCols * y->numRows); 168 tmp->x0 = x0; 169 tmp->y0 = y0; 170 tmp->xScale = xScale; 171 tmp->yScale = yScale; 172 tmp->p_ps_xRows = x->numRows; 173 tmp->p_ps_xCols = x->numCols; 174 tmp->p_ps_yRows = y->numRows; 175 tmp->p_ps_yCols = y->numCols; 176 tmp->x = (double **) psAlloc(x->numRows * sizeof(double *)); 177 for (i=0;i<x->numRows;i++) { 178 (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double)); 179 } 180 for (i=0;i<x->numRows;i++) { 181 for (j=0;j<x->numCols;j++) { 182 (tmp->x)[i][j] = x->data.F64[i][j]; 183 } 184 } 185 186 tmp->y = (double **) psAlloc(y->numRows * sizeof(double *)); 187 for (i=0;i<y->numRows;i++) { 188 (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double)); 189 } 190 for (i=0;i<y->numRows;i++) { 191 for (j=0;j<y->numCols;j++) { 192 (tmp->y)[i][j] = y->data.F64[i][j]; 193 } 194 } 195 196 psMemSetDeallocator(tmp,(psFreeFunc)fixedPatternFree); 197 198 return(tmp); 199 } 200 */ 201 /* 202 psExposure* psExposureAlloc(double ra, 203 double dec, 204 double hourAngle, 205 double zenithDistance, 206 double azimuth, 207 const psTime* time, 208 float rotAngle, 209 float temperature, 210 float pressure, 211 float humidity, 212 float exposureTime, 213 float wavelength, 214 const psObservatory* observatory) 215 { 216 PS_ASSERT_PTR_NON_NULL(observatory, NULL); 217 218 psExposure* exp = psAlloc(sizeof(psExposure)); 219 *(double *)&exp->ra = ra; 220 *(double *)&exp->dec = dec; 221 *(double *)&exp->hourAngle = hourAngle; 222 *(double *)&exp->zenithDistance = zenithDistance; 223 *(double *)&exp->azimuth = azimuth; 224 *(float *)&exp->rotAngle = rotAngle; 225 *(float *)&exp->temperature = temperature; 226 *(float *)&exp->pressure = pressure; 227 *(float *)&exp->humidity = humidity; 228 *(float *)&exp->exposureTime = exposureTime; 229 *(float *)&exp->wavelength = wavelength; 230 231 exp->time = psMemIncrRefCounter((psPtr)time); 232 exp->observatory = psMemIncrRefCounter((psPtr)observatory); 233 234 // XXX: how is this value derived? 235 *(double *)&exp->lst = psTimeToLMST((psTime*)time,observatory->longitude); 236 *(float *)&exp->positionAngle = 0.0f; // XXX: need input, see Bug #207 237 *(float *)&exp->parallacticAngle = 0.0f; // XXX: need input, see Bug #207 238 *(float *)&exp->airmass = 0.0f; // XXX: needs calculation! = slaAirmas(zenithDistance); 239 *(float *)&exp->parallacticFactor = 0.0f; 240 exp->cameraName = NULL; 241 exp->telescopeName = NULL; 242 243 psMemSetDeallocator(exp,(psFreeFunc)exposureFree); 244 245 return exp; 246 } 247 */ 248 /* 249 psObservatory* psObservatoryAlloc(const char* name, 250 double latitude, 251 double longitude, 252 double height, 253 double tlr) 254 { 255 psObservatory* obs = psAlloc(sizeof(psObservatory)); 256 257 if (name == NULL) { 258 obs->name = NULL; 259 } else { 260 obs->name = psAlloc(strlen(name)+1); 261 strcpy((char*)obs->name, name); 262 } 263 264 *(double *)&obs->latitude = latitude; 265 *(double *)&obs->longitude = longitude; 266 *(double *)&obs->height = height; 267 *(double *)&obs->tlr = tlr; 268 269 psMemSetDeallocator(obs,(psFreeFunc)observatoryFree); 270 271 return obs; 272 } 273 */ 274 /* 275 psFPA* psFPAAlloc(psS32 nChips, 276 const psExposure* exp) 277 { 278 PS_ASSERT_INT_NONNEGATIVE(nChips, NULL); 279 280 psFPA* newFPA = psAlloc(sizeof(psFPA)); 281 282 // create array of NULL chips of the size nChips 283 newFPA->chips = psArrayAlloc(nChips); 284 psPtr* chips = newFPA->chips->data; 285 for (psS32 i=0;i<nChips;i++) { 286 chips[i] = NULL; 287 } 288 newFPA->chips->n = 0; // per requirement 289 290 newFPA->metadata = NULL; 291 newFPA->fromTangentPlane = NULL; 292 newFPA->toTangentPlane = NULL; 293 newFPA->pattern = NULL; 294 295 if (exp != NULL) { 296 newFPA->exposure = psMemIncrRefCounter((psExposure*)exp); 297 newFPA->grommit = psGrommitAlloc(exp); 298 } else { 299 newFPA->exposure = NULL; 300 newFPA->grommit = NULL; 301 } 302 303 newFPA->colorPlus = NULL; 304 newFPA->colorMinus = NULL; 305 newFPA->projection = NULL; 306 307 newFPA->rmsX = 0.0f; 308 newFPA->rmsY = 0.0f; 309 newFPA->chi2 = 0.0f; 310 311 psMemSetDeallocator(newFPA,(psFreeFunc)FPAFree); 312 313 return newFPA; 314 } 315 */ 316 /* 317 * psChip constructor 318 */ 319 /* 320 psChip* psChipAlloc(psS32 nCells, 321 psFPA *parentFPA) 322 { 323 PS_ASSERT_INT_NONNEGATIVE(nCells, NULL); 324 325 psChip* chip = psAlloc(sizeof(psChip)); 326 327 // create array of NULL psCells 328 int n = (nCells > 0) ? nCells : 1; 329 chip->cells = psArrayAlloc(n); 330 psPtr* cells = chip->cells->data; 331 for (psS32 i=0;i<n;i++) { 332 cells[i] = NULL; 333 } 334 chip->cells->n = 0; // per requirement 335 336 *(int*)&chip->row0 = 0; 337 *(int*)&chip->col0 = 0; 338 339 chip->metadata = NULL; 340 341 chip->toFPA = NULL; 342 chip->fromFPA = NULL; 343 344 chip->parent = parentFPA; 345 346 psMemSetDeallocator(chip,(psFreeFunc)chipFree); 347 348 return chip; 349 350 } 351 */ 352 /* 353 * psCell constructor 354 */ 355 /* 356 psCell* psCellAlloc(psS32 nReadouts, 357 psChip* parentChip) 358 { 359 PS_ASSERT_INT_NONNEGATIVE(nReadouts, NULL); 360 361 psCell* cell = psAlloc(sizeof(psCell)); 362 363 // create array of NULL psReadouts 364 int n = (nReadouts > 0) ? nReadouts : 1; 365 cell->readouts = psArrayAlloc(n); 366 psPtr* readouts = cell->readouts->data; 367 for (psS32 i=0;i<n;i++) { 368 readouts[i] = NULL; 369 } 370 cell->readouts->n = 0; // per requirement 371 372 *(int*)&cell->row0 = 0; 373 *(int*)&cell->col0 = 0; 374 375 cell->metadata = NULL; 376 377 cell->toChip = NULL; 378 cell->fromChip = NULL; 379 cell->toFPA = NULL; 380 cell->toTP = NULL; 381 cell->toSky = NULL; 382 383 cell->parent = parentChip; 384 385 psMemSetDeallocator(cell,(psFreeFunc)cellFree); 386 387 return cell; 388 389 390 } 391 */ 392 393 psReadout *pmReadoutAlloc(pmCell *cell) 394 { 395 psReadout* readout = psAlloc(sizeof(psReadout)); 396 397 *(psU32*)&readout->colBins = 1; 398 *(psU32*)&readout->rowBins = 1; 399 *(psU32*)&readout->rowParity = 0; 400 *(psU32*)&readout->colParity = 0; 401 *(psS32*)&readout->col0 = 0; 402 *(psS32*)&readout->row0 = 0; 403 404 readout->image = NULL; 405 readout->mask = NULL; 406 readout->objects = NULL; 407 readout->metadata = NULL; 408 409 psMemSetDeallocator(readout,(psFreeFunc)readoutFree); 410 411 return readout; 412 } 413 414 /* 415 psGrommit* psGrommitAlloc(const psExposure* exp) 416 { 417 PS_ASSERT_PTR_NON_NULL(exp, NULL); 418 419 psSphere* polarMotion = p_psTimeGetPoleCoords(exp->time); 420 421 psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit)); 422 423 *(double*)&grommit->latitude = exp->observatory->latitude; 424 *(double*)&grommit->longitude = exp->observatory->longitude; 425 *(double*)&grommit->height = exp->observatory->height; 426 *(double*)&grommit->abberationMag = 0.0; // XXX: need to figure out what to set here. 427 *(double*)&grommit->temperature = exp->temperature; 428 *(double*)&grommit->pressure = exp->pressure; 429 *(double*)&grommit->humidity = exp->humidity; 430 *(double*)&grommit->wavelength = exp->wavelength; 431 *(double*)&grommit->lapseRate = exp->observatory->tlr; 432 *(double*)&grommit->refractA = polarMotion->r; // XXX: need to figure out what to set here too. 433 *(double*)&grommit->refractB = polarMotion->d; // XXX: need to figure out what to set here too. 434 *(double*)&grommit->siderealTime = psTimeToMJD(exp->time); // XXX: this is probably not correct 435 436 psFree(polarMotion); 437 438 return (grommit); 439 } 440 */ 441 /* 442 psCell* psCellInFPA(const psPlane* fpaCoord, 443 const psFPA* FPA) 264 pmCell* pmCellInFPA(const psPlane* fpaCoord, 265 const pmFPA* FPA) 444 266 { 445 267 PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL); 446 268 PS_ASSERT_PTR_NON_NULL(FPA, NULL); 447 448 p sChip* tmpChip = NULL;269 270 pmChip* tmpChip = NULL; 449 271 psPlane chipCoord; 450 p sCell* outCell = NULL;451 272 pmCell* outCell = NULL; 273 452 274 // Determine which chip contains the fpaCoords. 453 tmpChip = p sChipInFPA(fpaCoord, FPA);275 tmpChip = pmChipInFPA(fpaCoord, FPA); 454 276 if (tmpChip == NULL) { 455 277 return(NULL); 456 278 } 457 279 458 280 // Convert to those chip coordinates. 459 281 psCoordFPAToChip(&chipCoord, fpaCoord, tmpChip); 460 282 461 283 // Determine which cell contains those chip coordinates. 462 outCell = p sCellInChip(&chipCoord, tmpChip);463 284 outCell = pmCellInChip(&chipCoord, tmpChip); 285 464 286 return (outCell); 465 287 } 466 */ 467 /* 468 psChip* psChipInFPA(const psPlane* fpaCoord, 469 const psFPA* FPA) 288 289 pmChip* pmChipInFPA(const psPlane* fpaCoord, 290 const pmFPA* FPA) 470 291 { 471 292 PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL); 472 293 PS_ASSERT_PTR_NON_NULL(FPA, NULL); 473 294 PS_ASSERT_PTR_NON_NULL(FPA->chips, NULL); 474 295 475 296 psArray* chips = FPA->chips; 476 297 psS32 nChips = chips->n; 477 298 psPlane chipCoord; 478 p sCell *tmpCell = NULL;479 299 pmCell *tmpCell = NULL; 300 480 301 // Loop through every chip in this FPA. Convert the original FPA 481 302 // coordinates to chip coordinates for that chip. Then, determine if any 482 303 // cells in that chip contain those chip coordinates. 483 304 484 305 for (psS32 i = 0; i < nChips; i++) { 485 p sChip* tmpChip = chips->data[i];306 pmChip* tmpChip = chips->data[i]; 486 307 PS_ASSERT_PTR_NON_NULL(tmpChip, NULL); 487 308 PS_ASSERT_PTR_NON_NULL(tmpChip->fromFPA, NULL); 488 309 489 310 psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord); 490 491 tmpCell = p sCellInChip(&chipCoord, tmpChip);311 312 tmpCell = pmCellInChip(&chipCoord, tmpChip); 492 313 if (tmpCell != NULL) { 493 314 return(tmpChip); 494 315 } 495 316 } 496 317 497 318 // XXX: Print warning here? 498 319 return (NULL); 499 320 } 500 */ 501 /* 502 p sCell* psCellInChip(const psPlane* chipCoord,503 const p sChip* chip)321 322 323 pmCell* pmCellInChip(const psPlane* chipCoord, 324 const pmChip* chip) 504 325 { 505 326 PS_ASSERT_PTR_NON_NULL(chipCoord, NULL); 506 327 PS_ASSERT_PTR_NON_NULL(chip, NULL); 507 328 508 329 psPlane cellCoord; 509 330 psArray* cells; 510 331 511 332 cells = chip->cells; 512 333 if (cells == NULL) { 513 334 return NULL; 514 335 } 515 336 516 337 // We loop over each cell in the chip. We transform the chipCoord into 517 338 // a cellCoord for that cell and determine if that cellCoord is valid. 518 339 // If so, then we return that cell. 519 340 520 341 for (psS32 i = 0; i < cells->n; i++) { 521 p sCell* tmpCell = (psCell* ) cells->data[i];342 pmCell* tmpCell = (pmCell* ) cells->data[i]; 522 343 PS_ASSERT_PTR_NON_NULL(tmpCell, NULL); 523 PS_ASSERT_PTR_NON_NULL(tmpCell->fromChip, NULL); 344 345 psPlaneTransform *chipToCell = NULL; 346 if (1 != p_psIsProjectionLinear(tmpCell->toChip)) { 347 // XXX: Generate warning message. 348 // XXX: Can we use the following function to derive a transform? 349 // chipToCell = psPlaneTransformInvert(NULL, tmpCell->toChip, NULL, -1); 350 } else { 351 chipToCell = p_psPlaneTransformLinearInvert(tmpCell->toChip); 352 } 353 354 PS_ASSERT_PTR_NON_NULL(chipToCell, NULL); 524 355 psArray* readouts = tmpCell->readouts; 525 356 526 357 if (readouts != NULL) { 527 358 for (psS32 j = 0; j < readouts->n; j++) { 528 p sReadout* tmpReadout = readouts->data[j];359 pmReadout* tmpReadout = readouts->data[j]; 529 360 PS_ASSERT_READOUT_NON_NULL(tmpReadout, NULL); 530 361 531 362 psPlaneTransformApply(&cellCoord, 532 tmpCell->fromChip,363 chipToCell, 533 364 chipCoord); 534 365 535 366 if (checkValidImageCoords(cellCoord.x, 536 367 cellCoord.y, … … 540 371 } 541 372 } 542 } 543 373 psFree(chipToCell); 374 } 375 544 376 return (NULL); 545 377 } 546 */ 547 /* 378 379 548 380 psPlane* psCoordCellToChip(psPlane* outCoord, 549 381 const psPlane* inCoord, 550 const p sCell* cell)382 const pmCell* cell) 551 383 { 552 384 PS_ASSERT_PTR_NON_NULL(inCoord, NULL); 553 385 PS_ASSERT_PTR_NON_NULL(cell, NULL); 554 386 555 387 return (psPlaneTransformApply(outCoord, cell->toChip, inCoord)); 556 388 } 557 */ 558 /* 389 390 559 391 psPlane* psCoordChipToFPA(psPlane* outCoord, 560 392 const psPlane* inCoord, 561 const p sChip* chip)393 const pmChip* chip) 562 394 { 563 395 PS_ASSERT_PTR_NON_NULL(inCoord, NULL); 564 396 PS_ASSERT_PTR_NON_NULL(chip, NULL); 565 397 566 398 return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord)); 567 399 } 568 */ 569 /* 400 401 402 570 403 psPlane* psCoordFPAToTP(psPlane* outCoord, 571 404 const psPlane* inCoord, 572 405 double color, 573 406 double magnitude, 574 const p sFPA* fpa)407 const pmFPA* fpa) 575 408 { 576 409 PS_ASSERT_PTR_NON_NULL(inCoord, NULL); 577 410 PS_ASSERT_PTR_NON_NULL(fpa, NULL); 578 411 579 412 return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord, 580 413 color, magnitude)); 581 414 } 582 */ 415 583 416 /***************************************************************************** 584 417 XXX: What about units for the (x,y) coords? 585 418 *****************************************************************************/ 586 /*587 419 psSphere* psCoordTPToSky(psSphere* outSphere, 588 420 const psPlane* tpCoord, 589 const psGrommit* grommit) 421 const psProjection *projection 422 ) 590 423 { 591 424 PS_ASSERT_PTR_NON_NULL(tpCoord, NULL); 592 PS_ASSERT_PTR_NON_NULL(grommit, NULL); 593 425 594 426 if (outSphere == NULL) { 595 427 outSphere = (psSphere* ) psAlloc(sizeof(psSphere)); 596 428 } 597 429 598 430 // XXX: this was done by a SLALIB call -- needs to be reimplemented 599 431 psWarning("Warning! psCoordTPToSky functionality is no longer implemented"); 600 432 // slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit, 601 433 // &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d); 602 434 603 435 return (outSphere); 604 436 } 605 */ 606 /* 437 438 439 607 440 psPlane* psCoordCellToFPA(psPlane* fpaCoord, 608 441 const psPlane* cellCoord, 609 const p sCell* cell)442 const pmCell* cell) 610 443 { 611 444 PS_ASSERT_PTR_NON_NULL(cellCoord, NULL); 612 445 PS_ASSERT_PTR_NON_NULL(cell, NULL); 613 446 614 447 return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord)); 615 448 } 616 */ 617 /* 449 450 451 618 452 psSphere* psCoordCellToSky(psSphere* skyCoord, 619 453 const psPlane* cellCoord, 620 454 double color, 621 455 double magnitude, 622 const p sCell* cell)456 const pmCell* cell) 623 457 { 624 458 PS_ASSERT_PTR_NON_NULL(cellCoord, NULL); … … 628 462 PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL); 629 463 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->toTangentPlane, NULL); 630 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);631 464 // PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL); 465 632 466 psPlane* fpaCoord = NULL; 633 467 psPlane* tpCoord = NULL; 634 p sFPA* parFPA = (cell->parent)->parent;635 psGrommit* tmpGrommit = NULL;636 468 pmFPA* parFPA = (cell->parent)->parent; 469 // psGrommit* tmpGrommit = NULL; 470 637 471 // Convert the input cell coordinates to FPA coordinates. 638 472 fpaCoord = psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord); 639 473 640 474 // Convert the FPA coordinates to tangent plane Coordinates. 641 475 tpCoord = psPlaneDistortApply(tpCoord, parFPA->toTangentPlane, 642 476 fpaCoord, color, magnitude); 643 477 644 478 // Generate a grommit for this FPA. 645 tmpGrommit = psGrommitAlloc(parFPA->exposure);646 479 // tmpGrommit = psGrommitAlloc(parFPA->exposure); 480 647 481 // Convert the tangent plane Coordinates to sky coordinates. 648 skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit);649 482 // skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit); 483 650 484 psFree(fpaCoord); 651 485 psFree(tpCoord); 652 psFree(tmpGrommit);653 486 // psFree(tmpGrommit); 487 654 488 return(skyCoord); 655 489 } 656 657 */ 658 /* 490 491 659 492 psSphere* psCoordCellToSkyQuick(psSphere* outSphere, 660 493 const psPlane* cellCoord, 661 const p sCell* cell)494 const pmCell* cell) 662 495 { 663 496 PS_ASSERT_PTR_NON_NULL(cellCoord, NULL); … … 667 500 PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL); 668 501 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL); 669 if (cell->toSky) { 670 // XXX: Should we use toTP or toSky? 671 psLogMsg(__func__, PS_LOG_WARN, 672 "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored. The cell->toTP transform is being used."); 673 } 674 675 psPlane *tpCoord = NULL; 676 psChip *chip = cell->parent; 677 psFPA *FPA = chip->parent; 678 psProjectionType oldProjectionType; 679 680 if (outSphere == NULL) { 681 outSphere = (psSphere* ) psAlloc(sizeof(psSphere)); 682 } 683 684 // Determine the tangent plane coordinates. 685 tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord); 686 687 // Save the old projection type and set the new projection type to TAN. 688 oldProjectionType = FPA->projection->type; 689 FPA->projection->type = PS_PROJ_TAN; 690 691 // Deproject the tangent plane coordinates a sphere. 692 outSphere = psDeproject(tpCoord, FPA->projection); 693 694 // Restore old projection type. Free memory. 695 FPA->projection->type = oldProjectionType; 696 psFree(tpCoord); 697 698 return (outSphere); 699 } 700 */ 502 503 psLogMsg(__func__, PS_LOG_WARN, 504 "WARNING: psCoordCellToSkyQuick(): This function is not fully specified in the SDRS. Returning NULL.\n"); 505 return(NULL); 506 507 /* 508 if (cell->toSky) { 509 // XXX: Should we use toTP or toSky? 510 psLogMsg(__func__, PS_LOG_WARN, 511 "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored. The cell->toTP transform is being used."); 512 } 513 514 psPlane *tpCoord = NULL; 515 pmChip *chip = cell->parent; 516 pmFPA *FPA = chip->parent; 517 psProjectionType oldProjectionType; 518 519 if (outSphere == NULL) { 520 outSphere = (psSphere* ) psAlloc(sizeof(psSphere)); 521 } 522 523 // Determine the tangent plane coordinates. 524 tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord); 525 526 // Save the old projection type and set the new projection type to TAN. 527 oldProjectionType = FPA->projection->type; 528 FPA->projection->type = PS_PROJ_TAN; 529 530 // Deproject the tangent plane coordinates a sphere. 531 outSphere = psDeproject(tpCoord, FPA->projection); 532 533 // Restore old projection type. Free memory. 534 FPA->projection->type = oldProjectionType; 535 psFree(tpCoord); 536 537 return (outSphere); 538 */ 539 } 540 701 541 702 542 /***************************************************************************** 703 543 XXX: What about units for the (x,y) coords? 704 544 *****************************************************************************/ 705 /*706 545 psPlane* psCoordSkyToTP(psPlane* tpCoord, 707 546 const psSphere* in, 708 const ps Grommit* grommit)547 const psProjection *projection) 709 548 { 710 549 PS_ASSERT_PTR_NON_NULL(in, NULL); 711 PS_ASSERT_PTR_NON_NULL(grommit, NULL);712 550 // PS_ASSERT_PTR_NON_NULL(grommit, NULL); 551 713 552 // char* type = "RA"; 714 553 715 554 if (tpCoord == NULL) { 716 555 tpCoord = (psPlane* ) psAlloc(sizeof(psPlane)); 717 556 } 718 557 719 558 // XXX: this was done by a SLALIB call -- needs to be reimplemented 720 559 psWarning("Warning! psCoordSkyToTP functionality is no longer implemented"); 721 560 // slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y); 722 561 723 562 return(tpCoord); 724 563 } 725 */ 726 /* 564 565 727 566 psPlane* psCoordTPToFPA(psPlane* fpaCoord, 728 567 const psPlane* tpCoord, 729 568 double color, 730 569 double magnitude, 731 const p sFPA* fpa)570 const pmFPA* fpa) 732 571 { 733 572 PS_ASSERT_PTR_NON_NULL(tpCoord, NULL); 734 573 PS_ASSERT_PTR_NON_NULL(fpa, NULL); 735 574 PS_ASSERT_PTR_NON_NULL(fpa->fromTangentPlane, NULL); 736 575 737 576 return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane, 738 577 tpCoord, color, magnitude)); 739 578 } 740 */ 741 /* 579 580 742 581 psPlane* psCoordFPAToChip(psPlane* chipCoord, 743 582 const psPlane* fpaCoord, 744 const p sChip* chip)583 const pmChip* chip) 745 584 { 746 585 PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL); 747 586 PS_ASSERT_PTR_NON_NULL(chip, NULL); 748 587 PS_ASSERT_PTR_NON_NULL(chip->fromFPA, NULL); 749 588 750 589 chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord); 751 590 return(chipCoord); 752 591 } 753 */ 754 /* 592 593 755 594 psPlane* psCoordChipToCell(psPlane* cellCoord, 756 595 const psPlane* chipCoord, 757 const p sCell* cell)596 const pmCell* cell) 758 597 { 759 598 PS_ASSERT_PTR_NON_NULL(chipCoord, NULL); 760 599 PS_ASSERT_PTR_NON_NULL(cell, NULL); 761 PS_ASSERT_PTR_NON_NULL(cell->fromChip, NULL); 762 763 cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord); 600 PS_ASSERT_PTR_NON_NULL(cell->parent, NULL); 601 602 pmCell *tmpCell = pmCellInChip(chipCoord, cell->parent); 603 PS_ASSERT_PTR_NON_NULL(tmpCell->toChip, NULL); 604 psPlaneTransform *tmpChipToCell = p_psPlaneTransformLinearInvert(tmpCell->toChip); 605 PS_ASSERT_PTR_NON_NULL(tmpChipToCell, NULL); 606 cellCoord = psPlaneTransformApply(cellCoord, tmpChipToCell, chipCoord); 607 psFree(tmpChipToCell); 764 608 return(cellCoord); 765 609 } 766 */ 767 /* 610 611 768 612 psPlane* psCoordSkyToCell(psPlane* cellCoord, 769 613 const psSphere* skyCoord, 770 doublecolor,771 doublemagnitude,772 const p sCell* cell)614 float color, 615 float magnitude, 616 const pmCell* cell) 773 617 { 774 618 PS_ASSERT_PTR_NON_NULL(skyCoord, NULL); … … 776 620 PS_ASSERT_PTR_NON_NULL(cell->parent, NULL); 777 621 PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL); 778 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL); 779 780 psChip *parChip = cell->parent; 781 psFPA *parFPA = parChip->parent; 782 psGrommit* grommit = parFPA->grommit; 783 622 // PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL); 623 624 pmChip *parChip = cell->parent; 625 pmFPA *parFPA = parChip->parent; 626 784 627 // Convert the skyCoords to tangent plane coords. 785 psPlane *tpCoord = psCoordSkyToTP( tpCoord, skyCoord, grommit);786 628 psPlane *tpCoord = psCoordSkyToTP(NULL, skyCoord, parFPA->projection); 629 787 630 // Convert the tangent plane coords to FPA coords. 788 psPlane *fpaCoord = psCoordTPToFPA(fpaCoord, tpCoord, color, 789 magnitude, parFPA); 790 631 psPlane *fpaCoord = psCoordTPToFPA(NULL, tpCoord, color, magnitude, parFPA); 632 791 633 // Convert the FPA coords to chip coords. 792 psPlane *chipCoord = psCoordFPAToChip( chipCoord, fpaCoord, parChip);793 634 psPlane *chipCoord = psCoordFPAToChip(NULL, fpaCoord, parChip); 635 794 636 // Convert the chip coords to cell coords. 795 637 cellCoord = psCoordChipToCell(cellCoord, chipCoord, cell); 796 638 797 639 psFree(tpCoord); 798 640 psFree(fpaCoord); 799 641 psFree(chipCoord); 800 642 801 643 return (cellCoord); 802 644 } 803 */ 804 /* 645 646 805 647 psPlane* psCoordSkyToCellQuick(psPlane* cellCoord, 806 648 const psSphere* skyCoord, 807 const p sCell* cell)649 const pmCell* cell) 808 650 { 809 651 PS_ASSERT_PTR_NON_NULL(skyCoord, NULL); … … 812 654 PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL); 813 655 PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL); 814 PS_ASSERT_PTR_NON_NULL(cell->toTP, NULL); 815 if (cell->toSky) { 816 // XXX: Should we use toTP or toSky? 817 psLogMsg(__func__, PS_LOG_WARN, 818 "WARNING: psCoordSkyToCellQuick(): The cell->toSky transform is ignored. The cell->toTP transform is being used."); 819 } 820 821 psPlane *tpCoord = NULL; 822 psChip *whichChip = cell->parent; 823 psFPA *whichFPA = whichChip->parent; 824 psProjectionType oldProjectionType; 825 psPlaneTransform *TPtoCell = NULL; 826 827 // Save the old projection type and set the new projection type to TAN. 828 oldProjectionType = whichFPA->projection->type; 829 whichFPA->projection->type = PS_PROJ_TAN; 830 831 if (cellCoord == NULL) { 832 cellCoord = (psPlane* ) psAlloc(sizeof(psPlane)); 833 } 834 835 tpCoord = psProject(skyCoord, whichFPA->projection); 836 837 // generate an error if cell->toTP is not linear. 838 if (0 == p_psIsProjectionLinear(cell->toTP)) { 839 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 840 PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM, 841 "cell to tangent plane"); 842 } 843 844 TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP); 845 cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord); 846 847 // Restore old projection type. Free memory. 848 whichFPA->projection->type = oldProjectionType; 849 psFree(tpCoord); 850 return (cellCoord); 851 } 852 */ 853 854 656 657 658 psLogMsg(__func__, PS_LOG_WARN, 659 "WARNING: psCoordSkyToCellQuick(): This function is not fully specified in the SDRS. Returning NULL.\n"); 660 return(NULL); 661 /* 662 663 if (cell->toSky) { 664 // XXX: Should we use toTP or toSky? 665 psLogMsg(__func__, PS_LOG_WARN, 666 "WARNING: psCoordSkyToCellQuick: The cell->toSky transform is ignored. The cell->toTP transform is being used."); 667 } 668 669 psPlane *tpCoord = NULL; 670 pmChip *whichChip = cell->parent; 671 pmFPA *whichFPA = whichChip->parent; 672 psProjectionType oldProjectionType; 673 psPlaneTransform *TPtoCell = NULL; 674 675 // Save the old projection type and set the new projection type to TAN. 676 oldProjectionType = whichFPA->projection->type; 677 whichFPA->projection->type = PS_PROJ_TAN; 678 679 if (cellCoord == NULL) { 680 cellCoord = (psPlane* ) psAlloc(sizeof(psPlane)); 681 } 682 683 tpCoord = psProject(skyCoord, whichFPA->projection); 684 685 // generate an error if cell->toTP is not linear. 686 if (0 == p_psIsProjectionLinear(cell->toTP)) { 687 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 688 PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM, 689 "cell to tangent plane"); 690 } 691 692 TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP); 693 cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord); 694 695 // Restore old projection type. Free memory. 696 whichFPA->projection->type = oldProjectionType; 697 psFree(tpCoord); 698 return (cellCoord); 699 */ 700 } 701 702 703 -
trunk/psModules/src/pmAstrometry.h
r4754 r4770 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-08-1 1 00:03:51$10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-08-16 01:10:34 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 143 143 // Information 144 144 psImage *image; ///< Imaging area of readout 145 // XXX: The following mask was removed from the pmReadout struct in recent SDRS 146 // versions. However, I'm keeping it here since al ot of modules still require 147 // it. 148 psImage *mask; ///< Mask of input image 145 149 psMetadata *analysis; ///< Readout-level analysis metadata 146 150 psMetadata *concepts; ///< Cache for PS Concepts 147 151 pmCell *parent; ///< Parent cell 148 152 } 149 psReadout; 150 151 /** Allocates a psReadout 153 pmReadout; 154 155 156 /** Allocates a pmReadout 152 157 * 153 158 * The constructor shall make an empty pmReadout. If the parent cell is not … … 156 161 * other pointers in the structure shall be initialized to NULL. 157 162 * 158 * @return p sReadout* newly allocated psReadout with all internal pointers set to NULL159 */ 160 p sReadout *pmReadoutAlloc(163 * @return pmReadout* newly allocated pmReadout with all internal pointers set to NULL 164 */ 165 pmReadout *pmReadoutAlloc( 161 166 pmCell *cell ///< Parent cell 162 167 ); 163 168 164 /** Allocates a p sCell169 /** Allocates a pmCell 165 170 * 166 171 * The constructor shall make an empty pmCell. If the parent chip is not NULL, 167 * the parent link is made and the cell shall be placed in the parentThe 168 * constructor shall make an empty psCell.s array of cells. The readouts 169 * array shall be allocated with a zero size, and the metadata containers 170 * constructed. All other pointers in the structure shall be initialized to 171 * NULL. 172 * 173 * @return psCell* newly allocated psCell 172 * the parent link is made and the cell shall be placed in the parents array of 173 * cells. The readouts array shall be allocated with a zero size, and the 174 * metadata containers constructed. All other pointers in the structure shall be 175 * initialized to NULL. 176 * 177 * @return pmCell* newly allocated pmCell 174 178 */ 175 179 pmCell *pmCellAlloc( … … 198 202 */ 199 203 pmFPA *pmFPAAlloc( 200 const psMetadata *camera ///< Camera configuration 201 // psDB *db ///< Database handle 202 ); 203 204 const psMetadata *camera, ///< Camera configuration 205 psDB *db ///< Database handle 206 ); 207 208 209 /** Verify parent links. 210 * 211 * This function checks the validity of the parent links in the FPA hierarchy. 212 * If a parent link is not set (or not set correctly), it is corrected, and the 213 * function shall return false. If all the parent pointers were correct, the 214 * function shall return true. 215 * 216 */ 217 bool pmFPACheckParents( 218 pmFPA *fpa 219 ); 220 221 222 223 /** FUNC DESC 224 * 225 * 226 * 227 * 228 */ 204 229 205 230 … … 211 236 212 237 213 214 215 216 217 218 /** Wallace's Grommit219 *220 * SLALib requires several elements to perform the transformations between221 * the tangent plane and the sky. Pre-computing these quantities for each222 * exposure means that subsequent transformations are faster. For historical223 * reasons, this structure is known colloquially as "Wallace's Grommit".224 *225 */226 227 /*228 typedef struct229 {230 const double latitude; ///< geodetic latitude (radians)231 const double longitude; ///< longitude + ... (radians)232 const double height; ///< height (HM)233 const double abberationMag; ///< magnitude of diurnal aberration vector234 const double temperature; ///< ambient temperature (TDK)235 const double pressure; ///< pressure (PMB)236 const double humidity; ///< relative humidity (RH)237 const double wavelength; ///< wavelength (WL)238 const double lapseRate; ///< lapse rate (TLR)239 const double refractA, refractB; ///< refraction constants A and B (radians)240 const double siderealTime; ///< local apparent sidereal time (radians)241 }242 psGrommit;243 */244 245 246 /** Fixed Pattern Corrections247 *248 * The fixed pattern is a correction to the general astrometric solution249 * formed by summing the residuals from many observations. The intent is to250 * correct for higher-order distortions in the camera system on a coarse251 * grid (larger than individual pixels, but smaller than a single cell).252 * Hence, in addition to the offsets, we need to specify the size and scale253 * of the grid in x and y as well as the origin of the grid.254 */255 /*256 typedef struct257 {258 psS32 nX; ///< Number of elements in x direction259 psS32 nY; ///< Number of elements in y direction260 double x0; ///< X Position of 0,0 corner on focal plane261 double y0; ///< Y Position of 0,0 corner on focal plane262 double xScale; ///< Scale of the grid in x direction263 double yScale; ///< Scale of the grid in x direction264 /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures.265 psS32 p_ps_xRows; ///< Number of rows in the x member266 psS32 p_ps_xCols; ///< Number of cols in the x member267 psS32 p_ps_yRows; ///< Number of rows in the y member268 psS32 p_ps_yCols; ///< Number of cols in the y member269 double **x; ///< The grid of offsets in x270 double **y; ///< The grid of offsets in y271 }272 psFixedPattern;273 */274 275 276 /** Observatory Information277 *278 * A container for the observatory data that doesn't change per exposure.279 *280 */281 /*typedef struct282 {283 const char* name; ///< Name of observatory284 const double latitude; ///< Latitude of observatory, east positive (degrees?)285 const double longitude; ///< Longitude of observatory (degrees?)286 const double height; ///< Height of observatory in meters287 const double tlr; ///< Tropospheric Lapse Rate288 }289 psObservatory;290 */291 292 /** Exposure Information293 *294 * Several quantities from the telescope in order to make a first guess at295 * the astrometric solution. From these quantities, further quantities can296 * be derivedand stored for later use.297 *298 */299 /*typedef struct psExposure300 {301 const double ra; ///< Telescope boresight, right ascention302 const double dec; ///< Telescope boresight, declination303 const double hourAngle; ///< Hour angle304 const double zenithDistance; ///< Zenith distance305 const double azimuth; ///< Azimuth306 const psTime* time; ///< Time of observation307 const float rotAngle; ///< Rotator position angle in degrees? XXX: see bug#209308 const float temperature; ///< Air temperature in Kelvin309 const float pressure; ///< Air pressure in mB310 const float humidity; ///< Relative humidity, for refraction311 const float exposureTime; ///< Exposure time312 const float wavelength; ///< Wavelength in microns313 const psObservatory* observatory; ///< Observatory data314 315 // Derived quantities316 const double lst; ///< Local Sidereal Time317 const float positionAngle; ///< Position angle318 const float parallacticAngle; ///< Parallactic angle319 const float airmass; ///< Airmass, calculated from zenith distance320 const float parallacticFactor; ///< Parallactic factor321 const char* cameraName; ///< name of camera which provided exposure322 const char* telescopeName; ///< name of telescope which provided exposure323 }324 psExposure;325 */326 327 /** Allocator for psFixedPattern struct328 *329 * Allocates a new psFixedPattern struct with the attributes coorsponding330 * to the parameters set to the said input values.331 *332 * @return psFixedPattern* New psFixedPattern struct.333 */334 /*psFixedPattern* psFixedPatternAlloc(335 double x0, ///< X Position of 0,0 corner on focal plane336 double y0, ///< Y Position of 0,0 corner on focal plane337 double xScale, ///< Scale of the grid in x direction338 double yScale, ///< Scale of the grid in x direction339 const psImage *x, ///< The grid of offsets in x340 const psImage *y ///< The grid of offsets in y341 );342 */343 344 /** Allocator for psExposure345 *346 * We need several quantities from the telescope in order to make a first347 * guess at the astrometric solution. From these quantities, further348 * quantities can be derived and stored for later use.349 *350 * @return psExposure* New psExposure struct351 */352 /*psExposure* psExposureAlloc(353 double ra, ///< Telescope boresight, right ascention354 double dec, ///< Telescope boresight, declination355 double hourAngle, ///< Hour angle356 double zenithDistance, ///< Zenith distance357 double azimuth, ///< Azimuth358 const psTime* time, ///< time of observation359 float rotAngle, ///< Rotator position angle360 float temperature, ///< Temperature361 float pressure, ///< Pressure362 float humidity, ///< Relative humidity363 float exposureTime, ///< Exposure time364 float wavelength, ///< wavelength365 const psObservatory* observatory ///< Observatory data366 );367 */368 369 /** Allocator for psObservatory370 *371 * This function shall construct a new psObservatory with attributes372 * cooresponding to the function parameters.373 *374 * @return psObservatory* new psObservatory struct375 */376 /*psObservatory* psObservatoryAlloc(377 const char* name, ///< Name of observatory378 double latitude, ///< Latitude of observatory, east positive379 double longitude, ///< Longitude of observatory380 double height, ///< Height of observatory381 double tlr ///< Tropospheric Lapse Rate382 );383 */384 385 /** Allocates a Wallace's Grommit structure.386 *387 * The psGrommit is calculated from telescope information for the particular388 * exposure.389 *390 * @return psGrommit* New grommit structure.391 */392 /*psGrommit* psGrommitAlloc(393 const psExposure* exp ///< the cooresponding exposure structure.394 );395 */396 397 238 /** Find cooresponding cell for given FPA coordinate 398 239 * 399 * @return p sCell* the cell cooresponding to the coord in FPA400 */ 401 /*psCell* psCellInFPA(240 * @return pmCell* the cell cooresponding to the coord in FPA 241 */ 242 pmCell* pmCellInFPA( 402 243 const psPlane* coord, ///< the coordinate in FPA plane 403 const p sFPA* FPA ///< the FPA to search for the cell404 ); 405 */ 244 const pmFPA* FPA ///< the FPA to search for the cell 245 ); 246 406 247 407 248 /** Find cooresponding chip for given FPA coordinate 408 249 * 409 * @return p sChip* the chip cooresponding to coord410 */ 411 /*psChip* psChipInFPA(250 * @return pmChip* the chip cooresponding to coord 251 */ 252 pmChip* pmChipInFPA( 412 253 const psPlane* coord, ///< the coordinate in FPA plane 413 const p sFPA* FPA ///< the FPA to search for the cell414 ); 415 */ 254 const pmFPA* FPA ///< the FPA to search for the cell 255 ); 256 416 257 417 258 /** Find cooresponding cell for given Chip coordinate 418 259 * 419 * @return p sCell* the cell cooresponding to coord420 */ 421 /*psCell* psCellInChip(260 * @return pmCell* the cell cooresponding to coord 261 */ 262 pmCell* pmCellInChip( 422 263 const psPlane* coord, ///< the coordinate in Chip plane 423 const p sChip* chip ///< the chip to search for the cell424 ); 425 */ 264 const pmChip* chip ///< the chip to search for the cell 265 ); 266 426 267 427 268 /** Translate a cell coordinate into a chip coordinate … … 429 270 * @return psPlane* the resulting chip coordinate 430 271 */ 431 /*psPlane* psCoordCellToChip(272 psPlane* psCoordCellToChip( 432 273 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 433 274 const psPlane* in, ///< the coordinate within Cell 434 const p sCell* cell ///< the Cell in interest435 ); 436 */ 275 const pmCell* cell ///< the Cell in interest 276 ); 277 437 278 438 279 /** Translate a chip coordinate into a FPA coordinate … … 440 281 * @return psPlane* the resulting FPA coordinate 441 282 */ 442 /*psPlane* psCoordChipToFPA(283 psPlane* psCoordChipToFPA( 443 284 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 444 285 const psPlane* in, ///< the coordinate within Chip 445 const p sChip* chip ///< the chip in interest446 ); 447 */ 286 const pmChip* chip ///< the chip in interest 287 ); 288 448 289 449 290 /** Translate a FPA coordinate into a Tangent Plane coordinate … … 451 292 * @return psPlane* the resulting Tangent Plane coordinate 452 293 */ 453 /*psPlane* psCoordFPAToTP(294 psPlane* psCoordFPAToTP( 454 295 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 455 296 const psPlane* in, ///< the coordinate within FPA 456 297 double color, ///< Color of source 457 298 double magnitude, ///< Magnitude of source 458 const p sFPA* fpa ///< the FPA in interest459 ); 460 */ 299 const pmFPA* fpa ///< the FPA in interest 300 ); 301 461 302 462 303 /** Translate a Tangent Plane coordinate into a Sky coordinate … … 464 305 * @return psSphere* the resulting Sky coordinate 465 306 */ 466 /*psSphere* psCoordTPToSky(307 psSphere* psCoordTPToSky( 467 308 psSphere* out, ///< a sphere struct to recycle. If NULL, a new struct is created 468 const psPlane* in, ///< the coordinate within Tangent Plane 469 const psGrommit* grommit ///< the grommit of the tangent plane 470 ); 471 */ 309 const psPlane* in, ///< the coordinate within Tangent Plane 310 const psProjection *projection 311 ); 472 312 473 313 /** Translate a cell coordinate into a FPA coordinate … … 475 315 * @return psPlane* the resulting FPA coordinate 476 316 */ 477 /*psPlane* psCoordCellToFPA(317 psPlane* psCoordCellToFPA( 478 318 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 479 319 const psPlane* in, ///< the coordinate within cell 480 const p sCell* cell ///< the cell in interest481 ); 482 */ 320 const pmCell* cell ///< the cell in interest 321 ); 322 483 323 484 324 /** Translate a cell coordinate into a Sky coordinate … … 486 326 * @return psSphere* the resulting Sky coordinate 487 327 */ 488 /*psSphere* psCoordCellToSky(328 psSphere* psCoordCellToSky( 489 329 psSphere* out, ///< a sphere struct to recycle. If NULL, a new struct is created 490 330 const psPlane* in, ///< the coordinate within cell 491 331 double color, ///< Color of source 492 332 double magnitude, ///< Magnitude of source 493 const p sCell* cell ///< the cell in interest494 ); 495 */ 333 const pmCell* cell ///< the cell in interest 334 ); 335 496 336 497 337 /** Translate a cell coordinate into a Sky coordinate using a 'quick and … … 500 340 * @return psSphere* the resulting Sky coordinate 501 341 */ 502 /*psSphere* psCoordCellToSkyQuick(342 psSphere* psCoordCellToSkyQuick( 503 343 psSphere* out, ///< a sphere struct to recycle. If NULL, a new struct is created 504 344 const psPlane* in, ///< the coordinate within cell 505 const p sCell* cell ///< the cell in interest506 ); 507 */ 345 const pmCell* cell ///< the cell in interest 346 ); 347 508 348 509 349 /** Translate a Sky coordinate into a Tangent Plane coordinate … … 511 351 * @return psPlane* the resulting Tangent Plane coordinate 512 352 */ 513 /*psPlane* psCoordSkyToTP(353 psPlane* psCoordSkyToTP( 514 354 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 515 355 const psSphere* in, ///< the sky coordinate 516 const psGrommit* grommit ///< the grommit 517 ); 518 */ 356 const psProjection *projection 357 ); 519 358 520 359 /** Translate a Tangent Plane coordinate into a FPA coordinate … … 522 361 * @return psPlane* the resulting FPA coordinate 523 362 */ 524 /*psPlane* psCoordTPToFPA(363 psPlane* psCoordTPToFPA( 525 364 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 526 365 const psPlane* in, ///< the coordinate within tangent plane 527 366 double color, ///< Color of source 528 367 double magnitude, ///< Magnitude of source 529 const p sFPA* fpa ///< the FPA of interest530 ); 531 */ 368 const pmFPA* fpa ///< the FPA of interest 369 ); 370 532 371 533 372 /** Translate a FPA coordinate into a chip coordinate … … 535 374 * @return psPlane* the resulting chip coordinate 536 375 */ 537 /*psPlane* psCoordFPAToChip(376 psPlane* psCoordFPAToChip( 538 377 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 539 378 const psPlane* in, ///< the FPA coordinate 540 const p sChip* chip ///< the chip of interest541 ); 542 */ 379 const pmChip* chip ///< the chip of interest 380 ); 381 543 382 544 383 /** Translate a chip coordinate into a cell coordinate … … 546 385 * @return psPlane* the resulting cell coordinate 547 386 */ 548 /*psPlane* psCoordChipToCell(387 psPlane* psCoordChipToCell( 549 388 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 550 389 const psPlane* in, ///< the Chip coordinate 551 const p sCell* cell ///< the cell of interest552 ); 553 */ 390 const pmCell* cell ///< the cell of interest 391 ); 392 554 393 555 394 /** Translate a sky coordinate into a cell coordinate … … 557 396 * @return psPlane* the resulting cell coordinate 558 397 */ 559 /*psPlane* psCoordSkyToCell(398 psPlane* psCoordSkyToCell( 560 399 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 561 400 const psSphere* in, ///< the Sky coordinate 562 double color,///< Color of source563 double magnitude,///< Magnitude of source564 const p sCell* cell ///< the cell of interest565 ); 566 */ 401 float color, ///< Color of source 402 float magnitude, ///< Magnitude of source 403 const pmCell* cell ///< the cell of interest 404 ); 405 567 406 568 407 /** Translate a sky coordinate into a cell coordinate using a 'quick and … … 571 410 * @return psPlane* the resulting cell coordinate 572 411 */ 573 /*psPlane* psCoordSkyToCellQuick(412 psPlane* psCoordSkyToCellQuick( 574 413 psPlane* out, ///< a plane struct to recycle. If NULL, a new struct is created 575 414 const psSphere* in, ///< the Sky coordinate 576 const p sCell* cell ///< the cell of interest577 ); 578 */ 415 const pmCell* cell ///< the cell of interest 416 ); 417 579 418 580 419 #endif // #ifndef PS_ASTROMETRY_H -
trunk/psModules/src/pmFlatField.c
r2299 r4770 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $21 * @date $Date: 200 4-11-06 02:42:03$20 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-08-16 01:10:34 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 38 38 39 39 40 bool pmFlatField(p sReadout *in, const psReadout *flat)40 bool pmFlatField(pmReadout *in, pmReadout *mask, const pmReadout *flat) 41 41 { 42 // XXX: Not sure if this is correct. Must consult with IfA. 43 PS_ASSERT_PTR_NON_NULL(mask, false); 42 44 int i = 0; 43 45 int j = 0; … … 71 73 PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE); 72 74 return false; 73 } else if(in->mask == NULL) {74 in->mask = psImageAlloc(inImage->numCols, inImage->numRows, PS_TYPE_MASK);75 memset(in->mask->data.V[0], 0, inImage->numCols*inImage->numRows*PSELEMTYPE_SIZEOF(PS_TYPE_MASK));76 75 } 77 inMask = in->mask;76 inMask = mask->image; 78 77 79 78 // Check input image and its mask are not larger than flat image 79 80 80 if(inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) { 81 81 psError( PS_ERR_BAD_PARAMETER_SIZE, true, -
trunk/psModules/src/pmFlatField.h
r4754 r4770 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-08-1 1 00:03:51$20 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-08-16 01:10:34 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 36 36 */ 37 37 bool pmFlatField( 38 psReadout *in, ///< Redout with input image and mask 39 const psReadout *flat ///< Readout with flat image 38 pmReadout *in, ///< Readout with input image 39 pmReadout *mask, ///< Input image mask 40 const pmReadout *flat ///< Readout with flat image 40 41 ); 41 42 -
trunk/psModules/src/pmMaskBadPixels.c
r2275 r4770 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $22 * @date $Date: 200 4-11-04 02:02:10$21 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2005-08-16 01:10:34 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 36 36 #include "pmMaskBadPixelsErrors.h" 37 37 38 bool pmMaskBadPixels(p sReadout *in, const psImage *mask, unsigned int maskVal, float sat,38 bool pmMaskBadPixels(pmReadout *in, const psImage *mask, unsigned int maskVal, float sat, 39 39 unsigned int growVal, int grow) 40 40 { -
trunk/psModules/src/pmMaskBadPixels.h
r4754 r4770 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $22 * @date $Date: 2005-08-1 1 00:03:51$21 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2005-08-16 01:10:34 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 52 52 */ 53 53 bool pmMaskBadPixels( 54 p sReadout *in, ///< Readout containing input image data.54 pmReadout *in, ///< Readout containing input image data. 55 55 const psImage *mask, ///< Mask data to be added to readout mask data. 56 56 unsigned int maskVal, ///< Mask value to determine what to add to input mask. -
trunk/psModules/src/pmNonLinear.c
r4030 r4770 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 5-25 20:28:32$7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-08-16 01:10:34 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 25 25 /****************************************************************************** 26 pmNonLinearityLookup(): This routine will take an p sReadout image as input26 pmNonLinearityLookup(): This routine will take an pmReadout image as input 27 27 and a 1-D polynomial. For each pixel in the input image, the polynomial will 28 28 be evaluated at that pixels value, and the image pixel will then be set to … … 30 30 *****************************************************************************/ 31 31 32 p sReadout *pmNonLinearityPolynomial(psReadout *inputReadout,32 pmReadout *pmNonLinearityPolynomial(pmReadout *inputReadout, 33 33 const psPolynomial1D *input1DPoly) 34 34 { … … 51 51 52 52 /****************************************************************************** 53 pmNonLinearityLookup(): This routine will take an p sReadout image as input53 pmNonLinearityLookup(): This routine will take an pmReadout image as input 54 54 and two input vectors, which constitute a lookup table. For each pixel in 55 55 the input image, that pixels value will be determined in the input vector … … 57 57 be set to the value from outFlux. 58 58 *****************************************************************************/ 59 p sReadout *pmNonLinearityLookup(psReadout *inputReadout,59 pmReadout *pmNonLinearityLookup(pmReadout *inputReadout, 60 60 const psVector *inFlux, 61 61 const psVector *outFlux) -
trunk/psModules/src/pmNonLinear.h
r4754 r4770 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-08-1 1 00:03:51$7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-08-16 01:10:34 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 18 18 #include "pmAstrometry.h" 19 19 20 p sReadout *pmNonLinearityPolynomial(psReadout *in,20 pmReadout *pmNonLinearityPolynomial(pmReadout *in, 21 21 const psPolynomial1D *coeff); 22 22 23 p sReadout *pmNonLinearityLookup(psReadout *in,23 pmReadout *pmNonLinearityLookup(pmReadout *in, 24 24 const psVector *inFlux, 25 25 const psVector *outFlux); -
trunk/psModules/src/pmObjects.c
r4579 r4770 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 7-19 01:44:48$8 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-16 01:10:34 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 21 21 /****************************************************************************** 22 pmPeakAlloc(): Allocate the p sPeak data structure and set appropriate members.23 *****************************************************************************/ 24 p sPeak *pmPeakAlloc(psS32 x,22 pmPeakAlloc(): Allocate the pmPeak data structure and set appropriate members. 23 *****************************************************************************/ 24 pmPeak *pmPeakAlloc(psS32 x, 25 25 psS32 y, 26 26 psF32 counts, 27 p sPeakType class)28 { 29 p sPeak *tmp = (psPeak *) psAlloc(sizeof(psPeak));27 pmPeakType class) 28 { 29 pmPeak *tmp = (pmPeak *) psAlloc(sizeof(pmPeak)); 30 30 tmp->x = x; 31 31 tmp->y = y; … … 37 37 38 38 /****************************************************************************** 39 pmMomentsAlloc(): Allocate the p sMoments structure and initialize the members39 pmMomentsAlloc(): Allocate the pmMoments structure and initialize the members 40 40 to zero. 41 41 *****************************************************************************/ 42 p sMoments *pmMomentsAlloc()43 { 44 p sMoments *tmp = (psMoments *) psAlloc(sizeof(psMoments));42 pmMoments *pmMomentsAlloc() 43 { 44 pmMoments *tmp = (pmMoments *) psAlloc(sizeof(pmMoments)); 45 45 tmp->x = 0.0; 46 46 tmp->y = 0.0; … … 56 56 } 57 57 58 static void modelFree(p sModel *tmp)58 static void modelFree(pmModel *tmp) 59 59 { 60 60 psFree(tmp->params); … … 63 63 64 64 /****************************************************************************** 65 pmModelAlloc(): Allocate the p sModel structure, along with its parameters,65 pmModelAlloc(): Allocate the pmModel structure, along with its parameters, 66 66 and initialize the type member. Initialize the params to 0.0. 67 67 XXX EAM: changing params and dparams to psVector 68 68 *****************************************************************************/ 69 p sModel *pmModelAlloc(psModelType type)70 { 71 p sModel *tmp = (psModel *) psAlloc(sizeof(psModel));69 pmModel *pmModelAlloc(pmModelType type) 70 { 71 pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel)); 72 72 73 73 tmp->type = type; … … 99 99 break; 100 100 default: 101 psError(PS_ERR_UNKNOWN, true, "Undefined p sModelType");101 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); 102 102 return(NULL); 103 103 } … … 116 116 We might need to increase the reference counter and decrease it here. 117 117 *****************************************************************************/ 118 static void sourceFree(p sSource *tmp)118 static void sourceFree(pmSource *tmp) 119 119 { 120 120 psFree(tmp->peak); … … 122 122 // psFree(tmp->mask); 123 123 psFree(tmp->moments); 124 psFree(tmp->models); 125 } 126 127 /****************************************************************************** 128 pmSourceAlloc(): Allocate the psSource structure and initialize its members 124 psFree(tmp->modelPSF); 125 psFree(tmp->modelFLT); 126 } 127 128 /****************************************************************************** 129 pmSourceAlloc(): Allocate the pmSource structure and initialize its members 129 130 to NULL. 130 131 *****************************************************************************/ 131 p sSource *pmSourceAlloc()132 { 133 p sSource *tmp = (psSource *) psAlloc(sizeof(psSource));132 pmSource *pmSourceAlloc() 133 { 134 pmSource *tmp = (pmSource *) psAlloc(sizeof(pmSource)); 134 135 tmp->peak = NULL; 135 136 tmp->pixels = NULL; 136 137 tmp->mask = NULL; 137 138 tmp->moments = NULL; 138 tmp->models = NULL; 139 tmp->modelPSF = NULL; 140 tmp->modelFLT = NULL; 139 141 tmp->type = 0; 140 142 psMemSetDeallocator(tmp, (psFreeFunc) sourceFree); … … 272 274 psS32 col, 273 275 psF32 counts, 274 p sPeakType type)275 { 276 p sPeak *tmpPeak = pmPeakAlloc(col, row, counts, type);276 pmPeakType type) 277 { 278 pmPeak *tmpPeak = pmPeakAlloc(col, row, counts, type); 277 279 278 280 if (list == NULL) { … … 379 381 // Step through all local peaks in this row. 380 382 for (psU32 i = 0 ; i < row1->n ; i++ ) { 381 p sPeakType myType = PM_PEAK_UNDEF;383 pmPeakType myType = PM_PEAK_UNDEF; 382 384 col = row1->data.U32[i]; 383 385 … … 527 529 // printf("pmCullPeaks(): list size is %d\n", peaks->size); 528 530 while (tmpListElem != NULL) { 529 p sPeak *tmpPeak = (psPeak *) tmpListElem->data;531 pmPeak *tmpPeak = (pmPeak *) tmpListElem->data; 530 532 if ((tmpPeak->counts > maxValue) || 531 533 ((valid != NULL) && … … 553 555 554 556 for (int i = 0; i < peaks->n; i++) { 555 p sPeak *tmpPeak = (psPeak *) peaks->data[i];557 pmPeak *tmpPeak = (pmPeak *) peaks->data[i]; 556 558 if (tmpPeak->counts > maxValue) 557 559 continue; … … 566 568 567 569 /****************************************************************************** 568 p sSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this569 routine creates a new p sSource data structure and sets the following members:570 ->p sPeak571 ->p sMoments->sky570 pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this 571 routine creates a new pmSource data structure and sets the following members: 572 ->pmPeak 573 ->pmMoments->sky 572 574 573 575 The sky value is set from the pixels in the square annulus surrounding the … … 590 592 or they use the image row/column offsets. 591 593 592 XXX: Should we simply set p sSource->peak = peak? If so, should we increase594 XXX: Should we simply set pmSource->peak = peak? If so, should we increase 593 595 the reference counter? Or, should we copy the data structure? 594 596 … … 602 604 members. 603 605 *****************************************************************************/ 604 p sSource *pmSourceLocalSky(const psImage *image,605 const p sPeak *peak,606 pmSource *pmSourceLocalSky(const psImage *image, 607 const pmPeak *peak, 606 608 psStatsOptions statsOptions, 607 609 psF32 innerRadius, … … 723 725 // Create the output mySource, and set appropriate members. 724 726 // 725 p sSource *mySource = pmSourceAlloc();726 mySource->peak = (p sPeak *) peak;727 pmSource *mySource = pmSourceAlloc(); 728 mySource->peak = (pmPeak *) peak; 727 729 mySource->moments = pmMomentsAlloc(); 728 730 psF64 tmpF64; … … 746 748 XXX: macro this for performance. 747 749 *****************************************************************************/ 748 static bool checkRadius(p sPeak *peak,750 static bool checkRadius(pmPeak *peak, 749 751 psF32 radius, 750 752 psS32 x, … … 781 783 /****************************************************************************** 782 784 pmSourceMoments(source, radius): this function takes a subImage defined in the 783 p sSource data structure, along with the peak location, and determines the785 pmSource data structure, along with the peak location, and determines the 784 786 various moments associated with that peak. 785 787 786 788 Requires the following to have been created: 787 p sSource788 p sSource->peak789 p sSource->pixels789 pmSource 790 pmSource->peak 791 pmSource->pixels 790 792 791 793 XXX: The peak calculations are done in image coords, not subImage coords. … … 793 795 XXX: mask values? 794 796 *****************************************************************************/ 795 p sSource *pmSourceMoments(psSource *source,797 pmSource *pmSourceMoments(pmSource *source, 796 798 psF32 radius) 797 799 { … … 925 927 int pmComparePeakAscend (const void **a, const void **b) 926 928 { 927 p sPeak *A = *(psPeak **)a;928 p sPeak *B = *(psPeak **)b;929 pmPeak *A = *(pmPeak **)a; 930 pmPeak *B = *(pmPeak **)b; 929 931 930 932 psF32 diff; … … 940 942 int pmComparePeakDescend (const void **a, const void **b) 941 943 { 942 p sPeak *A = *(psPeak **)a;943 p sPeak *B = *(psPeak **)b;944 pmPeak *A = *(pmPeak **)a; 945 pmPeak *B = *(pmPeak **)b; 944 946 945 947 psF32 diff; … … 992 994 for (psS32 i = 0 ; i < sources->n ; i++) 993 995 { 994 p sSource *tmpSrc = (psSource *) sources->data[i];996 pmSource *tmpSrc = (pmSource *) sources->data[i]; 995 997 PS_ASSERT_PTR_NON_NULL(tmpSrc, false); // just skip this one? 996 998 PS_ASSERT_PTR_NON_NULL(tmpSrc->moments, false); // just skip this one? … … 1027 1029 // measure statistics on Sx, Sy if Sx, Sy within range of clump 1028 1030 { 1029 p sPeak *clump;1031 pmPeak *clump; 1030 1032 psF32 minSx, maxSx; 1031 1033 psF32 minSy, maxSy; … … 1054 1056 for (psS32 i = 0 ; i < sources->n ; i++) 1055 1057 { 1056 p sSource *tmpSrc = (psSource *) sources->data[i];1058 pmSource *tmpSrc = (pmSource *) sources->data[i]; 1057 1059 1058 1060 if (tmpSrc->moments->Sx < minSx) … … 1103 1105 for (psS32 i = 0 ; i < sources->n ; i++) { 1104 1106 1105 p sSource *tmpSrc = (psSource *) sources->data[i];1107 pmSource *tmpSrc = (pmSource *) sources->data[i]; 1106 1108 1107 1109 tmpSrc->peak->class = 0; … … 1197 1199 the pmSourceSetLocal() function. 1198 1200 *****************************************************************************/ 1199 bool pmSourceSetPixelsCircle(p sSource *source,1201 bool pmSourceSetPixelsCircle(pmSource *source, 1200 1202 const psImage *image, 1201 1203 psF32 radius) … … 1293 1295 /****************************************************************************** 1294 1296 pmSourceModelGuess(source, image, model): This function allocates a new 1295 p sModel structure and stores it in the psSource data structure specified in1297 pmModel structure and stores it in the pmSource data structure specified in 1296 1298 the argument list. The model type is specified in the argument list. The 1297 params array in that p sModel structure are allocated, and then set to the1299 params array in that pmModel structure are allocated, and then set to the 1298 1300 appropriate values. This function returns true if everything was successful. 1299 1301 … … 1306 1308 image, not subImage coords. Therefore, the calls to the model evaluation 1307 1309 functions will be in image, not subImage coords. Remember this. 1308 *****************************************************************************/ 1309 bool pmSourceModelGuess(psSource *source, 1310 1311 XXX: The source->models member used to be allocated here. Now I assume 1312 ->modelPSF should be allocated 1313 *****************************************************************************/ 1314 bool pmSourceModelGuess(pmSource *source, 1310 1315 const psImage *image, 1311 p sModelType model)1316 pmModelType model) 1312 1317 { 1313 1318 PS_ASSERT_PTR_NON_NULL(source, false); … … 1316 1321 PS_ASSERT_IMAGE_NON_NULL(image, false); 1317 1322 PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false); 1318 if (source->model s!= NULL) {1319 psLogMsg(__func__, PS_LOG_WARN, "WARNING: source->model s was non-NULL; calling psFree(source->models).\n");1320 psFree(source->model s);1323 if (source->modelPSF != NULL) { 1324 psLogMsg(__func__, PS_LOG_WARN, "WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF).\n"); 1325 psFree(source->modelPSF); 1321 1326 } 1322 1327 if (!((model == PS_MODEL_GAUSS) || … … 1330 1335 } 1331 1336 1332 source->model s= pmModelAlloc(model);1333 1334 psVector *params = source->model s->params;1337 source->modelPSF = pmModelAlloc(model); 1338 1339 psVector *params = source->modelPSF->params; 1335 1340 1336 1341 switch (model) { … … 1364 1369 params->data.F32[6] = source->moments->Sxy; 1365 1370 // XXX: What are these? 1366 // source->model s->params[7] = B2;1367 // source->model s->params[8] = B3;1371 // source->modelPSF->params[7] = B2; 1372 // source->modelPSF->params[8] = B3; 1368 1373 return(true); 1369 1374 … … 1420 1425 /****************************************************************************** 1421 1426 evalModel(source, level, row): a private function which evaluates the 1422 source->model function at the specified coords. The coords are subImage, not1427 source->modelPSF function at the specified coords. The coords are subImage, not 1423 1428 image coords. 1424 1429 … … 1430 1435 the coords is in subImage or image space. 1431 1436 1432 XXX: This should probably be a public p sModules function.1437 XXX: This should probably be a public pmModules function. 1433 1438 1434 1439 XXX: Use static vectors for x. … … 1439 1444 testing. Try to reproduce that and debug. 1440 1445 *****************************************************************************/ 1441 static psF32 evalModel(p sSource *src,1446 static psF32 evalModel(pmSource *src, 1442 1447 psU32 row, 1443 1448 psU32 col) 1444 1449 { 1445 1450 PS_ASSERT_PTR_NON_NULL(src, false); 1446 PS_ASSERT_PTR_NON_NULL(src->model s, false);1447 PS_ASSERT_PTR_NON_NULL(src->model s->params, false);1448 1449 // XXX: The following step will not be necessary if the model s->params1451 PS_ASSERT_PTR_NON_NULL(src->modelPSF, false); 1452 PS_ASSERT_PTR_NON_NULL(src->modelPSF->params, false); 1453 1454 // XXX: The following step will not be necessary if the modelPSF->params 1450 1455 // member is a psVector. Suggest to IfA. 1451 1456 1452 // XXX EAM: done: model s->params is now a vector1453 psVector *params = src->model s->params;1457 // XXX EAM: done: modelPSF->params is now a vector 1458 psVector *params = src->modelPSF->params; 1454 1459 1455 1460 // … … 1461 1466 psF32 tmpF; 1462 1467 1463 switch (src->model s->type) {1468 switch (src->modelPSF->type) { 1464 1469 case PS_MODEL_GAUSS: 1465 1470 tmpF = pmMinLM_Gauss2D(NULL, params, x); … … 1481 1486 break; 1482 1487 default: 1483 psError(PS_ERR_UNKNOWN, true, "Undefined p sModelType");1488 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); 1484 1489 return(NAN); 1485 1490 } … … 1500 1505 XXX: The result is returned in image coords. 1501 1506 *****************************************************************************/ 1502 static psF32 findValue(p sSource *source,1507 static psF32 findValue(pmSource *source, 1503 1508 psF32 level, 1504 1509 psU32 row, … … 1575 1580 XXX: The top, bottom of the contour is not correctly determined. 1576 1581 *****************************************************************************/ 1577 psArray *pmSourceContour(p sSource *source,1582 psArray *pmSourceContour(pmSource *source, 1578 1583 const psImage *image, 1579 1584 psF32 level, … … 1585 1590 PS_ASSERT_PTR_NON_NULL(source->peak, false); 1586 1591 PS_ASSERT_PTR_NON_NULL(source->pixels, false); 1587 PS_ASSERT_PTR_NON_NULL(source->model s, false);1592 PS_ASSERT_PTR_NON_NULL(source->modelPSF, false); 1588 1593 1589 1594 // … … 1692 1697 XXX: Probably should remove the "image" argument. 1693 1698 *****************************************************************************/ 1694 bool pmSourceFitModel(p sSource *source,1699 bool pmSourceFitModel(pmSource *source, 1695 1700 const psImage *image) 1696 1701 { … … 1699 1704 PS_ASSERT_PTR_NON_NULL(source->peak, false); 1700 1705 PS_ASSERT_PTR_NON_NULL(source->pixels, false); 1701 PS_ASSERT_PTR_NON_NULL(source->model s, false);1706 PS_ASSERT_PTR_NON_NULL(source->modelPSF, false); 1702 1707 PS_ASSERT_IMAGE_NON_NULL(image, false); 1703 1708 PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false); … … 1742 1747 PM_SOURCE_FIT_MODEL_TOLERANCE); 1743 1748 1744 psVector *params = source->model s->params;1745 1746 switch (source->model s->type) {1749 psVector *params = source->modelPSF->params; 1750 1751 switch (source->modelPSF->type) { 1747 1752 case PS_MODEL_GAUSS: 1748 1753 rc = psMinimizeLMChi2(myMin, NULL, params, NULL, x, y, yErr, pmMinLM_Gauss2D); … … 1764 1769 break; 1765 1770 default: 1766 psError(PS_ERR_UNKNOWN, true, "Undefined p sModelType");1771 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); 1767 1772 rc = false; 1768 1773 } 1769 1774 // XXX EAM: we need to do something (give an error?) if rc is false 1770 1775 // XXX EAM: save the resulting chisq, nDOF, nIter 1771 source->model s->chisq = myMin->value;1772 source->model s->nDOF = y->n - params->n;1773 source->model s->nIter = myMin->iter;1776 source->modelPSF->chisq = myMin->value; 1777 source->modelPSF->nDOF = y->n - params->n; 1778 source->modelPSF->nIter = myMin->iter; 1774 1779 1775 1780 psFree(x); … … 1780 1785 1781 1786 static bool sourceAddOrSubModel(psImage *image, 1782 p sSource *src,1787 pmSource *src, 1783 1788 bool center, 1784 1789 psS32 flag) … … 1788 1793 PS_ASSERT_PTR_NON_NULL(src->peak, false); 1789 1794 PS_ASSERT_PTR_NON_NULL(src->pixels, false); 1790 PS_ASSERT_PTR_NON_NULL(src->model s, false);1795 PS_ASSERT_PTR_NON_NULL(src->modelPSF, false); 1791 1796 PS_ASSERT_IMAGE_NON_NULL(image, false); 1792 1797 PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, false); 1793 1798 1794 1799 psVector *x = psVectorAlloc(2, PS_TYPE_F32); 1795 psVector *params = src->model s->params;1800 psVector *params = src->modelPSF->params; 1796 1801 1797 1802 for (psS32 i = 0; i < src->pixels->numRows; i++) { … … 1808 1813 x->data.F32[0] = (float) imageCol; 1809 1814 x->data.F32[1] = (float) imageRow; 1810 switch (src->model s->type) {1815 switch (src->modelPSF->type) { 1811 1816 case PS_MODEL_GAUSS: 1812 1817 pixelValue = pmMinLM_Gauss2D(NULL, params, x); … … 1828 1833 break; 1829 1834 default: 1830 psError(PS_ERR_UNKNOWN, true, "Undefined p sModelType");1835 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); 1831 1836 psFree(x); 1832 1837 return(false); … … 1851 1856 *****************************************************************************/ 1852 1857 bool pmSourceAddModel(psImage *image, 1853 p sSource *src,1858 pmSource *src, 1854 1859 bool center) 1855 1860 { … … 1860 1865 *****************************************************************************/ 1861 1866 bool pmSourceSubModel(psImage *image, 1862 p sSource *src,1867 pmSource *src, 1863 1868 bool center) 1864 1869 { -
trunk/psModules/src/pmObjects.h
r4579 r4770 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 7-19 01:44:48$7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-08-16 01:10:34 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "pslib.h" 24 24 25 /** pmPeakType 26 * 27 * A peak pixel may have several features which may be determined when the 28 * peak is found or measured. These are specified by the pmPeakType enum. 29 * PM_PEAK_LONE represents a single pixel which is higher than its 8 immediate 30 * neighbors. The PM_PEAK_EDGE represents a peak pixel which touching the image 31 * edge. The PM_PEAK_FLAT represents a peak pixel which has more than a specific 32 * number of neighbors at the same value, within some tolarence: 33 * 34 */ 25 35 typedef enum { 26 PM_PEAK_LONE, ///< Isolated peak. 27 PM_PEAK_EDGE, ///< Peak on edge. 28 PM_PEAK_FLAT, ///< Peak has equal-value neighbors. 29 PM_PEAK_UNDEF ///< Undefined. 30 } psPeakType; 31 36 PM_PEAK_LONE, ///< Isolated peak. 37 PM_PEAK_EDGE, ///< Peak on edge. 38 PM_PEAK_FLAT, ///< Peak has equal-value neighbors. 39 PM_PEAK_UNDEF ///< Undefined. 40 } pmPeakType; 41 42 /** pmPeak data structure 43 * 44 * 45 * 46 */ 32 47 typedef struct 33 48 { 34 psS32 x;///< X-coordinate of peak pixel.35 psS32 y;///< Y-coordinate of peak pixel.36 psF32 counts;///< Value of peak pixel (above sky?).37 p sPeakType class;///< Description of peak.49 int x; ///< X-coordinate of peak pixel. 50 int y; ///< Y-coordinate of peak pixel. 51 float counts; ///< Value of peak pixel (above sky?). 52 pmPeakType class; ///< Description of peak. 38 53 } 39 psPeak; 40 54 pmPeak; 55 56 /** pmMoments data structure 57 * 58 * 59 * 60 */ 41 61 typedef struct 42 62 { 43 psF32 x;///< X-coord of centroid.44 psF32 y;///< Y-coord of centroid.45 psF32 Sx;///< x-second moment.46 psF32 Sy;///< y-second moment.47 psF32 Sxy;///< xy cross moment.48 psF32 Sum;///< Pixel sum above sky (background).49 psF32 Peak;///< Peak counts above sky.50 psF32 Sky;///< Sky level (background).51 psS32 nPixels;///< Number of pixels used.63 float x; ///< X-coord of centroid. 64 float y; ///< Y-coord of centroid. 65 float Sx; ///< x-second moment. 66 float Sy; ///< y-second moment. 67 float Sxy; ///< xy cross moment. 68 float Sum; ///< Pixel sum above sky (background). 69 float Peak; ///< Peak counts above sky. 70 float Sky; ///< Sky level (background). 71 int nPixels; ///< Number of pixels used. 52 72 } 53 psMoments; 54 73 pmMoments; 74 75 /** pmModelType enumeration 76 * 77 * 78 * 79 */ 55 80 typedef enum { 56 PS_MODEL_GAUSS, ///< Regular 2-D Gaussian 57 PS_MODEL_PGAUSS, ///< Psuedo 2-D Gaussian 58 PS_MODEL_TWIST_GAUSS, ///< 2-D Twisted Gaussian 59 PS_MODEL_WAUSS, ///< 2-D Waussian 60 PS_MODEL_SERSIC, ///< Sersic 61 PS_MODEL_SERSIC_CORE, ///< Sersic Core 62 PS_MODEL_UNDEFINED ///< Undefined 63 } psModelType; 64 65 // XXX: It will be better if params, and dparams, were psVectors. 81 PS_MODEL_GAUSS, ///< Regular 2-D Gaussian 82 PS_MODEL_PGAUSS, ///< Psuedo 2-D Gaussian 83 PS_MODEL_TWIST_GAUSS, ///< 2-D Twisted Gaussian 84 PS_MODEL_WAUSS, ///< 2-D Waussian 85 PS_MODEL_SERSIC, ///< Sersic 86 PS_MODEL_SERSIC_CORE, ///< Sersic Core 87 PS_MODEL_UNDEFINED ///< Undefined 88 } pmModelType; 89 90 /** pmModel data structure 91 * 92 * 93 * 94 */ 95 // XXX: The SDRS has the "type" member of type psS32. 66 96 typedef struct 67 97 { 68 p sModelType type;///< Model to be used.69 psVector *params; ///< Paramater values.70 psVector *dparams; ///< Parameter errors.71 psF32 chisq;///< Fit chi-squared.72 psS32 nDOF;///< number of degrees of freedom73 psS32 nIter;///< number of iterations to reach min98 pmModelType type; ///< Model to be used. 99 psVector *params; ///< Paramater values. 100 psVector *dparams; ///< Parameter errors. 101 float chisq; ///< Fit chi-squared. 102 int nDOF; ///< number of degrees of freedom 103 int nIter; ///< number of iterations to reach min 74 104 } 75 psModel; 76 105 pmModel; 106 107 /** pmSourceType enumeration 108 * 109 * 110 * 111 */ 77 112 typedef enum { 78 113 PS_SOURCE_PSFSTAR, … … 84 119 PS_SOURCE_BRIGHTSTAR, 85 120 PS_SOURCE_OTHER 86 } psSourceType; 87 121 } pmSourceType; 122 123 /** pmSource data structure 124 * 125 * This source has the capacity for several types of measurements. The 126 * simplest measurement of a source is the location and flux of the peak pixel 127 * associated with the source: 128 * 129 */ 88 130 typedef struct 89 131 { 90 psPeak *peak; ///< Description of peak pixel. 91 psImage *pixels; ///< Rectangular region including object pixels. 92 psImage *mask; ///< Mask which marks pixels associated with objects. 93 psMoments *moments; ///< Basic moments measure for the object. 94 psModel *models; ///< Model parameters and type. 95 psSourceType type; ///< Best identification of object. 132 pmPeak *peak; ///< Description of peak pixel. 133 psImage *pixels; ///< Rectangular region including object pixels. 134 psImage *mask; ///< Mask which marks pixels associated with objects. 135 pmMoments *moments; ///< Basic moments measure for the object. 136 pmModel *modelPSF; ///< PSF model parameters and type 137 pmModel *modelFLT; ///< FLT model parameters and type 138 pmSourceType type; ///< Best identification of object. 96 139 } 97 psSource; 98 99 psPeak *pmPeakAlloc(psS32 x, ///< Row-coordinate in image space 100 psS32 y, ///< Col-coordinate in image space 101 psF32 counts, ///< The value of the peak pixel 102 psPeakType class ///< The type of peak pixel 103 ); 104 105 psMoments *pmMomentsAlloc(); 106 psModel *pmModelAlloc(psModelType type); 107 psSource *pmSourceAlloc(); 140 pmSource; 141 142 /** pmPeak data structure 143 * 144 * 145 * 146 */ 147 typedef struct 148 { 149 psS32 type; ///< PSF Model in use 150 psArray *params; ///< Model parameters (psPolynomial2D) 151 psF32 chisq; ///< PSF goodness statistic 152 psS32 nPSFstars; ///< number of stars used to measure PSF 153 } 154 pmPSF; 155 156 157 158 pmPeak *pmPeakAlloc( 159 int x, ///< Row-coordinate in image space 160 int y, ///< Col-coordinate in image space 161 float counts, ///< The value of the peak pixel 162 pmPeakType class ///< The type of peak pixel 163 ); 164 165 pmMoments *pmMomentsAlloc(); 166 pmModel *pmModelAlloc(pmModelType type); 167 pmSource *pmSourceAlloc(); 108 168 109 169 /****************************************************************************** … … 112 172 the location (x value) of all peaks. 113 173 *****************************************************************************/ 114 psVector *pmFindVectorPeaks(const psVector *vector, ///< The input vector (psF32) 115 psF32 threshold ///< Threshold above which to find a peak 116 ); 174 psVector *pmFindVectorPeaks( 175 const psVector *vector, ///< The input vector (float) 176 float threshold ///< Threshold above which to find a peak 177 ); 117 178 118 179 /****************************************************************************** … … 121 182 value) of all peaks. 122 183 *****************************************************************************/ 123 psArray *pmFindImagePeaks(const psImage *image, ///< The input image where peaks will be found (psF32) 124 psF32 threshold ///< Threshold above which to find a peak 125 ); 184 psArray *pmFindImagePeaks( 185 const psImage *image, ///< The input image where peaks will be found (float) 186 float threshold ///< Threshold above which to find a peak 187 ); 126 188 127 189 /****************************************************************************** … … 129 191 a peak value above the given maximum, or fall outside the valid region. 130 192 *****************************************************************************/ 131 psList *pmCullPeaks(psList *peaks, ///< The psList of peaks to be culled 132 psF32 maxValue, ///< Cull peaks above this value 133 const psRegion *valid ///< Cull peaks otside this psRegion 134 ); 135 136 /****************************************************************************** 137 psSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): 193 psList *pmCullPeaks( 194 psList *peaks, ///< The psList of peaks to be culled 195 float maxValue, ///< Cull peaks above this value 196 const psRegion *valid ///< Cull peaks otside this psRegion 197 ); 198 199 /****************************************************************************** 200 pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): 138 201 139 202 *****************************************************************************/ 140 psSource *pmSourceLocalSky(const psImage *image, ///< The input image (psF32) 141 const psPeak *peak, ///< The peak for which the psSource struct is created. 142 psStatsOptions statsOptions, ///< The statistic used in calculating the background sky 143 psF32 innerRadius, ///< The inner radius of the suqare annulus for calculating sky 144 psF32 outerRadius ///< The outer radius of the suqare annulus for calculating sky 145 ); 146 147 /****************************************************************************** 148 *****************************************************************************/ 149 psSource *pmSourceMoments(psSource *source, ///< The input psSource for which moments will be computed 150 psF32 radius ///< Use a circle of pixels around the peak 151 ); 203 pmSource *pmSourceLocalSky( 204 const psImage *image, ///< The input image (float) 205 const pmPeak *peak, ///< The peak for which the psSource struct is created. 206 psStatsOptions statsOptions, ///< The statistic used in calculating the background sky 207 float innerRadius, ///< The inner radius of the suqare annulus for calculating sky 208 float outerRadius ///< The outer radius of the suqare annulus for calculating sky 209 ); 210 211 /****************************************************************************** 212 *****************************************************************************/ 213 pmSource *pmSourceMoments( 214 pmSource *source, ///< The input pmSource for which moments will be computed 215 float radius ///< Use a circle of pixels around the peak 216 ); 152 217 153 218 /****************************************************************************** … … 155 220 source classification. 156 221 *****************************************************************************/ 157 bool pmSourceRoughClass(psArray *source, ///< The input psSource 158 psMetadata *metadata ///< Contains classification parameters 159 ); 222 bool pmSourceRoughClass( 223 psArray *source, ///< The input pmSource 224 psMetadata *metadata ///< Contains classification parameters 225 ); 160 226 /****************************************************************************** 161 227 pmSourceSetPixelCircle(source, image, radius) 162 228 *****************************************************************************/ 163 bool pmSourceSetPixelsCircle(psSource *source, ///< The input psSource 164 const psImage *image, ///< The input image (psF32) 165 psF32 radius ///< The radius of the circle 166 ); 167 168 /****************************************************************************** 169 *****************************************************************************/ 170 bool pmSourceModelGuess(psSource *source, ///< The input psSource 171 const psImage *image, ///< The input image (psF32) 172 psModelType model ///< The type of model to be created. 173 ); 229 bool pmSourceSetPixelsCircle( 230 pmSource *source, ///< The input pmSource 231 const psImage *image, ///< The input image (float) 232 float radius ///< The radius of the circle 233 ); 234 235 /****************************************************************************** 236 *****************************************************************************/ 237 bool pmSourceModelGuess( 238 pmSource *source, ///< The input pmSource 239 const psImage *image, ///< The input image (float) 240 pmModelType model ///< The type of model to be created. 241 ); 174 242 175 243 /****************************************************************************** … … 179 247 } pmContourType; 180 248 181 psArray *pmSourceContour(psSource *source, ///< The input psSource 182 const psImage *image, ///< The input image (psF32) (this arg should be removed) 183 psF32 level, ///< The level of the contour 184 pmContourType mode ///< Currently this must be PS_CONTOUR_CRUDE 185 ); 186 187 /****************************************************************************** 188 *****************************************************************************/ 189 bool pmSourceFitModel(psSource *source, ///< The input psSource 190 const psImage *image ///< The input image (psF32) 191 ); 192 193 /****************************************************************************** 194 *****************************************************************************/ 195 bool pmSourceAddModel(psImage *image, ///< The opuut image (psF32) 196 psSource *source, ///< The input psSource 197 bool center ///< A boolean flag that determines whether pixels are centered 198 ); 199 200 /****************************************************************************** 201 *****************************************************************************/ 202 bool pmSourceSubModel(psImage *image, ///< The output image (psF32) 203 psSource *source, ///< The input psSource 204 bool center ///< A boolean flag that determines whether pixels are centered 205 ); 249 psArray *pmSourceContour( 250 pmSource *source, ///< The input pmSource 251 const psImage *image, ///< The input image (float) (this arg should be removed) 252 float level, ///< The level of the contour 253 pmContourType mode ///< Currently this must be PS_CONTOUR_CRUDE 254 ); 255 256 /****************************************************************************** 257 *****************************************************************************/ 258 bool pmSourceFitModel( 259 pmSource *source, ///< The input pmSource 260 const psImage *image ///< The input image (float) 261 ); 262 263 /****************************************************************************** 264 *****************************************************************************/ 265 bool pmSourceAddModel( 266 psImage *image, ///< The opuut image (float) 267 pmSource *source, ///< The input pmSource 268 bool center ///< A boolean flag that determines whether pixels are centered 269 ); 270 271 /****************************************************************************** 272 *****************************************************************************/ 273 bool pmSourceSubModel( 274 psImage *image, ///< The output image (float) 275 pmSource *source, ///< The input pmSource 276 bool center ///< A boolean flag that determines whether pixels are centered 277 ); 206 278 207 279 /****************************************************************************** 208 280 XXX: Why only *x argument? 209 XXX EAM: psMinimizeLMChi2Func returns psF64, not psF32281 XXX EAM: psMinimizeLMChi2Func returns psF64, not float 210 282 *****************************************************************************/ 211 283 float pmMinLM_Gauss2D( 212 psVector *deriv, ///< A possibly-NULL structure for the output derivatives213 const psVector *params, ///< A psVector which holds the parameters of this function214 const psVector *x ///< A psVector which holds the row/col coordinate284 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 285 const psVector *params, ///< A psVector which holds the parameters of this function 286 const psVector *x ///< A psVector which holds the row/col coordinate 215 287 ); 216 288 … … 218 290 *****************************************************************************/ 219 291 float pmMinLM_PsuedoGauss2D( 220 psVector *deriv, ///< A possibly-NULL structure for the output derivatives221 const psVector *params, ///< A psVector which holds the parameters of this function222 const psVector *x ///< A psVector which holds the row/col coordinate292 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 293 const psVector *params, ///< A psVector which holds the parameters of this function 294 const psVector *x ///< A psVector which holds the row/col coordinate 223 295 ); 224 296 … … 226 298 *****************************************************************************/ 227 299 float pmMinLM_Wauss2D( 228 psVector *deriv, ///< A possibly-NULL structure for the output derivatives229 const psVector *params, ///< A psVector which holds the parameters of this function230 const psVector *x ///< A psVector which holds the row/col coordinate300 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 301 const psVector *params, ///< A psVector which holds the parameters of this function 302 const psVector *x ///< A psVector which holds the row/col coordinate 231 303 ); 232 304 … … 234 306 *****************************************************************************/ 235 307 float pmMinLM_TwistGauss2D( 236 psVector *deriv, ///< A possibly-NULL structure for the output derivatives237 const psVector *params, ///< A psVector which holds the parameters of this function238 const psVector *x ///< A psVector which holds the row/col coordinate308 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 309 const psVector *params, ///< A psVector which holds the parameters of this function 310 const psVector *x ///< A psVector which holds the row/col coordinate 239 311 ); 240 312 … … 242 314 *****************************************************************************/ 243 315 float pmMinLM_Sersic( 244 psVector *deriv, ///< A possibly-NULL structure for the output derivatives245 const psVector *params, ///< A psVector which holds the parameters of this function246 const psVector *x ///< A psVector which holds the row/col coordinate316 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 317 const psVector *params, ///< A psVector which holds the parameters of this function 318 const psVector *x ///< A psVector which holds the row/col coordinate 247 319 ); 248 320 … … 250 322 *****************************************************************************/ 251 323 float pmMinLM_SersicCore( 252 psVector *deriv, ///< A possibly-NULL structure for the output derivatives253 const psVector *params, ///< A psVector which holds the parameters of this function254 const psVector *x ///< A psVector which holds the row/col coordinate324 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 325 const psVector *params, ///< A psVector which holds the parameters of this function 326 const psVector *x ///< A psVector which holds the row/col coordinate 255 327 ); 256 328 … … 258 330 *****************************************************************************/ 259 331 float pmMinLM_PsuedoSersic( 260 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 261 const psVector *params, ///< A psVector which holds the parameters of this function 262 const psVector *x ///< A psVector which holds the row/col coordinate 263 ); 264 332 psVector *deriv, ///< A possibly-NULL structure for the output derivatives 333 const psVector *params, ///< A psVector which holds the parameters of this function 334 const psVector *x ///< A psVector which holds the row/col coordinate 335 ); 336 337 338 /** 339 * 340 * The object model functions are defined to allow for the flexible addition 341 * of new object models. Every object model, with parameters represented by 342 * pmModel, has an associated set of functions which provide necessary support 343 * operations. A set of abstract functions allow the programmer to select the 344 * approriate function or property for a specific named object model. 345 * 346 */ 347 348 /** 349 * 350 * This function is the model chi-square minimization function for this model. 351 * 352 */ 353 typedef psMinimizeLMChi2Func pmModelFunc; 354 355 356 /** 357 * 358 * This function returns the integrated flux for the given model parameters. 359 */ 360 typedef psF64 (*pmModelFlux)(const psVector *params); 361 362 363 /** 364 * 365 * This function provides the model guess parameters based on the details of 366 * the given source. 367 * 368 */ 369 typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source); 370 371 372 /** 373 * 374 * This function constructs the PSF model for the given source based on the 375 * supplied psf and the FLT model for the object. 376 * 377 */ 378 typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf); 379 380 381 /** 382 * 383 * This function returns the radius at which the given model and parameters 384 * achieves the given flux. 385 * 386 */ 387 typedef psF64 (*pmModelRadius)(const psVector *params, double flux); 388 389 390 /** 391 * 392 * Each of the function types above has a corresponding function which returns 393 * the function given the model type: 394 * 395 */ 396 pmModelFunc pmModelFunc_GetFunction (pmModelType type); 397 pmModelFlux pmModelFlux_GetFunction (pmModelType type); 398 pmModelGuessFunc pmModelGuessFunc_GetFunction (pmModelType type); 399 pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type); 400 pmModelRadius pmModelRadius_GetFunction (pmModelType type); 265 401 266 402 #endif -
trunk/psModules/src/pmReadoutCombine.c
r4425 r4770 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 6-29 01:39:10$7 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-08-16 01:10:34 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 72 72 psS32 minInputRows = PS_MAX_S32; 73 73 psListElem *tmpInput = NULL; 74 p sReadout *tmpReadout = NULL;74 pmReadout *tmpReadout = NULL; 75 75 psS32 numInputs = 0; 76 76 psS32 tmpI; … … 98 98 tmpInput = (psListElem *) inputs->head; 99 99 while (NULL != tmpInput) { 100 tmpReadout = (p sReadout *) tmpInput->data;100 tmpReadout = (pmReadout *) tmpInput->data; 101 101 PS_ASSERT_READOUT_NON_NULL(tmpReadout, output); 102 102 PS_ASSERT_READOUT_NON_EMPTY(tmpReadout, output); … … 182 182 psVector *outColLower = psVectorAlloc(numInputs, PS_TYPE_U32); 183 183 psVector *outColUpper = psVectorAlloc(numInputs, PS_TYPE_U32); 184 p sReadout **tmpReadouts = (psReadout **) psAlloc(numInputs * sizeof(psReadout *));184 pmReadout **tmpReadouts = (pmReadout **) psAlloc(numInputs * sizeof(pmReadout *)); 185 185 186 186 // For each input readout, we create a pointer to that readout in … … 191 191 tmpInput = (psListElem *) inputs->head; 192 192 while (NULL != tmpInput) { 193 tmpReadouts[i] = (p sReadout *) tmpInput->data;193 tmpReadouts[i] = (pmReadout *) tmpInput->data; 194 194 outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadouts[i]->image->row0; 195 195 outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadouts[i]->image->col0; -
trunk/psModules/src/pmSubtractBias.c
r4579 r4770 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 7-19 01:44:48$8 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-16 01:10:34 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 place from the input image. 28 28 *****************************************************************************/ 29 static p sReadout *SubtractFrame(psReadout *in,30 const p sReadout *bias)29 static pmReadout *SubtractFrame(pmReadout *in, 30 const pmReadout *bias) 31 31 { 32 32 psS32 i; … … 245 245 XXX: The SDRS does not specify type support. F32 is implemented here. 246 246 *****************************************************************************/ 247 p sReadout *pmSubtractBias(psReadout *in,247 pmReadout *pmSubtractBias(pmReadout *in, 248 248 void *fitSpec, 249 249 const psList *overscans, … … 252 252 psS32 nBinOrig, 253 253 pmFit fit, 254 const p sReadout *bias)254 const pmReadout *bias) 255 255 { 256 256 psTrace(".psModule.pmSubtracBias.pmSubtractBias", 4, -
trunk/psModules/src/pmSubtractBias.h
r4754 r4770 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-08-1 1 00:03:51$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-16 01:10:34 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 38 38 } pmFit; 39 39 40 p sReadout *pmSubtractBias(psReadout *in, ///< The input psReadout image40 pmReadout *pmSubtractBias(pmReadout *in, ///< The input pmReadout image 41 41 void *fitSpec, ///< A polynomial or spline, defining the fit type. 42 42 const psList *overscans, ///< A psList of overscan images … … 45 45 int nBin, ///< The amount of binning to be done image pixels. 46 46 pmFit fit, ///< PM_FIT_SPLINE, PM_FIT_POLYNOMIAL, or PM_FIT_NONE 47 const p sReadout *bias); ///< A possibly NULL bias psReadout which is to be subtracted47 const pmReadout *bias); ///< A possibly NULL bias pmReadout which is to be subtracted 48 48 49 49 #endif -
trunk/psModules/src/pmSubtractSky.c
r4425 r4770 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 6-29 01:39:10$8 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-16 01:10:34 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 453 453 454 454 /****************************************************************************** 455 p sReadout pmSubtractSky():455 pmReadout pmSubtractSky(): 456 456 457 457 XXX: use static vectors for myStats, and the binned image … … 461 461 XXX: Sync the psTrace message facilities. 462 462 *****************************************************************************/ 463 p sReadout *pmSubtractSky(psReadout *in,463 pmReadout *pmSubtractSky(pmReadout *in, 464 464 void *fitSpec, 465 465 psFit fit, -
trunk/psModules/src/pmSubtractSky.h
r4754 r4770 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-08-1 1 00:03:51$8 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-16 01:10:34 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 } psFit; 33 33 34 p sReadout *pmSubtractSky(psReadout *in,34 pmReadout *pmSubtractSky(pmReadout *in, 35 35 void *fitSpec, 36 36 psFit fit, -
trunk/psModules/test/tst_pmFlatField.c
r2950 r4770 16 16 * Test M - Attempt to use non-mask type mask image 17 17 * 18 * XXX: Added a mask argument to pmFlatField(). Must add tests. For now, all 19 * masks are NULL. 20 * 18 21 * @author Ross Harman, MHPCC 19 22 * 20 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-0 1-11 01:17:28$23 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-08-16 01:10:36 $ 22 25 * 23 26 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 68 71 int main(int argc, char* argv[]) 69 72 { 73 psLogSetFormat("HLNM"); 70 74 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 71 75 } … … 77 81 printPositiveTestHeader(stdout, "pmFlatField", "Test A - Divide input image by flat image"); 78 82 CREATE_AND_SET_IMAGE(inImage,F64,6.0,3,3) 79 p sReadout *inReadout = psReadoutAlloc();83 pmReadout *inReadout = pmReadoutAlloc(NULL); 80 84 inReadout->image = inImage; 81 85 PRINT_MATRIX(inImage,F64,"Input image:"); 82 86 CREATE_AND_SET_IMAGE(flatImage1,F64,2.0,3,3) 83 p sReadout *flatReadout = psReadoutAlloc();87 pmReadout *flatReadout = pmReadoutAlloc(NULL); 84 88 flatReadout->image = flatImage1; 85 89 PRINT_MATRIX(flatImage1,F64,"Flat image:"); 86 if ( !pmFlatField(inReadout, flatReadout) ) {90 if ( !pmFlatField(inReadout, NULL, flatReadout) ) { 87 91 psError(PS_ERR_UNKNOWN,true,"Test A - Returned false should be true"); 88 92 return 1; … … 99 103 PRINT_MATRIX(flatImage2, F64, "Flat image:"); 100 104 flatReadout->image = flatImage2; 101 if ( !pmFlatField(inReadout, flatReadout) ) {105 if ( !pmFlatField(inReadout, NULL, flatReadout) ) { 102 106 psError(PS_ERR_UNKNOWN,true,"Test B - Returned false should be true"); 103 107 return 2; … … 118 122 psFree(inReadout->mask); 119 123 inReadout->mask = mask1; 120 if ( !pmFlatField(inReadout, flatReadout) ) {124 if ( !pmFlatField(inReadout, NULL, flatReadout) ) { 121 125 psError(PS_ERR_UNKNOWN,true,"Test C - Returned false should be true"); 122 126 return 3; … … 132 136 printNegativeTestHeader(stdout,"pmFlatField", "Test D - Attempt to use null flat readout", 133 137 "Null not allowed for flat readout", 0); 134 if( pmFlatField(inReadout, NULL ) ) {138 if( pmFlatField(inReadout, NULL, NULL) ) { 135 139 psError(PS_ERR_UNKNOWN,true,"Test D - Returned true should be false"); 136 140 return 4; … … 145 149 psImage *temp = inReadout->image; 146 150 inReadout->image = NULL; 147 if ( pmFlatField(inReadout, flatReadout) ) {151 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 148 152 psError(PS_ERR_UNKNOWN,true,"Test E - Returned true should be false" ); 149 153 return 5; … … 159 163 temp = flatReadout->image; 160 164 flatReadout->image = NULL; 161 if ( pmFlatField(inReadout, flatReadout) ) {165 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 162 166 psError(PS_ERR_UNKNOWN,true,"Test F - Returned true should be false" ); 163 167 return 6; … … 174 178 temp = flatReadout->image; 175 179 flatReadout->image = smallFlat; 176 if ( pmFlatField(inReadout, flatReadout) ) {180 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 177 181 psError(PS_ERR_UNKNOWN,true,"Test G - Returned true should be false"); 178 182 return 7; … … 189 193 temp = inReadout->mask; 190 194 inReadout->mask = largeMask; 191 if ( pmFlatField(inReadout, flatReadout) ) {195 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 192 196 psError(PS_ERR_UNKNOWN,true,"Test H - Returned true should be false"); 193 197 return 8; … … 203 207 *(int*)&inReadout->col0 = 50; 204 208 *(int*)&inReadout->row0 = 50; 205 if ( pmFlatField(inReadout, flatReadout) ) {209 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 206 210 psError(PS_ERR_UNKNOWN,true,"Test I - Returned true should be false"); 207 211 return 9; … … 217 221 "Complex types not allowed for input image", 0); 218 222 *(psElemType* ) & inReadout->image->type.type = PS_TYPE_C64; 219 if ( pmFlatField(inReadout, flatReadout) ) {223 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 220 224 psError(PS_ERR_UNKNOWN,true,"Test J - Returned true should be false"); 221 225 return 10; … … 230 234 "Complex types not allowed for flat image", 0); 231 235 *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_C64; 232 if ( pmFlatField(inReadout, flatReadout) ) {236 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 233 237 psError(PS_ERR_UNKNOWN,true,"Test K - Returned ture should be false"); 234 238 return 11; … … 243 247 "Input and flat image types differ", 0); 244 248 *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_F32; 245 if ( pmFlatField(inReadout, flatReadout) ) {249 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 246 250 psError(PS_ERR_UNKNOWN,true,"Test L - Returned true should be false"); 247 251 return 12; … … 256 260 "Mask must be PS_TYPE_MASK type", 0); 257 261 *(psElemType* ) & inReadout->mask->type.type = PS_TYPE_F32; 258 if ( pmFlatField(inReadout, flatReadout) ) {262 if ( pmFlatField(inReadout, NULL, flatReadout) ) { 259 263 psError(PS_ERR_UNKNOWN,true,"Test M - Returned true should be false"); 260 264 return 13; -
trunk/psModules/test/tst_pmImageCombine.c
r4579 r4770 9 9 * XXX: Must verify the results internally. Don't use stdout file. 10 10 * 11 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 7-19 01:44:48$11 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-16 01:10:36 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 int main(int argc, char* argv[]) 26 26 { 27 psLogSetFormat("HLNM"); 27 28 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 28 29 } -
trunk/psModules/test/tst_pmMaskBadPixels.c
r2951 r4770 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $20 * @date $Date: 2005-0 1-11 01:30:16 $19 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2005-08-16 01:10:36 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 87 87 int main(int argc, char* argv[]) 88 88 { 89 psLogSetFormat("HLNM"); 89 90 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 90 91 } … … 96 97 CREATE_AND_SET_IMAGE(inImage1,F64,0,50,50); 97 98 CREATE_AND_SET_IMAGE(mask1,U8,0,50,50) 98 // p sReadout *inReadout = psReadoutAlloc(0, 0, inImage1);99 p sReadout *inReadout = psReadoutAlloc();99 // pmReadout *inReadout = pmReadoutAlloc(0, 0, inImage1); 100 pmReadout *inReadout = pmReadoutAlloc(NULL); 100 101 inReadout->image = inImage1; 101 102 mask1->data.PS_TYPE_MASK_DATA[24][24]=1; … … 114 115 CREATE_AND_SET_IMAGE(inImage2,F64,150.0,50,50); 115 116 CREATE_AND_SET_IMAGE(mask2,U8,0,50,50) 116 // p sReadout *inReadout2 = psReadoutAlloc(0, 0, inImage2);117 p sReadout *inReadout2 = psReadoutAlloc();117 // pmReadout *inReadout2 = pmReadoutAlloc(0, 0, inImage2); 118 pmReadout *inReadout2 = pmReadoutAlloc(NULL); 118 119 inReadout2->image = inImage2; 119 120 PRINT_MATRIX(mask2, U8, "Data mask:"); … … 131 132 CREATE_AND_SET_IMAGE(inImage3,F64,50.0,50,50); 132 133 CREATE_AND_SET_IMAGE(mask3,U8,0,50,50) 133 // p sReadout *inReadout3 = psReadoutAlloc(0, 0, inImage3);134 p sReadout *inReadout3 = psReadoutAlloc();134 // pmReadout *inReadout3 = pmReadoutAlloc(0, 0, inImage3); 135 pmReadout *inReadout3 = pmReadoutAlloc(NULL); 135 136 inReadout3->image = inImage3; 136 137 mask3->data.PS_TYPE_MASK_DATA[24][24]=1; … … 152 153 CREATE_AND_SET_IMAGE(mask4,U8,0,50,50) 153 154 CREATE_AND_SET_IMAGE(mask4i,U8,0,50,50) 154 // p sReadout *inReadout4 = psReadoutAlloc(0, 0, inImage4);155 p sReadout *inReadout4 = psReadoutAlloc();155 // pmReadout *inReadout4 = pmReadoutAlloc(0, 0, inImage4); 156 pmReadout *inReadout4 = pmReadoutAlloc(NULL); 156 157 inReadout4->image = inImage4; 157 158 inReadout4->mask = mask4i; … … 170 171 // Test E - Attempt to use null mask 171 172 CREATE_AND_SET_IMAGE(inImage5,F64,50.0,50,50); 172 // p sReadout *inReadout5 = psReadoutAlloc(0, 0, inImage5);173 p sReadout *inReadout5 = psReadoutAlloc();173 // pmReadout *inReadout5 = pmReadoutAlloc(0, 0, inImage5); 174 pmReadout *inReadout5 = pmReadoutAlloc(NULL); 174 175 inReadout5->image = inImage5; 175 176 pmMaskBadPixels(inReadout5, NULL, 0, 100.0, 1, 10); … … 183 184 // Test F - Attempt tp use null input image 184 185 CREATE_AND_SET_IMAGE(mask6,U8,0,50,50) 185 // p sReadout *inReadout6 = psReadoutAlloc(0, 0, NULL);186 p sReadout *inReadout6 = psReadoutAlloc();186 // pmReadout *inReadout6 = pmReadoutAlloc(0, 0, NULL); 187 pmReadout *inReadout6 = pmReadoutAlloc(NULL); 187 188 inReadout6->mask = mask6; 188 189 pmMaskBadPixels(inReadout6, mask6, 0, 100.0, 1, 10); … … 198 199 CREATE_AND_SET_IMAGE(mask7,U8,0,50,50) 199 200 CREATE_AND_SET_IMAGE(mask7i,U8,0,50,50) 200 // p sReadout *inReadout7 = psReadoutAlloc(0, 0, inImage7);201 p sReadout *inReadout7 = psReadoutAlloc();201 // pmReadout *inReadout7 = pmReadoutAlloc(0, 0, inImage7); 202 pmReadout *inReadout7 = pmReadoutAlloc(NULL); 202 203 inReadout7->image = inImage7; 203 204 inReadout7->mask = mask7i; … … 215 216 CREATE_AND_SET_IMAGE(mask8,U8,0,50,50) 216 217 CREATE_AND_SET_IMAGE(mask8i,U8,0,60,60) 217 // p sReadout *inReadout8 = psReadoutAlloc(0, 0, inImage8);218 p sReadout *inReadout8 = psReadoutAlloc();218 // pmReadout *inReadout8 = pmReadoutAlloc(0, 0, inImage8); 219 pmReadout *inReadout8 = pmReadoutAlloc(NULL); 219 220 inReadout8->image = inImage8; 220 221 inReadout8->mask = mask8i; … … 232 233 CREATE_AND_SET_IMAGE(mask9,U8,0,50,50) 233 234 CREATE_AND_SET_IMAGE(mask9i,U8,0,50,50) 234 // p sReadout *inReadout9 = psReadoutAlloc(0, 0, inImage9);235 p sReadout *inReadout9 = psReadoutAlloc();235 // pmReadout *inReadout9 = pmReadoutAlloc(0, 0, inImage9); 236 pmReadout *inReadout9 = pmReadoutAlloc(NULL); 236 237 inReadout9->image = inImage9; 237 238 inReadout9->mask = mask9i; … … 251 252 CREATE_AND_SET_IMAGE(mask10,U8,0,50,50) 252 253 CREATE_AND_SET_IMAGE(mask10i,U8,0,50,50) 253 // p sReadout *inReadout10 = psReadoutAlloc(0, 0, inImage10);254 p sReadout *inReadout10 = psReadoutAlloc();254 // pmReadout *inReadout10 = pmReadoutAlloc(0, 0, inImage10); 255 pmReadout *inReadout10 = pmReadoutAlloc(NULL); 255 256 inReadout10->image = inImage10; 256 257 inReadout10->mask = mask10i; … … 268 269 CREATE_AND_SET_IMAGE(mask11,F64,0,50,50) 269 270 CREATE_AND_SET_IMAGE(mask11i,U8,0,50,50) 270 // p sReadout *inReadout11 = psReadoutAlloc(0, 0, inImage11);271 p sReadout *inReadout11 = psReadoutAlloc();271 // pmReadout *inReadout11 = pmReadoutAlloc(0, 0, inImage11); 272 pmReadout *inReadout11 = pmReadoutAlloc(NULL); 272 273 inReadout11->image = inImage11; 273 274 inReadout11->mask = mask11i; -
trunk/psModules/test/tst_pmNonLinear.c
r2961 r4770 16 16 * @author GLG, MHPCC 17 17 * 18 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $19 * @date $Date: 2005-0 1-11 23:39:41$18 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2005-08-16 01:10:36 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 int main(int argc, char* argv[]) 41 41 { 42 psLogSetFormat("HLNM"); 42 43 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 43 44 } … … 53 54 int testStatus = true; 54 55 psImage *myImage = psImageAlloc(numCols, numRows, PS_TYPE_F32); 55 p sReadout *myReadout = psReadoutAlloc();56 pmReadout *myReadout = pmReadoutAlloc(NULL); 56 57 myReadout->image = myImage; 57 58 psPolynomial1D *myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD); … … 106 107 int tableSize = PS_MAX(numCols, numRows)*2; 107 108 psImage *myImage = psImageAlloc(numCols, numRows, PS_TYPE_F32); 108 p sReadout *myReadout = psReadoutAlloc();109 pmReadout *myReadout = pmReadoutAlloc(NULL); 109 110 myReadout->image = myImage; 110 111 psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32); … … 161 162 int testStatus = true; 162 163 psImage *myImage = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32); 163 p sReadout *myReadout = psReadoutAlloc();164 p sReadout *rc = NULL;164 pmReadout *myReadout = pmReadoutAlloc(NULL); 165 pmReadout *rc = NULL; 165 166 myReadout->image = myImage; 166 167 psPolynomial1D *myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD); … … 178 179 rc = pmNonLinearityPolynomial(NULL, myPoly); 179 180 if (rc != NULL) { 180 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL p sReadout\n");181 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 181 182 testStatus = false; 182 183 } … … 188 189 rc = pmNonLinearityPolynomial(myReadout, myPoly); 189 190 if (rc != NULL) { 190 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL p sReadout\n");191 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 191 192 testStatus = false; 192 193 } … … 197 198 rc = pmNonLinearityPolynomial(myReadout, NULL); 198 199 if (rc != NULL) { 199 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL p sReadout\n");200 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 200 201 testStatus = false; 201 202 } … … 207 208 208 209 209 int test03Init(p sReadout *myReadout)210 int test03Init(pmReadout *myReadout) 210 211 { 211 212 for (psS32 i=0;i<NUM_ROWS;i++) { … … 224 225 int tableSize = PS_MAX(NUM_COLS, NUM_ROWS)*3; 225 226 psImage *myImage = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32); 226 p sReadout *myReadout = psReadoutAlloc();227 p sReadout *rc = NULL;227 pmReadout *myReadout = pmReadoutAlloc(NULL); 228 pmReadout *rc = NULL; 228 229 myReadout->image = myImage; 229 230 psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32); … … 253 254 254 255 printf("------------------------------------------------------------\n"); 255 printf("Calling pmNonLinearityLookup() with NULL input p sReadout. Should generate error, return NULL.\n");256 printf("Calling pmNonLinearityLookup() with NULL input pmReadout. Should generate error, return NULL.\n"); 256 257 rc = pmNonLinearityLookup(NULL, in, out); 257 258 if (rc != NULL) { 258 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL p sReadout\n");259 testStatus = false; 260 } 261 262 printf("------------------------------------------------------------\n"); 263 printf("Calling pmNonLinearityLookup() with NULL input p sReadout->image. Should generate error, return NULL.\n");259 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 260 testStatus = false; 261 } 262 263 printf("------------------------------------------------------------\n"); 264 printf("Calling pmNonLinearityLookup() with NULL input pmReadout->image. Should generate error, return NULL.\n"); 264 265 psImage *tmpImage = myReadout->image; 265 266 myReadout->image = NULL; 266 267 rc = pmNonLinearityLookup(myReadout, in, out); 267 268 if (rc != NULL) { 268 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL p sReadout\n");269 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 269 270 testStatus = false; 270 271 } … … 275 276 rc = pmNonLinearityLookup(myReadout, NULL, out); 276 277 if (rc != NULL) { 277 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL p sReadout\n");278 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 278 279 testStatus = false; 279 280 } … … 283 284 rc = pmNonLinearityLookup(myReadout, in, NULL); 284 285 if (rc != NULL) { 285 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL p sReadout\n");286 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 286 287 testStatus = false; 287 288 } … … 292 293 rc = pmNonLinearityLookup(myReadout, in, outBig); 293 294 if (rc == NULL) { 294 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");295 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 295 296 testStatus = false; 296 297 } … … 312 313 rc = pmNonLinearityLookup(myReadout, in, outSmall); 313 314 if (rc == NULL) { 314 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");315 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 315 316 testStatus = false; 316 317 } … … 331 332 rc = pmNonLinearityLookup(myReadout, inSmall, out); 332 333 if (rc == NULL) { 333 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");334 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 334 335 testStatus = false; 335 336 } … … 350 351 rc = pmNonLinearityLookup(myReadout, inBig, out); 351 352 if (rc == NULL) { 352 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");353 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 353 354 testStatus = false; 354 355 } … … 369 370 rc = pmNonLinearityLookup(myReadout, inSmall, outBig); 370 371 if (rc == NULL) { 371 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");372 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 372 373 testStatus = false; 373 374 } … … 388 389 rc = pmNonLinearityLookup(myReadout, inBig, outSmall); 389 390 if (rc == NULL) { 390 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");391 testStatus = false; 392 } 393 for (i=0;i<NUM_ROWS;i++) { 394 for (j=0;j<NUM_COLS;j++) { 395 psF32 expect = (float) (2 * (i + j)); 396 psF32 actual = rc->image->data.F32[i][j]; 397 if (FLT_EPSILON < fabs(expect - actual)) { 398 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 399 testStatus = false; 400 } 401 } 402 } 403 404 test03Init(myReadout); 405 printf("------------------------------------------------------------\n"); 406 printf("Calling pmNonLinearityLookup() with inFlux psVector size 1. Should generate error, return original p sReadout.\n");391 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 392 testStatus = false; 393 } 394 for (i=0;i<NUM_ROWS;i++) { 395 for (j=0;j<NUM_COLS;j++) { 396 psF32 expect = (float) (2 * (i + j)); 397 psF32 actual = rc->image->data.F32[i][j]; 398 if (FLT_EPSILON < fabs(expect - actual)) { 399 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 400 testStatus = false; 401 } 402 } 403 } 404 405 test03Init(myReadout); 406 printf("------------------------------------------------------------\n"); 407 printf("Calling pmNonLinearityLookup() with inFlux psVector size 1. Should generate error, return original pmReadout.\n"); 407 408 rc = pmNonLinearityLookup(myReadout, inOne, out); 408 409 if (rc != myReadout) { 409 printf("TEST ERROR: pmNonLinearityPolynomial() did not return the original p sReadout\n");410 printf("TEST ERROR: pmNonLinearityPolynomial() did not return the original pmReadout\n"); 410 411 testStatus = false; 411 412 } … … 427 428 rc = pmNonLinearityLookup(myReadout, in, out); 428 429 if (rc == NULL) { 429 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");430 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 430 431 testStatus = false; 431 432 } … … 453 454 rc = pmNonLinearityLookup(myReadout, in, out); 454 455 if (rc == NULL) { 455 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");456 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 456 457 testStatus = false; 457 458 } … … 479 480 rc = pmNonLinearityLookup(myReadout, in, out); 480 481 if (rc == NULL) { 481 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL p sReadout\n");482 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 482 483 testStatus = false; 483 484 } -
trunk/psModules/test/tst_pmObjects01.c
r4579 r4770 19 19 * abd never deallocate, no error is generated. 20 20 * 21 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $22 * @date $Date: 2005-0 7-19 01:44:48$21 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2005-08-16 01:10:36 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 63 63 int main(int argc, char* argv[]) 64 64 { 65 psLogSetFormat("HLNM"); 65 66 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 66 // test02();67 67 } 68 68 … … 76 76 77 77 printf("Testing pmPeakAlloc()...\n"); 78 p sPeak *tmpPeak = pmPeakAlloc(1, 2, 3.0, PM_PEAK_LONE);78 pmPeak *tmpPeak = pmPeakAlloc(1, 2, 3.0, PM_PEAK_LONE); 79 79 if (tmpPeak == NULL) { 80 printf("TEST ERROR: pmPeakAlloc() returned a NULL p sPeak\n");80 printf("TEST ERROR: pmPeakAlloc() returned a NULL pmPeak\n"); 81 81 testStatus = false; 82 82 } else { 83 83 if (tmpPeak->x != 1) { 84 printf("TEST ERROR: pmPeakAlloc() improperly set p sPeak->x\n");84 printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->x\n"); 85 85 testStatus = false; 86 86 } 87 87 if (tmpPeak->y != 2) { 88 printf("TEST ERROR: pmPeakAlloc() improperly set p sPeak->y\n");88 printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->y\n"); 89 89 testStatus = false; 90 90 } 91 91 if (tmpPeak->counts != 3.0) { 92 printf("TEST ERROR: pmPeakAlloc() improperly set p sPeak->counts\n");92 printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->counts\n"); 93 93 testStatus = false; 94 94 } 95 95 if (tmpPeak->class != PM_PEAK_LONE) { 96 printf("TEST ERROR: pmPeakAlloc() improperly set p sPeak->class\n");96 printf("TEST ERROR: pmPeakAlloc() improperly set pmPeak->class\n"); 97 97 testStatus = false; 98 98 } … … 101 101 102 102 printf("Testing pmMomentsAlloc()...\n"); 103 p sMoments *tmpMoments = pmMomentsAlloc();103 pmMoments *tmpMoments = pmMomentsAlloc(); 104 104 if (tmpMoments == NULL) { 105 printf("TEST ERROR: pmMomentsAlloc() returned a NULL p sMoments\n");105 printf("TEST ERROR: pmMomentsAlloc() returned a NULL pmMoments\n"); 106 106 testStatus = false; 107 107 } else { … … 115 115 (fabs(tmpMoments->Sky-0.0) > ERROR_TOL) || 116 116 (tmpMoments->nPixels != 0)) { 117 printf("TEST ERROR: pmMomentsAlloc() did not properly initialize the p sMoments structure.\n");117 printf("TEST ERROR: pmMomentsAlloc() did not properly initialize the pmMoments structure.\n"); 118 118 testStatus = false; 119 119 } … … 122 122 123 123 printf("Testing pmModelAlloc(PS_MODEL_GAUSS)...\n"); 124 p sModel *tmpModel = pmModelAlloc(PS_MODEL_GAUSS);124 pmModel *tmpModel = pmModelAlloc(PS_MODEL_GAUSS); 125 125 if (tmpModel == NULL) { 126 printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) returned a NULL p sModel\n");126 printf("TEST ERROR: pmModelAlloc(PS_MODEL_GAUSS) returned a NULL pmModel\n"); 127 127 testStatus = false; 128 128 } else { … … 146 146 tmpModel = pmModelAlloc(PS_MODEL_PGAUSS); 147 147 if (tmpModel == NULL) { 148 printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) returned a NULL p sModel\n");148 printf("TEST ERROR: pmModelAlloc(PS_MODEL_PGAUSS) returned a NULL pmModel\n"); 149 149 testStatus = false; 150 150 } else { … … 168 168 tmpModel = pmModelAlloc(PS_MODEL_TWIST_GAUSS); 169 169 if (tmpModel == NULL) { 170 printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) returned a NULL p sModel\n");170 printf("TEST ERROR: pmModelAlloc(PS_MODEL_TWIST_GAUSS) returned a NULL pmModel\n"); 171 171 testStatus = false; 172 172 } else { … … 190 190 tmpModel = pmModelAlloc(PS_MODEL_WAUSS); 191 191 if (tmpModel == NULL) { 192 printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) returned a NULL p sModel\n");192 printf("TEST ERROR: pmModelAlloc(PS_MODEL_WAUSS) returned a NULL pmModel\n"); 193 193 testStatus = false; 194 194 } else { … … 212 212 tmpModel = pmModelAlloc(PS_MODEL_SERSIC); 213 213 if (tmpModel == NULL) { 214 printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) returned a NULL p sModel\n");214 printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC) returned a NULL pmModel\n"); 215 215 testStatus = false; 216 216 } else { … … 234 234 tmpModel = pmModelAlloc(PS_MODEL_SERSIC_CORE); 235 235 if (tmpModel == NULL) { 236 printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) returned a NULL p sModel\n");236 printf("TEST ERROR: pmModelAlloc(PS_MODEL_SERSIC_CORE) returned a NULL pmModel\n"); 237 237 testStatus = false; 238 238 } else { … … 253 253 psFree(tmpModel); 254 254 255 p sSource *tmpSource = pmSourceAlloc();255 pmSource *tmpSource = pmSourceAlloc(); 256 256 if (tmpSource == NULL) { 257 printf("TEST ERROR: pmSourceAlloc() returned a NULL p sSource\n");257 printf("TEST ERROR: pmSourceAlloc() returned a NULL pmSource\n"); 258 258 testStatus = false; 259 259 } … … 545 545 // HEY: verify 546 546 for (psS32 i = 0 ; i < outData->n ; i++) { 547 p sPeak *tmpPeak = (psPeak *) outData->data[i];547 pmPeak *tmpPeak = (pmPeak *) outData->data[i]; 548 548 if (((tmpPeak->x == 0) && (tmpPeak->y == 0)) || 549 549 ((tmpPeak->x == 0) && (tmpPeak->y == numRows-1)) || … … 803 803 } 804 804 } 805 p sSource *rc = NULL;806 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),805 pmSource *rc = NULL; 806 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2), 807 807 (psF32) (TST04_NUM_COLS / 2), 808 808 200.0, … … 813 813 rc = pmSourceLocalSky(NULL, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0); 814 814 if (rc != NULL) { 815 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");815 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 816 816 psFree(rc); 817 817 testStatus = false; … … 822 822 rc = pmSourceLocalSky(imgDataF64, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0); 823 823 if (rc != NULL) { 824 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");824 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 825 825 psFree(rc); 826 826 testStatus = false; … … 828 828 829 829 printf("----------------------------------------------------------------------------------\n"); 830 printf("Calling pmSourceLocalSky with NULL p sPeak. Should generate error and return NULL.\n");830 printf("Calling pmSourceLocalSky with NULL pmPeak. Should generate error and return NULL.\n"); 831 831 rc = pmSourceLocalSky(imgData, NULL, PS_STAT_SAMPLE_MEAN, 10.0, 20.0); 832 832 if (rc != NULL) { 833 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");833 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 834 834 psFree(rc); 835 835 testStatus = false; … … 840 840 rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, -10.0, 20.0); 841 841 if (rc != NULL) { 842 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");842 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 843 843 psFree(rc); 844 844 testStatus = false; … … 849 849 rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 5.0); 850 850 if (rc != NULL) { 851 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");851 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 852 852 psFree(rc); 853 853 testStatus = false; … … 861 861 rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0); 862 862 if (rc != NULL) { 863 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");863 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 864 864 psFree(rc); 865 865 testStatus = false; … … 872 872 rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0); 873 873 if (rc != NULL) { 874 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");874 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 875 875 psFree(rc); 876 876 testStatus = false; … … 883 883 rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, 10.0, 20.0); 884 884 if (rc != NULL) { 885 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");885 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 886 886 psFree(rc); 887 887 testStatus = false; … … 894 894 rc = pmSourceLocalSky(imgData, tmpPeak, PS_STAT_SAMPLE_MEAN, (psF32) TST04_INNER_RADIUS, (psF32) TST04_OUTER_RADIUS); 895 895 if (rc != NULL) { 896 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL p sSource.\n");896 printf("TEST ERROR: pmSourceLocalSky() returned a non-NULL pmSource.\n"); 897 897 psFree(rc); 898 898 testStatus = false; … … 915 915 916 916 if (rc == NULL) { 917 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");917 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 918 918 testStatus = false; 919 919 } else { 920 920 if (rc->peak == NULL) { 921 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource->peak.\n");921 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource->peak.\n"); 922 922 testStatus = false; 923 923 } else { 924 924 if (rc->peak->x != tmpPeak->x) { 925 printf("TEST ERROR: pmSourceLocalSky() p sSource->peak->x was %d, should have been %d.\n", rc->peak->x, tmpPeak->x);925 printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->x was %d, should have been %d.\n", rc->peak->x, tmpPeak->x); 926 926 testStatus = false; 927 927 } 928 928 929 929 if (rc->peak->y != tmpPeak->y) { 930 printf("TEST ERROR: pmSourceLocalSky() p sSource->peak->y was %d, should have been %d.\n", rc->peak->y, tmpPeak->y);930 printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->y was %d, should have been %d.\n", rc->peak->y, tmpPeak->y); 931 931 testStatus = false; 932 932 } 933 933 934 934 if (rc->peak->counts != tmpPeak->counts) { 935 printf("TEST ERROR: pmSourceLocalSky() p sSource->peak->counts was %f, should have been %f.\n", rc->peak->counts, tmpPeak->counts);935 printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->counts was %f, should have been %f.\n", rc->peak->counts, tmpPeak->counts); 936 936 testStatus = false; 937 937 } 938 938 939 939 if (rc->peak->class != tmpPeak->class) { 940 printf("TEST ERROR: pmSourceLocalSky() p sSource->peak->class was %d, should have been %d.\n", rc->peak->class, tmpPeak->class);940 printf("TEST ERROR: pmSourceLocalSky() pmSource->peak->class was %d, should have been %d.\n", rc->peak->class, tmpPeak->class); 941 941 testStatus = false; 942 942 } … … 944 944 945 945 if (rc->pixels == NULL) { 946 printf("TEST ERROR: pmSourceLocalSky() p sSource->pixels was NULL.\n");946 printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels was NULL.\n"); 947 947 testStatus = false; 948 948 } else { 949 949 if (rc->pixels->numRows != (2 * TST04_OUTER_RADIUS)) { 950 printf("TEST ERROR: pmSourceLocalSky() p sSource->pixels->numRows was %d, should have been %d.\n",950 printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->numRows was %d, should have been %d.\n", 951 951 rc->pixels->numRows, (2 * TST04_OUTER_RADIUS)); 952 952 testStatus = false; … … 954 954 955 955 if (rc->pixels->numCols != (2 * TST04_OUTER_RADIUS)) { 956 printf("TEST ERROR: pmSourceLocalSky() p sSource->pixels->numCols was %d, should have been %d.\n",956 printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->numCols was %d, should have been %d.\n", 957 957 rc->pixels->numCols, (2 * TST04_OUTER_RADIUS)); 958 958 testStatus = false; … … 960 960 961 961 if (rc->pixels->col0 != (tmpPeak->x - TST04_OUTER_RADIUS)) { 962 printf("TEST ERROR: pmSourceLocalSky() p sSource->pixels->col0 was %d, should have been %d.\n",962 printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->col0 was %d, should have been %d.\n", 963 963 rc->pixels->col0, (tmpPeak->x - TST04_OUTER_RADIUS)); 964 964 testStatus = false; … … 966 966 967 967 if (rc->pixels->row0 != (tmpPeak->y - TST04_OUTER_RADIUS)) { 968 printf("TEST ERROR: pmSourceLocalSky() p sSource->pixels->row0 was %d, should have been %d.\n",968 printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->row0 was %d, should have been %d.\n", 969 969 rc->pixels->row0, (tmpPeak->y - TST04_OUTER_RADIUS)); 970 970 testStatus = false; … … 972 972 973 973 if (rc->pixels->type.type != PS_TYPE_F32) { 974 printf("TEST ERROR: pmSourceLocalSky() p sSource->pixels->type was %d, should have been %d.\n",974 printf("TEST ERROR: pmSourceLocalSky() pmSource->pixels->type was %d, should have been %d.\n", 975 975 rc->pixels->type.type, PS_TYPE_F32); 976 976 testStatus = false; … … 982 982 983 983 if (rc->mask == NULL) { 984 printf("TEST ERROR: pmSourceLocalSky() p sSource->mask was NULL.\n");984 printf("TEST ERROR: pmSourceLocalSky() pmSource->mask was NULL.\n"); 985 985 testStatus = false; 986 986 } else { 987 987 if (rc->mask->numRows != (2 * TST04_OUTER_RADIUS)) { 988 printf("TEST ERROR: pmSourceLocalSky() p sSource->mask->numRows was %d, should have been %d.\n",988 printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->numRows was %d, should have been %d.\n", 989 989 rc->mask->numRows, (2 * TST04_OUTER_RADIUS)); 990 990 testStatus = false; … … 992 992 993 993 if (rc->mask->numCols != (2 * TST04_OUTER_RADIUS)) { 994 printf("TEST ERROR: pmSourceLocalSky() p sSource->mask->numCols was %d, should have been %d.\n",994 printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->numCols was %d, should have been %d.\n", 995 995 rc->mask->numCols, (2 * TST04_OUTER_RADIUS)); 996 996 testStatus = false; … … 998 998 999 999 if (rc->mask->type.type != PS_TYPE_U8) { 1000 printf("TEST ERROR: pmSourceLocalSky() p sSource->mask->type was %d, should have been %d.\n",1000 printf("TEST ERROR: pmSourceLocalSky() pmSource->mask->type was %d, should have been %d.\n", 1001 1001 rc->mask->type.type, PS_TYPE_U8); 1002 1002 testStatus = false; … … 1018 1018 } 1019 1019 if (maskedPixels != PS_SQR(2*(TST04_INNER_RADIUS-1))) { 1020 printf("TEST ERROR: pmSourceLocalSky() p sSource->mask had %d masked pixels, should have been %d.\n",1020 printf("TEST ERROR: pmSourceLocalSky() pmSource->mask had %d masked pixels, should have been %d.\n", 1021 1021 maskedPixels, PS_SQR(2*(TST04_INNER_RADIUS-1))); 1022 1022 testStatus = false; 1023 1023 } 1024 1024 if (unmaskedPixels != (PS_SQR(2*TST04_OUTER_RADIUS) - PS_SQR(2*(TST04_INNER_RADIUS-1)))) { 1025 printf("TEST ERROR: pmSourceLocalSky() p sSource->mask had %d masked pixels, should have been %d.\n",1025 printf("TEST ERROR: pmSourceLocalSky() pmSource->mask had %d masked pixels, should have been %d.\n", 1026 1026 unmaskedPixels, (PS_SQR(2*TST04_OUTER_RADIUS) - PS_SQR(2*(TST04_INNER_RADIUS-1)))); 1027 1027 testStatus = false; … … 1030 1030 1031 1031 if (rc->moments == NULL) { 1032 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource->moments.\n");1032 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource->moments.\n"); 1033 1033 testStatus = false; 1034 1034 } else { 1035 1035 if (rc->moments->Sky != TST04_SKY) { 1036 printf("TEST ERROR: pmSourceLocalSky() p sSource->moments->Sky was %f, should have been %f.\n", rc->moments->Sky, TST04_SKY);1036 printf("TEST ERROR: pmSourceLocalSky() pmSource->moments->Sky was %f, should have been %f.\n", rc->moments->Sky, TST04_SKY); 1037 1037 testStatus = false; 1038 1038 } … … 1063 1063 { 1064 1064 bool testStatus = true; 1065 p sSource *tmpSource = NULL;1065 pmSource *tmpSource = NULL; 1066 1066 bool rc = false; 1067 1067 // Create the image used in this test. … … 1080 1080 1081 1081 // 1082 // Create a p sPeak with the center pixel set to the peak.1083 // 1084 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST06_NUM_ROWS / 2),1082 // Create a pmPeak with the center pixel set to the peak. 1083 // 1084 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST06_NUM_ROWS / 2), 1085 1085 (psF32) (TST06_NUM_COLS / 2), 1086 1086 200.0, … … 1093 1093 (psF32) TST06_OUTER_RADIUS); 1094 1094 if (tmpSource == NULL) { 1095 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");1095 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1096 1096 psFree(imgData); 1097 1097 psFree(imgDataF64); … … 1102 1102 1103 1103 printf("----------------------------------------------------------------------------------\n"); 1104 printf("Calling pmSourceSetPixelsCircle with NULL p sSource. Should generate error and return NULL.\n");1104 printf("Calling pmSourceSetPixelsCircle with NULL pmSource. Should generate error and return NULL.\n"); 1105 1105 rc = pmSourceSetPixelsCircle(NULL, imgData, 10.0); 1106 1106 if (rc == true) { … … 1108 1108 testStatus = false; 1109 1109 } 1110 // XXX: test with p sSource->peaks NULL1110 // XXX: test with pmSource->peaks NULL 1111 1111 1112 1112 printf("----------------------------------------------------------------------------------\n"); … … 1218 1218 { 1219 1219 bool testStatus = true; 1220 p sSource *tmpSource = NULL;1221 p sSource *rc = NULL;1220 pmSource *tmpSource = NULL; 1221 pmSource *rc = NULL; 1222 1222 // Create the image used in this test. 1223 1223 psImage *imgData = psImageAlloc(TST05_NUM_COLS, TST05_NUM_ROWS, PS_TYPE_F32); … … 1229 1229 1230 1230 // 1231 // Create a p sPeak with the center pixel set to the peak.1232 // 1233 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST05_NUM_ROWS / 2),1231 // Create a pmPeak with the center pixel set to the peak. 1232 // 1233 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST05_NUM_ROWS / 2), 1234 1234 (psF32) (TST05_NUM_COLS / 2), 1235 1235 200.0, … … 1242 1242 (psF32) TST05_OUTER_RADIUS); 1243 1243 if (tmpSource == NULL) { 1244 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");1244 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1245 1245 psFree(tmpSource); 1246 1246 testStatus = false; … … 1249 1249 1250 1250 printf("----------------------------------------------------------------------------------\n"); 1251 printf("Calling pmSourceMoments with NULL p sSource. Should generate error and return NULL.\n");1251 printf("Calling pmSourceMoments with NULL pmSource. Should generate error and return NULL.\n"); 1252 1252 rc = pmSourceMoments(NULL, 10.0); 1253 1253 if (rc != NULL) { 1254 printf("TEST ERROR: pmSourceMoments() returned a non-NULL p sSource.\n");1255 testStatus = false; 1256 } 1257 // XXX: test with p sSource->peaks NULL1258 // XXX: test with p sSource->pixels NULL1259 // XXX: test with p sSource->mask NULL1254 printf("TEST ERROR: pmSourceMoments() returned a non-NULL pmSource.\n"); 1255 testStatus = false; 1256 } 1257 // XXX: test with pmSource->peaks NULL 1258 // XXX: test with pmSource->pixels NULL 1259 // XXX: test with pmSource->mask NULL 1260 1260 1261 1261 printf("----------------------------------------------------------------------------------\n"); … … 1263 1263 rc = pmSourceMoments(tmpSource, -10.0); 1264 1264 if (rc != NULL) { 1265 printf("TEST ERROR: pmSourceMoments() returned a non-NULL p sSource.\n");1265 printf("TEST ERROR: pmSourceMoments() returned a non-NULL pmSource.\n"); 1266 1266 testStatus = false; 1267 1267 } … … 1485 1485 } 1486 1486 } 1487 p sSource *mySrc = NULL;1487 pmSource *mySrc = NULL; 1488 1488 bool rc = false; 1489 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2),1489 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST04_NUM_ROWS / 2), 1490 1490 (psF32) (TST04_NUM_COLS / 2), 1491 1491 200.0, … … 1502 1502 1503 1503 if (mySrc == NULL) { 1504 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");1505 testStatus = false; 1506 } 1507 1508 printf("----------------------------------------------------------------------------------\n"); 1509 printf("Calling pmSourceModelGuess with NULL p sSource. Should generate error, return FALSE.\n");1504 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1505 testStatus = false; 1506 } 1507 1508 printf("----------------------------------------------------------------------------------\n"); 1509 printf("Calling pmSourceModelGuess with NULL pmSource. Should generate error, return FALSE.\n"); 1510 1510 rc = pmSourceModelGuess(NULL, imgData, PS_MODEL_GAUSS); 1511 1511 if (rc == true) { … … 1606 1606 } 1607 1607 } 1608 p sSource *mySrc = NULL;1608 pmSource *mySrc = NULL; 1609 1609 psArray *rc = NULL; 1610 1610 1611 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST09_NUM_ROWS / 2),1611 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST09_NUM_ROWS / 2), 1612 1612 (psF32) (TST09_NUM_COLS / 2), 1613 1613 200.0, … … 1624 1624 1625 1625 if (mySrc == NULL) { 1626 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");1626 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1627 1627 testStatus = false; 1628 1628 } … … 1635 1635 1636 1636 printf("----------------------------------------------------------------------------------\n"); 1637 printf("Calling pmSourceContour with NULL p sSource . Should generate error, return NULL.\n");1637 printf("Calling pmSourceContour with NULL pmSource . Should generate error, return NULL.\n"); 1638 1638 rc = pmSourceContour(NULL, imgData, LEVEL, PS_CONTOUR_CRUDE); 1639 1639 if (rc != NULL) { … … 1660 1660 printf("Calling pmSourceContour with acceptable data.\n"); 1661 1661 printf("NOTE: must figure out the parameters for this test to be meaningful.\n"); 1662 mySrc->model s->params->data.F32[0] = TST09_SKY;1663 mySrc->model s->params->data.F32[1] = 15.0;1664 mySrc->model s->params->data.F32[2] = (psF32) (TST09_NUM_ROWS / 2);1665 mySrc->model s->params->data.F32[3] = (psF32) (TST09_NUM_COLS / 2);1666 mySrc->model s->params->data.F32[4] = 2.0;1667 mySrc->model s->params->data.F32[5] = 2.0;1668 mySrc->model s->params->data.F32[6] = 2.0;1662 mySrc->modelPSF->params->data.F32[0] = TST09_SKY; 1663 mySrc->modelPSF->params->data.F32[1] = 15.0; 1664 mySrc->modelPSF->params->data.F32[2] = (psF32) (TST09_NUM_ROWS / 2); 1665 mySrc->modelPSF->params->data.F32[3] = (psF32) (TST09_NUM_COLS / 2); 1666 mySrc->modelPSF->params->data.F32[4] = 2.0; 1667 mySrc->modelPSF->params->data.F32[5] = 2.0; 1668 mySrc->modelPSF->params->data.F32[6] = 2.0; 1669 1669 rc = pmSourceContour(mySrc, imgData, LEVEL, PS_CONTOUR_CRUDE); 1670 1670 if (rc == NULL) { … … 1703 1703 } 1704 1704 } 1705 p sSource *mySrc = NULL;1705 pmSource *mySrc = NULL; 1706 1706 psBool rc = false; 1707 1707 1708 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST15_NUM_ROWS / 2),1708 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST15_NUM_ROWS / 2), 1709 1709 (psF32) (TST15_NUM_COLS / 2), 1710 1710 200.0, … … 1721 1721 1722 1722 if (mySrc == NULL) { 1723 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");1724 testStatus = false; 1725 } 1726 1727 mySrc->model s= pmModelAlloc(PS_MODEL_GAUSS);1728 mySrc->model s->params->data.F32[0] = 5.0;1729 mySrc->model s->params->data.F32[1] = 70.0;1730 mySrc->model s->params->data.F32[2] = (psF32) (TST15_NUM_ROWS / 2);1731 mySrc->model s->params->data.F32[3] = (psF32) (TST15_NUM_COLS / 2);1732 mySrc->model s->params->data.F32[4] = 1.0;1733 mySrc->model s->params->data.F32[5] = 1.0;1734 mySrc->model s->params->data.F32[6] = 2.0;1723 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1724 testStatus = false; 1725 } 1726 1727 mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS); 1728 mySrc->modelPSF->params->data.F32[0] = 5.0; 1729 mySrc->modelPSF->params->data.F32[1] = 70.0; 1730 mySrc->modelPSF->params->data.F32[2] = (psF32) (TST15_NUM_ROWS / 2); 1731 mySrc->modelPSF->params->data.F32[3] = (psF32) (TST15_NUM_COLS / 2); 1732 mySrc->modelPSF->params->data.F32[4] = 1.0; 1733 mySrc->modelPSF->params->data.F32[5] = 1.0; 1734 mySrc->modelPSF->params->data.F32[6] = 2.0; 1735 1735 1736 1736 printf("----------------------------------------------------------------------------------\n"); … … 1783 1783 } 1784 1784 } 1785 p sSource *mySrc = NULL;1785 pmSource *mySrc = NULL; 1786 1786 psBool rc = false; 1787 1787 1788 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST16_NUM_ROWS / 2),1788 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST16_NUM_ROWS / 2), 1789 1789 (psF32) (TST16_NUM_COLS / 2), 1790 1790 200.0, … … 1801 1801 1802 1802 if (mySrc == NULL) { 1803 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");1804 testStatus = false; 1805 } 1806 1807 mySrc->model s= pmModelAlloc(PS_MODEL_GAUSS);1808 mySrc->model s->params->data.F32[0] = 5.0;1809 mySrc->model s->params->data.F32[1] = 70.0;1810 mySrc->model s->params->data.F32[2] = (psF32) (TST16_NUM_ROWS / 2);1811 mySrc->model s->params->data.F32[3] = (psF32) (TST16_NUM_COLS / 2);1812 mySrc->model s->params->data.F32[4] = 1.0;1813 mySrc->model s->params->data.F32[5] = 1.0;1814 mySrc->model s->params->data.F32[6] = 2.0;1803 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1804 testStatus = false; 1805 } 1806 1807 mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS); 1808 mySrc->modelPSF->params->data.F32[0] = 5.0; 1809 mySrc->modelPSF->params->data.F32[1] = 70.0; 1810 mySrc->modelPSF->params->data.F32[2] = (psF32) (TST16_NUM_ROWS / 2); 1811 mySrc->modelPSF->params->data.F32[3] = (psF32) (TST16_NUM_COLS / 2); 1812 mySrc->modelPSF->params->data.F32[4] = 1.0; 1813 mySrc->modelPSF->params->data.F32[5] = 1.0; 1814 mySrc->modelPSF->params->data.F32[6] = 2.0; 1815 1815 1816 1816 printf("----------------------------------------------------------------------------------\n"); … … 1863 1863 } 1864 1864 } 1865 p sSource *mySrc = NULL;1865 pmSource *mySrc = NULL; 1866 1866 psBool rc = false; 1867 1867 1868 p sPeak *tmpPeak = pmPeakAlloc((psF32) (TST20_NUM_ROWS / 2),1868 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST20_NUM_ROWS / 2), 1869 1869 (psF32) (TST20_NUM_COLS / 2), 1870 1870 200.0, … … 1881 1881 1882 1882 if (mySrc == NULL) { 1883 printf("TEST ERROR: pmSourceLocalSky() returned a NULL p sSource.\n");1884 testStatus = false; 1885 } 1886 1887 mySrc->model s= pmModelAlloc(PS_MODEL_GAUSS);1888 1889 1890 mySrc->model s->params->data.F32[0] = 5.0;1891 mySrc->model s->params->data.F32[1] = 70.0;1892 mySrc->model s->params->data.F32[2] = (psF32) (TST20_NUM_ROWS / 2);1893 mySrc->model s->params->data.F32[3] = (psF32) (TST20_NUM_COLS / 2);1894 mySrc->model s->params->data.F32[4] = 1.0;1895 mySrc->model s->params->data.F32[5] = 1.0;1896 mySrc->model s->params->data.F32[6] = 2.0;1883 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1884 testStatus = false; 1885 } 1886 1887 mySrc->modelPSF = pmModelAlloc(PS_MODEL_GAUSS); 1888 1889 1890 mySrc->modelPSF->params->data.F32[0] = 5.0; 1891 mySrc->modelPSF->params->data.F32[1] = 70.0; 1892 mySrc->modelPSF->params->data.F32[2] = (psF32) (TST20_NUM_ROWS / 2); 1893 mySrc->modelPSF->params->data.F32[3] = (psF32) (TST20_NUM_COLS / 2); 1894 mySrc->modelPSF->params->data.F32[4] = 1.0; 1895 mySrc->modelPSF->params->data.F32[5] = 1.0; 1896 mySrc->modelPSF->params->data.F32[6] = 2.0; 1897 1897 1898 1898 printf("----------------------------------------------------------------------------------\n"); … … 1905 1905 1906 1906 printf("----------------------------------------------------------------------------------\n"); 1907 printf("Calling pmSourceFitModel with NULL p sSource. Should generate error, return FALSE.\n");1907 printf("Calling pmSourceFitModel with NULL pmSource. Should generate error, return FALSE.\n"); 1908 1908 rc = pmSourceFitModel(NULL, imgData); 1909 1909 if (rc == true) { -
trunk/psModules/test/tst_pmReadoutCombine.c
r2945 r4770 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 1-10 22:22:52$7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-08-16 01:10:36 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 56 56 int main(int argc, char* argv[]) 57 57 { 58 psLogSetFormat("HLNM"); 58 59 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 59 60 } … … 118 119 *(int *) (& (tmpImage->col0)) = baseCols[r]; 119 120 /* 120 p sReadout *tmpReadout = psReadoutAlloc(baseColsReadout[r],121 pmReadout *tmpReadout = pmReadoutAlloc(baseColsReadout[r], 121 122 baseRowsReadout[r], 122 123 tmpImage); 123 124 */ 124 p sReadout *tmpReadout = psReadoutAlloc();125 pmReadout *tmpReadout = pmReadoutAlloc(NULL); 125 126 tmpReadout->image = tmpImage; 126 127 … … 154 155 psListElem *tmpInput = (psListElem *) list->head; 155 156 while (NULL != tmpInput) { 156 p sReadout *tmpReadout = (psReadout *) tmpInput->data;157 pmReadout *tmpReadout = (pmReadout *) tmpInput->data; 157 158 psFree(tmpReadout); 158 159 tmpInput = tmpInput->next; … … 236 237 *(int *) (& (tmpImage->col0)) = baseCols[r]; 237 238 /* 238 p sReadout *tmpReadout = psReadoutAlloc(baseColsReadout[r],239 pmReadout *tmpReadout = pmReadoutAlloc(baseColsReadout[r], 239 240 baseRowsReadout[r], 240 241 tmpImage); 241 242 */ 242 p sReadout *tmpReadout = psReadoutAlloc();243 pmReadout *tmpReadout = pmReadoutAlloc(NULL); 243 244 tmpReadout->image = tmpImage; 244 245 minOutRow = PS_MIN(minOutRow, (baseRowsReadout[r] + baseRows[r])); … … 441 442 psListElem *tmpInput = (psListElem *) list->head; 442 443 while (NULL != tmpInput) { 443 p sReadout *tmpReadout = (psReadout *) tmpInput->data;444 pmReadout *tmpReadout = (pmReadout *) tmpInput->data; 444 445 psFree(tmpReadout); 445 446 tmpInput = tmpInput->next; -
trunk/psModules/test/tst_pmSubtractBias.c
r3582 r4770 14 14 * @author GLG, MHPCC 15 15 * 16 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 3-31 02:01:57$16 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-08-16 01:10:36 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 int main(int argc, char* argv[]) 43 43 { 44 psLogSetFormat("HLNM"); 44 45 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 45 46 } … … 48 49 #define NUM_COLS 8 49 50 /****************************************************************************** 50 doSubtractBiasFullFrame(): a sample p sReadout as well as a bias image are51 created and the bias image is subtracted from the p sReadout.51 doSubtractBiasFullFrame(): a sample pmReadout as well as a bias image are 52 created and the bias image is subtracted from the pmReadout. 52 53 *****************************************************************************/ 53 54 int doSubtractBiasFullFrame(int numCols, int numRows) … … 60 61 psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 61 62 psImage *tmpImage2 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 62 // p sReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImage1);63 // p sReadout *myBias = psReadoutAlloc(numCols, numRows, tmpImage2);64 p sReadout *myReadout = psReadoutAlloc();65 p sReadout *myBias = psReadoutAlloc();63 // pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImage1); 64 // pmReadout *myBias = pmReadoutAlloc(numCols, numRows, tmpImage2); 65 pmReadout *myReadout = pmReadoutAlloc(NULL); 66 pmReadout *myBias = pmReadoutAlloc(NULL); 66 67 myReadout->image = tmpImage1; 67 68 myBias->image = tmpImage2; … … 110 111 111 112 /****************************************************************************** 112 doSubtractFullOverscans(): a sample p sReadout as well as several overscan113 doSubtractFullOverscans(): a sample pmReadout as well as several overscan 113 114 images of the same size are created. The overscan images are then subtracted 114 from the p sReadout.115 from the pmReadout. 115 116 *****************************************************************************/ 116 117 int doSubtractFullOverscans(int numCols, int numRows) … … 125 126 psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 126 127 psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 127 // p sReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImage1);128 p sReadout *myReadout = psReadoutAlloc();128 // pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImage1); 129 pmReadout *myReadout = pmReadoutAlloc(NULL); 129 130 myReadout->image = tmpImage1; 130 131 … … 185 186 186 187 /****************************************************************************** 187 doSubtractFullOverscans(): a sample p sReadout as well as several overscan188 doSubtractFullOverscans(): a sample pmReadout as well as several overscan 188 189 images of the same size are created. The overscan images are collected 189 pixel-by-pixel then subtracted column-wise from the p sReadout.190 pixel-by-pixel then subtracted column-wise from the pmReadout. 190 191 *****************************************************************************/ 191 192 int doSubtractFullOverscanColumns(int numCols, int numRows) … … 200 201 psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 201 202 psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 202 p sReadout *myReadout = psReadoutAlloc();203 pmReadout *myReadout = pmReadoutAlloc(NULL); 203 204 myReadout->image = tmpImage1; 204 205 psList *list; … … 245 246 } 246 247 /****************************************************************************** 247 doSubtractFullOverscans(): a sample p sReadout as well as several overscan248 doSubtractFullOverscans(): a sample pmReadout as well as several overscan 248 249 images of the same size are created. The overscan images are collected 249 pixel-by-pixel then subtracted column-wise from the p sReadout.250 pixel-by-pixel then subtracted column-wise from the pmReadout. 250 251 *****************************************************************************/ 251 252 int doSubtractFullOverscanColumnsPoly(int numCols, int numRows) … … 260 261 psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 261 262 psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 262 p sReadout *myReadout = psReadoutAlloc();263 pmReadout *myReadout = pmReadoutAlloc(NULL); 263 264 myReadout->image = tmpImage1; 264 265 psList *list; … … 307 308 } 308 309 /****************************************************************************** 309 doSubtractFullOverscansSmall(): a sample p sReadout as well as several overscan310 doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan 310 311 images of smaller size are created. The overscan images are collected 311 pixel-by-pixel then subtracted column-wise from the p sReadout.312 pixel-by-pixel then subtracted column-wise from the pmReadout. 312 313 *****************************************************************************/ 313 314 int doSubtractFullOverscanColumnsSmall(int numCols, int numRows) … … 319 320 int testStatus = 0; 320 321 psImage *tmpImage1 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 321 p sReadout *myReadout = psReadoutAlloc();322 pmReadout *myReadout = pmReadoutAlloc(NULL); 322 323 myReadout->image = tmpImage1; 323 324 psImage *tmpImage2 = psImageAlloc(numCols/2, numRows/2, PS_TYPE_F32); … … 390 391 391 392 /****************************************************************************** 392 doSubtractFullOverscans(): a sample p sReadout as well as several overscan393 doSubtractFullOverscans(): a sample pmReadout as well as several overscan 393 394 images of the same size are created. The overscan images are collected 394 pixel-by-pixel then subtracted row-wise from the p sReadout.395 pixel-by-pixel then subtracted row-wise from the pmReadout. 395 396 *****************************************************************************/ 396 397 int doSubtractFullOverscanRows(int numCols, int numRows) … … 405 406 psImage *tmpImage3 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 406 407 psImage *tmpImage4 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 407 p sReadout *myReadout = psReadoutAlloc();408 pmReadout *myReadout = pmReadoutAlloc(NULL); 408 409 myReadout->image = tmpImage1; 409 410 psList *list; … … 451 452 452 453 /****************************************************************************** 453 doSubtractFullOverscansSmall(): a sample p sReadout as well as several overscan454 doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan 454 455 images of smaller size are created. The overscan images are collected 455 pixel-by-pixel then subtracted row-wise from the p sReadout.456 pixel-by-pixel then subtracted row-wise from the pmReadout. 456 457 *****************************************************************************/ 457 458 int doSubtractFullOverscanRowsSmall(int numCols, int numRows) … … 474 475 psImage *tmpImage3 = psImageAlloc(OSnumCols, OSnumRows, PS_TYPE_F32); 475 476 psImage *tmpImage4 = psImageAlloc(OSnumCols, OSnumRows, PS_TYPE_F32); 476 p sReadout *myReadout = psReadoutAlloc();477 pmReadout *myReadout = pmReadoutAlloc(NULL); 477 478 myReadout->image = tmpImage1; 478 479 psList *list; … … 554 555 psImage *tmpImage3Short = psImageAlloc(numCols-1, numRows-1, PS_TYPE_F32); 555 556 psImage *tmpImage4Short = psImageAlloc(numCols-1, numRows-1, PS_TYPE_F32); 556 p sReadout *myReadout = psReadoutAlloc();557 pmReadout *myReadout = pmReadoutAlloc(NULL); 557 558 myReadout->image = tmpImage1; 558 p sReadout *rc = NULL;559 pmReadout *rc = NULL; 559 560 psList *list; 560 561 psList *listShort; 561 562 psStats *stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 562 563 psImage *tmpImage5 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 563 p sReadout *myBias = psReadoutAlloc();564 pmReadout *myBias = pmReadoutAlloc(NULL); 564 565 myBias->image = tmpImage5; 565 566 printPositiveTestHeader(stdout, "pmSubtractBias", "Testing input parameter error conditions"); 566 567 567 568 psImage *tmpImage5ShortRows = psImageAlloc(numCols, numRows-1, PS_TYPE_F32); 568 p sReadout *myBiasShortRows = psReadoutAlloc();569 pmReadout *myBiasShortRows = pmReadoutAlloc(NULL); 569 570 myBiasShortRows->image = tmpImage5ShortRows; 570 571 psImage *tmpImage5ShortCols = psImageAlloc(numCols-1, numRows, PS_TYPE_F32); 571 p sReadout *myBiasShortCols = psReadoutAlloc();572 pmReadout *myBiasShortCols = pmReadoutAlloc(NULL); 572 573 myBiasShortCols->image = tmpImage5ShortCols; 573 574 … … 611 612 rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_ALL, stat, 0, PM_FIT_NONE, NULL); 612 613 if (rc != myReadout) { 613 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");614 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 614 615 testStatus = false; 615 616 } … … 619 620 rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_ROWS, stat, 0, PM_FIT_NONE, NULL); 620 621 if (rc != myReadout) { 621 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");622 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 622 623 testStatus = false; 623 624 psFree(rc); … … 628 629 rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_COLUMNS, stat, 0, PM_FIT_NONE, NULL); 629 630 if (rc != myReadout) { 630 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");631 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 631 632 testStatus = false; 632 633 psFree(rc); … … 694 695 rc = pmSubtractBias(myReadout, NULL, NULL, PM_OVERSCAN_NONE, stat, 0, PM_FIT_SPLINE, myBias); 695 696 if (rc != myReadout) { 696 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");697 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 697 698 testStatus = false; 698 699 psFree(rc); … … 770 771 0, PM_FIT_NONE, myBiasShortRows); 771 772 if (rc != myReadout) { 772 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");773 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 773 774 testStatus = false; 774 775 psFree(rc); … … 781 782 0, PM_FIT_NONE, myBiasShortCols); 782 783 if (rc != myReadout) { 783 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");784 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 784 785 testStatus = false; 785 786 psFree(rc); … … 791 792 0, 54321, NULL); 792 793 if (rc != myReadout) { 793 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");794 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 794 795 testStatus = false; 795 796 psFree(rc); … … 801 802 0, PM_FIT_NONE, NULL); 802 803 if (rc != myReadout) { 803 printf("TEST ERROR: pmSubtractBias() did not return input p sReadout.\n");804 printf("TEST ERROR: pmSubtractBias() did not return input pmReadout.\n"); 804 805 testStatus = false; 805 806 psFree(rc); … … 847 848 848 849 /****************************************************************************** 849 doSubtractFullOverscansSmall(): a sample p sReadout as well as several overscan850 doSubtractFullOverscansSmall(): a sample pmReadout as well as several overscan 850 851 images of smaller size are created. The overscan images are collected 851 pixel-by-pixel then subtracted column-wise from the p sReadout.852 pixel-by-pixel then subtracted column-wise from the pmReadout. 852 853 *****************************************************************************/ 853 854 int doSubtractFullOverscanColumnsGeneric(int imageNumCols, … … 866 867 867 868 psImage *tmpImage1 = psImageAlloc(imageNumCols, imageNumRows, PS_TYPE_F32); 868 // p sReadout *myReadout = psReadoutAlloc(imageNumCols, imageNumRows, tmpImage1);869 p sReadout *myReadout = psReadoutAlloc();869 // pmReadout *myReadout = pmReadoutAlloc(imageNumCols, imageNumRows, tmpImage1); 870 pmReadout *myReadout = pmReadoutAlloc(NULL); 870 871 myReadout->image = tmpImage1; 871 872 for (i=0;i<imageNumRows;i++) { -
trunk/psModules/test/tst_pmSubtractSky.c
r3595 r4770 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 3-31 20:41:35$9 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-16 01:10:36 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 int main(int argc, char* argv[]) 40 40 { 41 psLogSetFormat("HLNM"); 41 42 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 42 43 // test00(); … … 51 52 int testStatus = 0; 52 53 psImage *tmpImageF32 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 53 // p sReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImageF32);54 p sReadout *myReadout = psReadoutAlloc();54 // pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImageF32); 55 pmReadout *myReadout = pmReadoutAlloc(NULL); 55 56 myReadout->image = tmpImageF32; 56 57 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); … … 89 90 int testStatus = 0; 90 91 psImage *tmpImageF32 = psImageAlloc(numCols, numRows, PS_TYPE_F32); 91 // p sReadout *myReadout = psReadoutAlloc(numCols, numRows, tmpImageF32);92 p sReadout *myReadout = psReadoutAlloc();92 // pmReadout *myReadout = pmReadoutAlloc(numCols, numRows, tmpImageF32); 93 pmReadout *myReadout = pmReadoutAlloc(NULL); 93 94 myReadout->image = tmpImageF32; 94 95 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); … … 193 194 psImage *tmpImageF32 = psImageAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, PS_TYPE_F32); 194 195 psImage *tmpImageF64 = psImageAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, PS_TYPE_F64); 195 // p sReadout *myReadout = psReadoutAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, tmpImageF32);196 p sReadout *myReadout = psReadoutAlloc();197 myReadout->image = tmpImageF32; 198 p sReadout *rc = NULL;196 // pmReadout *myReadout = pmReadoutAlloc(NUM_COLS_SMALL, NUM_ROWS_SMALL, tmpImageF32); 197 pmReadout *myReadout = pmReadoutAlloc(NULL); 198 myReadout->image = tmpImageF32; 199 pmReadout *rc = NULL; 199 200 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 200 201 psPolynomial2D *myPoly = psPolynomial2DAlloc(POLY_X_ORDER, POLY_Y_ORDER, PS_POLYNOMIAL_ORD); … … 208 209 209 210 printf("----------------------------------------------------------------\n"); 210 printf("Calling pmSubtractSky() with NULL p sReadout. Should error.\n\n");211 printf("Calling pmSubtractSky() with NULL pmReadout. Should error.\n\n"); 211 212 rc = pmSubtractSky(NULL, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0); 212 213 if (rc != NULL) { 213 printf("TEST ERROR: pmSubtractSky() returned a non-NULL p sReadout\n");214 testStatus = false; 215 } 216 217 printf("----------------------------------------------------------------\n"); 218 printf("Calling pmSubtractSky() with NULL p sReadout->image. Should error.\n\n");214 printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n"); 215 testStatus = false; 216 } 217 218 printf("----------------------------------------------------------------\n"); 219 printf("Calling pmSubtractSky() with NULL pmReadout->image. Should error.\n\n"); 219 220 myReadout->image = NULL; 220 221 rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0); 221 222 if (rc != NULL) { 222 printf("TEST ERROR: pmSubtractSky() returned a non-NULL p sReadout\n");223 testStatus = false; 224 } 225 myReadout->image = tmpImageF32; 226 227 printf("----------------------------------------------------------------\n"); 228 printf("Calling pmSubtractSky() with PS_TYPE_F64 p sReadout->image. Should error.\n\n");223 printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n"); 224 testStatus = false; 225 } 226 myReadout->image = tmpImageF32; 227 228 printf("----------------------------------------------------------------\n"); 229 printf("Calling pmSubtractSky() with PS_TYPE_F64 pmReadout->image. Should error.\n\n"); 229 230 myReadout->image = tmpImageF64; 230 231 rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0); 231 232 if (rc != NULL) { 232 printf("TEST ERROR: pmSubtractSky() returned a non-NULL p sReadout\n");233 printf("TEST ERROR: pmSubtractSky() returned a non-NULL pmReadout\n"); 233 234 testStatus = false; 234 235 } … … 239 240 rc = pmSubtractSky(myReadout, NULL, PM_FIT_POLYNOMIAL, 1, myStats, 2.0); 240 241 if (rc != myReadout) { 241 printf("TEST ERROR: pmSubtractSky() returned something other than p sReadout\n");242 printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n"); 242 243 testStatus = false; 243 244 } … … 247 248 rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_NONE, 1, myStats, 2.0); 248 249 if (rc != myReadout) { 249 printf("TEST ERROR: pmSubtractSky() returned something other than p sReadout\n");250 printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n"); 250 251 testStatus = false; 251 252 } … … 255 256 rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_SPLINE, 1, myStats, 2.0); 256 257 if (rc != myReadout) { 257 printf("TEST ERROR: pmSubtractSky() returned something other than p sReadout\n");258 printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n"); 258 259 testStatus = false; 259 260 } … … 347 348 rc = pmSubtractSky(myReadout, (void *) myPoly, 54321, 1, myStats, -1.0); 348 349 if (rc != myReadout) { 349 printf("TEST ERROR: pmSubtractSky() returned something other than p sReadout\n");350 printf("TEST ERROR: pmSubtractSky() returned something other than pmReadout\n"); 350 351 testStatus = false; 351 352 } -
trunk/psModules/test/verified/tst_pmImageCombine.stderr
r4579 r4770 5 5 \**********************************************************************************/ 6 6 7 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)7 <HOST>|E|pmCombineImages (FILE:LINENO) 8 8 Unallowable operation: images is NULL. 9 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)9 <HOST>|E|pmCombineImages (FILE:LINENO) 10 10 images and errors args must have same length (6 != 5) 11 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)11 <HOST>|E|pmCombineImages (FILE:LINENO) 12 12 Unallowable operation: psImage tmpDataImg has incorrect type. 13 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)13 <HOST>|E|pmCombineImages (FILE:LINENO) 14 14 images and errors args must have same length (5 != 6) 15 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)15 <HOST>|E|pmCombineImages (FILE:LINENO) 16 16 Unallowable operation: psImage tmpErrorImg has incorrect type. 17 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)17 <HOST>|E|pmCombineImages (FILE:LINENO) 18 18 images and masks args must have same length (5 != 6) 19 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)19 <HOST>|E|pmCombineImages (FILE:LINENO) 20 20 Unallowable operation: psImage tmpMaskImg has incorrect type. 21 < DATE><TIME>|<HOST>|E|pmCombineImages (FILE:LINENO)21 <HOST>|E|pmCombineImages (FILE:LINENO) 22 22 Unallowable operation: stats is NULL. 23 23 -
trunk/psModules/test/verified/tst_pmImageSubtract.stdout
r4579 r4770 30 30 Calling pmSubtractionSolveEquation() with acceptable input parameters. Should return non-NULL. 31 31 The solution vector is: 32 ( 1.37) (-0.00) (0.10) (0.08) (0.14) (0.10) (0.01) (0.02) (0.00) (-0.02) (-0.01) (-0.00) (0.00) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.02) (-0.01) (-0.01) (0.00) (0.00) (0.00) (-0.02) (0.01) (0.00) (-0.01) (0.00) (-0.00) (0.01) (-0.00) (-0.01) (0.00) (0.01) (0.01) (0.01) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.00) (0.00) (0.01) (-0.00) (-0.00) (-0.01) (0.02) (-0.00) (0.00) (-0.00) (-0.00) (-0.01) (-0.01) (0.02) (0.01) (-0.01) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (-0.00) (0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.00) (-0.01) (-0.03) (-0.00) (0.04) (0.01) (-0.00) (-0.03) (0.02) (0.02) (0.01) (-0.03) (-0.03) (-0.02) (0.01) (-0.01) (-0.01) (0.00) (0.00) (0.01) (0.02) (-0.02) (-0.02) (0.02) (0.02) (0.02) (0.03) (-0.03) (-0.03) (0.02) (0.02) (0.02) (0.00) (0.01) (-0.02) (-0.01) (-0.01) (0.02) (-0.03) (0.02) (0.03) (-0.02) (-0.03) (-0.02) (-0.01) (-0.01) (0.00) (0.01) (-0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.01) (-0.01) (-0.02) (0.02) (0.01) (-0.02) (-0.02) (-0.00) (0.02) (-0.01) (-0.02) (0.01) (0.00) (0.01) (-0.02) (0.01) (0.00) (-0.00) (-0.01) (0.00) (0.00) (-0.01) (-0.01) (0.01) (0.01) (0.01) (0.51)32 (-64611.38) (9775.94) (-39812.77) (9051.88) (0.14) (-36863.67) (0.01) (0.02) (0.00) (-0.02) (-0.01) (-0.00) (0.00) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.02) (-0.01) (-0.01) (0.00) (0.00) (0.00) (-0.02) (0.01) (0.00) (-0.01) (0.00) (-0.00) (0.01) (-0.00) (-0.01) (0.00) (0.01) (0.01) (0.01) (0.01) (-0.00) (-0.01) (-0.00) (0.00) (0.00) (0.00) (0.01) (-0.00) (-0.00) (-0.01) (0.02) (-0.00) (0.00) (-0.00) (-0.00) (-0.01) (-0.01) (0.02) (0.01) (-0.01) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (-0.00) (0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.00) (-0.01) (-0.03) (-0.00) (0.04) (0.01) (-0.00) (-0.03) (0.02) (0.02) (0.01) (-0.03) (-0.03) (-0.02) (0.01) (-0.01) (-0.01) (0.00) (0.00) (0.01) (0.02) (-0.02) (-0.02) (0.02) (0.02) (0.02) (0.03) (-0.03) (-0.03) (0.02) (0.02) (0.02) (0.00) (0.01) (-0.02) (-0.01) (-0.01) (0.02) (-0.03) (0.02) (0.03) (-0.02) (-0.03) (-0.02) (-0.01) (-0.01) (0.00) (0.01) (-0.00) (-0.00) (-0.02) (0.01) (0.02) (-0.01) (-0.01) (-0.01) (-0.02) (0.02) (0.01) (-0.02) (-0.02) (-0.00) (0.02) (-0.01) (-0.02) (0.01) (0.00) (0.01) (-0.02) (0.01) (0.00) (-0.00) (-0.01) (0.00) (0.00) (-0.01) (-0.01) (0.01) (0.01) (0.01) (0.51) 33 33 Calling pmSubtractionRejectStamps() with acceptable input parameters. Should return TRUE. 34 34 Calling pmSubtractionKernelImage() with NULL solution. Should generate error, return NULL. … … 39 39 Calling pmSubtractionKernelImage() unallowable y value. Should generate error, return NULL. 40 40 Calling pmSubtractionKernelImage() with acceptable input parameters. Should return a psImage. 41 -0.0007 74 -0.013938 0.010689 -0.013394 -0.01550742 -0.0092 41 -0.020300 -0.002732 0.016843 0.01074343 0.0088 20 0.015628 1.495404 -0.021095 -0.00978844 0.0033 71 -0.001256 0.017835 0.003308 0.00817545 0.0098 77 -0.010686 0.014775 0.003368 0.00620441 -0.000791 -0.014015 0.010665 -0.013466 -0.015527 42 -0.009282 -0.020460 -0.002556 0.016698 0.010701 43 0.008812 0.015715 -86582.703125 -0.020967 -0.009787 44 0.003316 -0.001408 0.018001 0.003171 0.008132 45 0.009856 -0.010723 0.014779 0.003320 0.006181 46 46 Testing pmSubtractionCalculateEquation(): 47 47 image size is (25, 25) … … 58 58 Calling pmSubtractionSolveEquation() with acceptable input parameters. Should return non-NULL. 59 59 The solution vector is: 60 (0.09) (-0.01) (-0.01) (0.00) (-0.00) (-0.00) (0.00) (0.00) ( 0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.00) (0.55)60 (0.09) (-0.01) (-0.01) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.00) (0.00) (-0.00) (0.00) (-0.00) (-0.00) (0.55) 61 61 Calling pmSubtractionRejectStamps() with acceptable input parameters. Should return TRUE. 62 62 Calling pmSubtractionKernelImage() with NULL solution. Should generate error, return NULL. -
trunk/psModules/test/verified/tst_pmNonLinear.stderr
r3623 r4770 23 23 \**********************************************************************************/ 24 24 25 < DATE><TIME>|<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)25 <HOST>|E|pmNonLinearityPolynomial (FILE:LINENO) 26 26 Unallowable operation: inputReadout is NULL. 27 < DATE><TIME>|<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)27 <HOST>|E|pmNonLinearityPolynomial (FILE:LINENO) 28 28 Unallowable operation: inputReadout->image is NULL. 29 < DATE><TIME>|<HOST>|E|pmNonLinearityPolynomial (FILE:LINENO)29 <HOST>|E|pmNonLinearityPolynomial (FILE:LINENO) 30 30 Unallowable operation: input1DPoly is NULL. 31 31 … … 38 38 \**********************************************************************************/ 39 39 40 < DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)40 <HOST>|E|pmNonLinearityLookup (FILE:LINENO) 41 41 Unallowable operation: inputReadout is NULL. 42 < DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)42 <HOST>|E|pmNonLinearityLookup (FILE:LINENO) 43 43 Unallowable operation: inputReadout->image is NULL. 44 < DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)44 <HOST>|E|pmNonLinearityLookup (FILE:LINENO) 45 45 Unallowable operation: inFlux is NULL. 46 < DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)46 <HOST>|E|pmNonLinearityLookup (FILE:LINENO) 47 47 Unallowable operation: outFlux is NULL. 48 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup48 <HOST>|W|pmNonLinearityLookup 49 49 WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 25) 50 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup50 <HOST>|W|pmNonLinearityLookup 51 51 WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (24, 23) 52 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup52 <HOST>|W|pmNonLinearityLookup 53 53 WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 24) 54 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup54 <HOST>|W|pmNonLinearityLookup 55 55 WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 24) 56 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup56 <HOST>|W|pmNonLinearityLookup 57 57 WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (23, 25) 58 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup58 <HOST>|W|pmNonLinearityLookup 59 59 WARNING: pmNonLinear.c: pmNonLinearityLookup(): input vectors have different sizes (25, 23) 60 < DATE><TIME>|<HOST>|E|pmNonLinearityLookup (FILE:LINENO)60 <HOST>|E|pmNonLinearityLookup (FILE:LINENO) 61 61 pmNonLinearityLookup(): input vector less than 2 elements. Returning inputReadout image. 62 < DATE><TIME>|<HOST>|W|vectorBinDisectF3262 <HOST>|W|vectorBinDisectF32 63 63 vectorBinDisectF32(): ordinate -1.000000 is outside vector range (0.000000 - 23.000000). 64 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup64 <HOST>|W|pmNonLinearityLookup 65 65 WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table. 66 < DATE><TIME>|<HOST>|W|vectorBinDisectF3266 <HOST>|W|vectorBinDisectF32 67 67 vectorBinDisectF32(): ordinate 100.000000 is outside vector range (0.000000 - 23.000000). 68 < DATE><TIME>|<HOST>|W|pmNonLinearityLookup68 <HOST>|W|pmNonLinearityLookup 69 69 WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table. 70 70 -
trunk/psModules/test/verified/tst_pmNonLinear.stdout
r2961 r4770 84 84 Calling pmNonLinearityPolynomial() with NULL polynomial. Should generate error, return NULL. 85 85 ------------------------------------------------------------ 86 Calling pmNonLinearityLookup() with NULL input p sReadout. Should generate error, return NULL.86 Calling pmNonLinearityLookup() with NULL input pmReadout. Should generate error, return NULL. 87 87 ------------------------------------------------------------ 88 Calling pmNonLinearityLookup() with NULL input p sReadout->image. Should generate error, return NULL.88 Calling pmNonLinearityLookup() with NULL input pmReadout->image. Should generate error, return NULL. 89 89 ------------------------------------------------------------ 90 90 Calling pmNonLinearityLookup() with NULL inFlux psVector. Should generate error, return NULL. … … 104 104 Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors. Should generate warning. 105 105 ------------------------------------------------------------ 106 Calling pmNonLinearityLookup() with inFlux psVector size 1. Should generate error, return original p sReadout.106 Calling pmNonLinearityLookup() with inFlux psVector size 1. Should generate error, return original pmReadout. 107 107 ------------------------------------------------------------ 108 108 Calling pmNonLinearityLookup() with one pixels outside inFlux range. Should generate warnings. -
trunk/psModules/test/verified/tst_pmObjects01.stderr
r4228 r4770 14 14 \**********************************************************************************/ 15 15 16 < DATE><TIME>|<HOST>|E|pmFindVectorPeaks (FILE:LINENO)16 <HOST>|E|pmFindVectorPeaks (FILE:LINENO) 17 17 Unallowable operation: psVector vector or its data is NULL. 18 < DATE><TIME>|<HOST>|E|pmFindVectorPeaks (FILE:LINENO)18 <HOST>|E|pmFindVectorPeaks (FILE:LINENO) 19 19 Unallowable operation: psVector vector has no elements. 20 < DATE><TIME>|<HOST>|E|pmFindVectorPeaks (FILE:LINENO)20 <HOST>|E|pmFindVectorPeaks (FILE:LINENO) 21 21 Unallowable operation: psVector vector has incorrect type. 22 22 … … 29 29 \**********************************************************************************/ 30 30 31 < DATE><TIME>|<HOST>|E|psImageAlloc (FILE:LINENO)31 <HOST>|E|psImageAlloc (FILE:LINENO) 32 32 Specified number of rows (0) or columns (0) is invalid. 33 < DATE><TIME>|<HOST>|E|pmFindImagePeaks (FILE:LINENO)34 Unallowable operation: psImage image or its data is NULL. 35 < DATE><TIME>|<HOST>|E|pmFindImagePeaks (FILE:LINENO)36 Unallowable operation: psImage image or its data is NULL. 37 < DATE><TIME>|<HOST>|E|pmFindImagePeaks (FILE:LINENO)33 <HOST>|E|pmFindImagePeaks (FILE:LINENO) 34 Unallowable operation: psImage image or its data is NULL. 35 <HOST>|E|pmFindImagePeaks (FILE:LINENO) 36 Unallowable operation: psImage image or its data is NULL. 37 <HOST>|E|pmFindImagePeaks (FILE:LINENO) 38 38 Unallowable operation: psImage image has incorrect type. 39 39 … … 55 55 \**********************************************************************************/ 56 56 57 < DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)58 Unallowable operation: psImage image or its data is NULL. 59 < DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)57 <HOST>|E|pmSourceLocalSky (FILE:LINENO) 58 Unallowable operation: psImage image or its data is NULL. 59 <HOST>|E|pmSourceLocalSky (FILE:LINENO) 60 60 Unallowable operation: psImage image has incorrect type. 61 < DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)61 <HOST>|E|pmSourceLocalSky (FILE:LINENO) 62 62 Unallowable operation: peak is NULL. 63 < DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)63 <HOST>|E|pmSourceLocalSky (FILE:LINENO) 64 64 Error: (0.0 > innerRadius) (0.000000 -10.000000) 65 < DATE><TIME>|<HOST>|E|pmSourceLocalSky (FILE:LINENO)65 <HOST>|E|pmSourceLocalSky (FILE:LINENO) 66 66 Error: (innerRadius > outerRadius) (10.000000 5.000000) 67 67 … … 74 74 \**********************************************************************************/ 75 75 76 < DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)77 Unallowable operation: source is NULL. 78 < DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)79 Unallowable operation: psImage image or its data is NULL. 80 < DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)76 <HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO) 77 Unallowable operation: source is NULL. 78 <HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO) 79 Unallowable operation: psImage image or its data is NULL. 80 <HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO) 81 81 Unallowable operation: psImage image has incorrect type. 82 < DATE><TIME>|<HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO)82 <HOST>|E|pmSourceSetPixelsCircle (FILE:LINENO) 83 83 Error: (0.0 > radius) (0.000000 -10.000000) 84 84 … … 91 91 \**********************************************************************************/ 92 92 93 < DATE><TIME>|<HOST>|E|pmSourceMoments (FILE:LINENO)94 Unallowable operation: source is NULL. 95 < DATE><TIME>|<HOST>|E|pmSourceMoments (FILE:LINENO)93 <HOST>|E|pmSourceMoments (FILE:LINENO) 94 Unallowable operation: source is NULL. 95 <HOST>|E|pmSourceMoments (FILE:LINENO) 96 96 Error: (0.0 > radius) (0.000000 -10.000000) 97 97 … … 104 104 \**********************************************************************************/ 105 105 106 < DATE><TIME>|<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)107 Unallowable operation: psVector params or its data is NULL. 108 < DATE><TIME>|<HOST>|E|pmMinLM_Gauss2D (FILE:LINENO)109 Unallowable operation: psVector x or its data is NULL. 110 < DATE><TIME>|<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)111 Unallowable operation: psVector params or its data is NULL. 112 < DATE><TIME>|<HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO)113 Unallowable operation: psVector x or its data is NULL. 114 < DATE><TIME>|<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)115 Unallowable operation: psVector params or its data is NULL. 116 < DATE><TIME>|<HOST>|E|pmMinLM_Wauss2D (FILE:LINENO)117 Unallowable operation: psVector x or its data is NULL. 118 < DATE><TIME>|<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)119 Unallowable operation: psVector params or its data is NULL. 120 < DATE><TIME>|<HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO)121 Unallowable operation: psVector x or its data is NULL. 122 < DATE><TIME>|<HOST>|E|pmMinLM_Sersic (FILE:LINENO)106 <HOST>|E|pmMinLM_Gauss2D (FILE:LINENO) 107 Unallowable operation: psVector params or its data is NULL. 108 <HOST>|E|pmMinLM_Gauss2D (FILE:LINENO) 109 Unallowable operation: psVector x or its data is NULL. 110 <HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO) 111 Unallowable operation: psVector params or its data is NULL. 112 <HOST>|E|pmMinLM_PsuedoGauss2D (FILE:LINENO) 113 Unallowable operation: psVector x or its data is NULL. 114 <HOST>|E|pmMinLM_Wauss2D (FILE:LINENO) 115 Unallowable operation: psVector params or its data is NULL. 116 <HOST>|E|pmMinLM_Wauss2D (FILE:LINENO) 117 Unallowable operation: psVector x or its data is NULL. 118 <HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO) 119 Unallowable operation: psVector params or its data is NULL. 120 <HOST>|E|pmMinLM_TwistGauss2D (FILE:LINENO) 121 Unallowable operation: psVector x or its data is NULL. 122 <HOST>|E|pmMinLM_Sersic (FILE:LINENO) 123 123 This function is not implemented yet. 124 < DATE><TIME>|<HOST>|E|pmMinLM_Sersic (FILE:LINENO)125 Unallowable operation: psVector params or its data is NULL. 126 < DATE><TIME>|<HOST>|E|pmMinLM_Sersic (FILE:LINENO)127 Unallowable operation: psVector x or its data is NULL. 128 < DATE><TIME>|<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)124 <HOST>|E|pmMinLM_Sersic (FILE:LINENO) 125 Unallowable operation: psVector params or its data is NULL. 126 <HOST>|E|pmMinLM_Sersic (FILE:LINENO) 127 Unallowable operation: psVector x or its data is NULL. 128 <HOST>|E|pmMinLM_SersicCore (FILE:LINENO) 129 129 This function is not implemented yet. 130 < DATE><TIME>|<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)131 Unallowable operation: psVector params or its data is NULL. 132 < DATE><TIME>|<HOST>|E|pmMinLM_SersicCore (FILE:LINENO)130 <HOST>|E|pmMinLM_SersicCore (FILE:LINENO) 131 Unallowable operation: psVector params or its data is NULL. 132 <HOST>|E|pmMinLM_SersicCore (FILE:LINENO) 133 133 Unallowable operation: psVector x or its data is NULL. 134 134 … … 141 141 \**********************************************************************************/ 142 142 143 < DATE><TIME>|<HOST>|E|pmSourceModelGuess (FILE:LINENO)144 Unallowable operation: source is NULL. 145 < DATE><TIME>|<HOST>|E|pmSourceModelGuess (FILE:LINENO)146 Unallowable operation: psImage image or its data is NULL. 147 < DATE><TIME>|<HOST>|E|pmSourceModelGuess (FILE:LINENO)143 <HOST>|E|pmSourceModelGuess (FILE:LINENO) 144 Unallowable operation: source is NULL. 145 <HOST>|E|pmSourceModelGuess (FILE:LINENO) 146 Unallowable operation: psImage image or its data is NULL. 147 <HOST>|E|pmSourceModelGuess (FILE:LINENO) 148 148 Undefined psModelType 149 < DATE><TIME>|<HOST>|W|pmSourceModelGuess150 WARNING: source->model s was non-NULL; calling psFree(source->models).151 < DATE><TIME>|<HOST>|W|pmSourceModelGuess152 WARNING: source->model s was non-NULL; calling psFree(source->models).153 < DATE><TIME>|<HOST>|W|pmSourceModelGuess154 WARNING: source->model s was non-NULL; calling psFree(source->models).155 < DATE><TIME>|<HOST>|W|pmSourceModelGuess156 WARNING: source->model s was non-NULL; calling psFree(source->models).157 < DATE><TIME>|<HOST>|W|pmSourceModelGuess158 WARNING: source->model s was non-NULL; calling psFree(source->models).149 <HOST>|W|pmSourceModelGuess 150 WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF). 151 <HOST>|W|pmSourceModelGuess 152 WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF). 153 <HOST>|W|pmSourceModelGuess 154 WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF). 155 <HOST>|W|pmSourceModelGuess 156 WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF). 157 <HOST>|W|pmSourceModelGuess 158 WARNING: source->modelPSF was non-NULL; calling psFree(source->modelPSF). 159 159 160 160 ---> TESTPOINT PASSED (Test Point Driver{pmObjects: pmSourceModelGuess()} | tst_pmObjects01.c) … … 166 166 \**********************************************************************************/ 167 167 168 < DATE><TIME>|<HOST>|E|pmSourceContour (FILE:LINENO)169 Unallowable operation: source is NULL. 170 < DATE><TIME>|<HOST>|E|pmSourceContour (FILE:LINENO)168 <HOST>|E|pmSourceContour (FILE:LINENO) 169 Unallowable operation: source is NULL. 170 <HOST>|E|pmSourceContour (FILE:LINENO) 171 171 Unallowable operation: image is NULL. 172 172 … … 179 179 \**********************************************************************************/ 180 180 181 < DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)182 Unallowable operation: psImage image or its data is NULL. 183 < DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)181 <HOST>|E|sourceAddOrSubModel (FILE:LINENO) 182 Unallowable operation: psImage image or its data is NULL. 183 <HOST>|E|sourceAddOrSubModel (FILE:LINENO) 184 184 Unallowable operation: src is NULL. 185 185 … … 192 192 \**********************************************************************************/ 193 193 194 < DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)195 Unallowable operation: psImage image or its data is NULL. 196 < DATE><TIME>|<HOST>|E|sourceAddOrSubModel (FILE:LINENO)194 <HOST>|E|sourceAddOrSubModel (FILE:LINENO) 195 Unallowable operation: psImage image or its data is NULL. 196 <HOST>|E|sourceAddOrSubModel (FILE:LINENO) 197 197 Unallowable operation: src is NULL. 198 198 … … 205 205 \**********************************************************************************/ 206 206 207 < DATE><TIME>|<HOST>|E|pmSourceFitModel (FILE:LINENO)208 Unallowable operation: psImage image or its data is NULL. 209 < DATE><TIME>|<HOST>|E|pmSourceFitModel (FILE:LINENO)207 <HOST>|E|pmSourceFitModel (FILE:LINENO) 208 Unallowable operation: psImage image or its data is NULL. 209 <HOST>|E|pmSourceFitModel (FILE:LINENO) 210 210 Unallowable operation: source is NULL. 211 211 -
trunk/psModules/test/verified/tst_pmObjects01.stdout
r4228 r4770 81 81 Calling pmSourceLocalSky with wrong-type psImage. Should generate error and return NULL. 82 82 ---------------------------------------------------------------------------------- 83 Calling pmSourceLocalSky with NULL p sPeak. Should generate error and return NULL.83 Calling pmSourceLocalSky with NULL pmPeak. Should generate error and return NULL. 84 84 ---------------------------------------------------------------------------------- 85 85 Calling pmSourceLocalSky with innerRadius<0.0. Should generate error and return NULL. … … 90 90 ---------------------------------------------------------------------------------- 91 91 ---------------------------------------------------------------------------------- 92 Calling pmSourceSetPixelsCircle with NULL p sSource. Should generate error and return NULL.92 Calling pmSourceSetPixelsCircle with NULL pmSource. Should generate error and return NULL. 93 93 ---------------------------------------------------------------------------------- 94 94 Calling pmSourceSetPixelsCircle with NULL psImage. Should generate error and return NULL. … … 101 101 ---------------------------------------------------------------------------------- 102 102 ---------------------------------------------------------------------------------- 103 Calling pmSourceMoments with NULL p sSource. Should generate error and return NULL.103 Calling pmSourceMoments with NULL pmSource. Should generate error and return NULL. 104 104 ---------------------------------------------------------------------------------- 105 105 Calling pmSourceMoments with radius < 0.0. Should generate error and return NULL. … … 143 143 Calling pmSourceLocalSky with valid data. 144 144 ---------------------------------------------------------------------------------- 145 Calling pmSourceModelGuess with NULL p sSource. Should generate error, return FALSE.145 Calling pmSourceModelGuess with NULL pmSource. Should generate error, return FALSE. 146 146 ---------------------------------------------------------------------------------- 147 147 Calling pmSourceModelGuess with NULL psImage. Should generate error, return FALSE. … … 162 162 Calling pmSourceLocalSky with valid data. 163 163 ---------------------------------------------------------------------------------- 164 Calling pmSourceContour with NULL p sSource . Should generate error, return NULL.164 Calling pmSourceContour with NULL pmSource . Should generate error, return NULL. 165 165 ---------------------------------------------------------------------------------- 166 166 Calling pmSourceContour with NULL psImage . Should generate error, return NULL. … … 183 183 Calling pmSourceFitModel with NULL psImage. Should generate error, return FALSE. 184 184 ---------------------------------------------------------------------------------- 185 Calling pmSourceFitModel with NULL p sSource. Should generate error, return FALSE.185 Calling pmSourceFitModel with NULL pmSource. Should generate error, return FALSE. 186 186 ---------------------------------------------------------------------------------- 187 187 Calling pmSourceFitModel with acceptable data. -
trunk/psModules/test/verified/tst_pmSubtractSky.stderr
r3623 r4770 5 5 \**********************************************************************************/ 6 6 7 < DATE><TIME>|<HOST>|W|p_psVectorSampleStdev7 <HOST>|W|p_psVectorSampleStdev 8 8 WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1). Setting stats->sampleStdev = 0.0. 9 < DATE><TIME>|<HOST>|W|ImageFitPolynomial9 <HOST>|W|ImageFitPolynomial 10 10 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension. 11 < DATE><TIME>|<HOST>|W|ImageFitPolynomial11 <HOST>|W|ImageFitPolynomial 12 12 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension. 13 < DATE><TIME>|<HOST>|W|ImageFitPolynomial13 <HOST>|W|ImageFitPolynomial 14 14 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension. 15 < DATE><TIME>|<HOST>|W|ImageFitPolynomial15 <HOST>|W|ImageFitPolynomial 16 16 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension. 17 < DATE><TIME>|<HOST>|W|p_psVectorSampleStdev17 <HOST>|W|p_psVectorSampleStdev 18 18 WARNING: p_psVectorSampleStdev(): only one valid psVector elements (1). Setting stats->sampleStdev = 0.0. 19 < DATE><TIME>|<HOST>|W|ImageFitPolynomial19 <HOST>|W|ImageFitPolynomial 20 20 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension. 21 < DATE><TIME>|<HOST>|W|ImageFitPolynomial21 <HOST>|W|ImageFitPolynomial 22 22 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension. 23 < DATE><TIME>|<HOST>|W|ImageFitPolynomial23 <HOST>|W|ImageFitPolynomial 24 24 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension. 25 < DATE><TIME>|<HOST>|W|ImageFitPolynomial25 <HOST>|W|ImageFitPolynomial 26 26 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension. 27 < DATE><TIME>|<HOST>|W|ImageFitPolynomial27 <HOST>|W|ImageFitPolynomial 28 28 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension. 29 < DATE><TIME>|<HOST>|W|ImageFitPolynomial29 <HOST>|W|ImageFitPolynomial 30 30 WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension. 31 31 … … 38 38 \**********************************************************************************/ 39 39 40 < DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)40 <HOST>|E|pmSubtractSky (FILE:LINENO) 41 41 Unallowable operation: psReadout in or its data is NULL. 42 < DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)42 <HOST>|E|pmSubtractSky (FILE:LINENO) 43 43 Unallowable operation: psReadout in or its data is NULL. 44 < DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)44 <HOST>|E|pmSubtractSky (FILE:LINENO) 45 45 Unallowable operation: psImage in has incorrect type. 46 < DATE><TIME>|<HOST>|W|pmSubtractSky46 <HOST>|W|pmSubtractSky 47 47 WARNING: pmSubtractSky(): input parameter stats is NULL 48 < DATE><TIME>|<HOST>|W|pmSubtractSky48 <HOST>|W|pmSubtractSky 49 49 WARNING: pmSubtractSky(): no stats->options was requested 50 < DATE><TIME>|<HOST>|W|pmSubtractSky50 <HOST>|W|pmSubtractSky 51 51 WARNING: Multiple statistical options have been requested. 52 < DATE><TIME>|<HOST>|W|pmSubtractSky52 <HOST>|W|pmSubtractSky 53 53 WARNING: pmSubtractSky(): binFactor is 0 54 < DATE><TIME>|<HOST>|W|pmSubtractSky54 <HOST>|W|pmSubtractSky 55 55 WARNING: pmSubtractSky(): binFactor is -1 56 < DATE><TIME>|<HOST>|W|pmSubtractSky56 <HOST>|W|pmSubtractSky 57 57 WARNING: pmSubtractSky(): clipSD is -1.000000 58 < DATE><TIME>|<HOST>|E|pmSubtractSky (FILE:LINENO)58 <HOST>|E|pmSubtractSky (FILE:LINENO) 59 59 psFit is unallowable (54321). Returning in image. 60 60 -
trunk/psModules/test/verified/tst_pmSubtractSky.stdout
r2945 r4770 176 176 177 177 ---------------------------------------------------------------- 178 Calling pmSubtractSky() with NULL p sReadout. Should error.179 180 ---------------------------------------------------------------- 181 Calling pmSubtractSky() with NULL p sReadout->image. Should error.182 183 ---------------------------------------------------------------- 184 Calling pmSubtractSky() with PS_TYPE_F64 p sReadout->image. Should error.178 Calling pmSubtractSky() with NULL pmReadout. Should error. 179 180 ---------------------------------------------------------------- 181 Calling pmSubtractSky() with NULL pmReadout->image. Should error. 182 183 ---------------------------------------------------------------- 184 Calling pmSubtractSky() with PS_TYPE_F64 pmReadout->image. Should error. 185 185 186 186 ----------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.
