Changeset 34085
- Timestamp:
- Jun 26, 2012, 11:31:38 AM (14 years ago)
- Location:
- trunk/psModules
- Files:
-
- 31 edited
-
. (modified) (1 prop)
-
configure.ac (modified) (2 diffs)
-
src/camera/pmFPAMosaic.c (modified) (1 diff)
-
src/camera/pmFPARead.c (modified) (1 diff)
-
src/camera/pmFPAfileDefine.c (modified) (1 diff)
-
src/camera/pmReadoutFake.c (modified) (1 diff)
-
src/concepts/pmConceptsStandard.c (modified) (4 diffs)
-
src/concepts/pmConceptsUpdate.c (modified) (1 diff)
-
src/config/pmConfigCommand.c (modified) (1 diff)
-
src/detrend/pmFringeStats.c (modified) (1 diff)
-
src/detrend/pmNonLinear.c (modified) (3 diffs)
-
src/detrend/pmShutterCorrection.c (modified) (2 diffs)
-
src/extras/pmVisualUtils.c (modified) (1 diff)
-
src/extras/psPipe.c (modified) (1 diff)
-
src/objects/models/pmModel_PGAUSS.c (modified) (2 diffs)
-
src/objects/models/pmModel_PS1_V1.c (modified) (2 diffs)
-
src/objects/models/pmModel_QGAUSS.c (modified) (2 diffs)
-
src/objects/models/pmModel_RGAUSS.c (modified) (2 diffs)
-
src/objects/pmModelFuncs.h (modified) (2 diffs)
-
src/objects/pmModelUtils.c (modified) (1 diff)
-
src/objects/pmModelUtils.h (modified) (1 diff)
-
src/objects/pmPSFtryMakePSF.c (modified) (4 diffs)
-
src/objects/pmSource.c (modified) (11 diffs)
-
src/objects/pmSource.h (modified) (1 diff)
-
src/objects/pmSourceIO_CMP.c (modified) (5 diffs)
-
src/objects/pmSourceIO_PS1_CAL_0.c (modified) (4 diffs)
-
src/objects/pmSourceIO_SMPDATA.c (modified) (4 diffs)
-
src/objects/pmSourceIO_SX.c (modified) (2 diffs)
-
src/objects/pmSourcePhotometry.c (modified) (7 diffs)
-
src/objects/pmSourcePhotometry.h (modified) (3 diffs)
-
test/tap/src/tap.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120601/psModules (added) merged: 34002,34044,34049,34051-34053,34073,34076,34078
- Property svn:mergeinfo changed
-
trunk/psModules/configure.ac
r23794 r34085 14 14 AC_SUBST(PSMODULES_LT_VERSION,$PSMODULES_LT_VERSION) 15 15 16 IPP_STD CFLAGS16 IPP_STDLDFLAGS 17 17 18 18 AC_LANG(C) … … 312 312 dnl ------- enable -Werror after all of the probes have run --------- 313 313 IPP_STDOPTS 314 315 CFLAGS="${CFLAGS} -Wall -Werror" 314 IPP_STDCFLAGS 315 316 316 dnl enable POSIX/XSI and C99 compliance 317 317 CFLAGS="${CFLAGS=} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L" -
trunk/psModules/src/camera/pmFPAMosaic.c
r28007 r34085 661 661 good = false; 662 662 } 663 } 664 if (!good) { 665 // XXX do something to address this? 663 666 } 664 667 -
trunk/psModules/src/camera/pmFPARead.c
r27346 r34085 957 957 trimsec->y1 = naxis2 + trimsec->y1; 958 958 959 int maxSize; // Number of cols,rows in image960 if (readdir == 1) {961 maxSize = PS_MIN(naxis2, trimsec->y1 - trimsec->y0);962 } else {963 maxSize = PS_MIN(naxis1, trimsec->x1 - trimsec->x0);964 }959 // XX not used int maxSize; // Number of cols,rows in image 960 // XX not used if (readdir == 1) { 961 // XX not used maxSize = PS_MIN(naxis2, trimsec->y1 - trimsec->y0); 962 // XX not used } else { 963 // XX not used maxSize = PS_MIN(naxis1, trimsec->x1 - trimsec->x0); 964 // XX not used } 965 965 966 966 int offset; // start of the segment -
trunk/psModules/src/camera/pmFPAfileDefine.c
r31633 r34085 333 333 psMetadataItem *fuzz = psMetadataLookup(scheme, "FUZZ"); // Quantisation fuzz? 334 334 if (fuzz) { 335 if (fuzz->type != PS_ TYPE_BOOL) {335 if (fuzz->type != PS_DATA_BOOL) { 336 336 psWarning("FUZZ in compression scheme %s isn't boolean.", fitsType); 337 337 goto FITS_OPTIONS_DONE; -
trunk/psModules/src/camera/pmReadoutFake.c
r33624 r34085 332 332 #define CONCEPT_SET_S32(CONCEPTS, NAME, OLD, NEW) { \ 333 333 psMetadataItem *item = psMetadataLookup(CONCEPTS, NAME); \ 334 psAssert(item->type == PS_ TYPE_S32, "Incorrect type: %x", item->type); \334 psAssert(item->type == PS_DATA_S32, "Incorrect type: %x", item->type); \ 335 335 if (item->data.S32 == OLD) { \ 336 336 item->data.S32 = NEW; \ -
trunk/psModules/src/concepts/pmConceptsStandard.c
r32941 r34085 118 118 assert(concept); 119 119 assert(cell); 120 assert(concept->type == PS_ TYPE_F32);120 assert(concept->type == PS_DATA_F32); 121 121 122 122 float rn = concept->data.F32; // Read noise … … 930 930 psFree(timesysName); 931 931 932 if (!item || item->type != PS_ TYPE_S32) {932 if (!item || item->type != PS_DATA_S32) { 933 933 psWarning("Unable to find %s --- assuming UTC", timesysName); 934 934 return PS_TIME_UTC; … … 1258 1258 #endif 1259 1259 default: 1260 if (concept->type == PS_ TYPE_F32 && concept->data.F32 - (int)concept->data.F32 == 0) {1260 if (concept->type == PS_DATA_F32 && concept->data.F32 - (int)concept->data.F32 == 0) { 1261 1261 offset = concept->data.F32; 1262 } else if (concept->type == PS_ TYPE_F64 && concept->data.F64 - (int)concept->data.F64 == 0) {1262 } else if (concept->type == PS_DATA_F64 && concept->data.F64 - (int)concept->data.F64 == 0) { 1263 1263 offset = concept->data.F64; 1264 1264 } else { … … 1558 1558 assert(cameraFormat); 1559 1559 1560 if (concept->type != PS_ TYPE_S32) {1560 if (concept->type != PS_DATA_S32) { 1561 1561 psError(PS_ERR_UNKNOWN, true, "Concept %s is not of type S32, as expected.\n", concept->name); 1562 1562 return NULL; -
trunk/psModules/src/concepts/pmConceptsUpdate.c
r20095 r34085 30 30 if (isfinite(gain)) { 31 31 psMetadataItem *rn = psMetadataLookup(cell->concepts, "CELL.READNOISE"); // Read noise 32 psAssert(rn && rn->type == PS_ TYPE_F32, "Should be of the correct type");32 psAssert(rn && rn->type == PS_DATA_F32, "Should be of the correct type"); 33 33 rn->data.F32 *= gain; 34 34 psMetadataRemoveKey(cell->concepts, "CELL.READNOISE.UPDATE"); -
trunk/psModules/src/config/pmConfigCommand.c
r18937 r34085 42 42 psMetadataItem *item; // Item from iteration 43 43 while ((item = psMetadataGetAndIncrement(iter))) { 44 assert(item->type == PS_ TYPE_S32);44 assert(item->type == PS_DATA_S32); 45 45 psStringAppend(command, " -trace %s %d", item->name, item->data.S32); 46 46 } -
trunk/psModules/src/detrend/pmFringeStats.c
r31069 r34085 662 662 if (item->type == PS_DATA_VECTOR) { \ 663 663 ARRAY->data[i] = psMemIncrRefCounter(item->data.V); \ 664 } else if (item->type == PS_ TYPE_##TYPE) { \664 } else if (item->type == PS_DATA_##TYPE) { \ 665 665 psVector *vector = psVectorAlloc(1, PS_TYPE_##TYPE); \ 666 666 vector->data.TYPE[0] = item->data.TYPE; \ -
trunk/psModules/src/detrend/pmNonLinear.c
r29935 r34085 82 82 } 83 83 PS_ASSERT_PTR_NON_NULL(outFlux,NULL); 84 psS32 tableSize = inFlux->n;84 // XXX unused psS32 tableSize = inFlux->n; 85 85 if (inFlux->n != outFlux->n) { 86 tableSize = PS_MIN(inFlux->n, outFlux->n);86 // XXX unused tableSize = PS_MIN(inFlux->n, outFlux->n); 87 87 psLogMsg(__func__, PS_LOG_WARN, 88 88 "WARNING: pmNonLinear.c: pmNonLinearityLookup(): " … … 329 329 330 330 bin = correction_fluxes->n - 1; 331 psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]); 332 if (bin < 0) { /* warn? */ } 331 333 if (flux < correction_fluxes->data.F32[0]) { 332 334 return(0.0); … … 357 359 bin = correction_fluxes->n - 1; 358 360 psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]); 361 if (bin < 0) { /* warn? */ } 359 362 if (flux < correction_fluxes->data.F32[0]) { 360 363 return(0.0); -
trunk/psModules/src/detrend/pmShutterCorrection.c
r33089 r34085 406 406 407 407 // Check input sizes, generate first-pass statistics 408 psRegion refRegion; // Reference region409 408 psVector *refs = psVectorAlloc(num, PS_TYPE_F32); // Reference measurements 410 409 psVectorInit(refs, 0); … … 441 440 numCols = image->numCols; 442 441 // define the reference region : a box of size 'size' at the center 443 refRegion = psRegionForSquare(0.5 * numCols, 0.5 * numRows, size);442 // XXX unused psRegion refRegion = psRegionForSquare(0.5 * numCols, 0.5 * numRows, size); 444 443 // Set up the sample regions : boxes of size 'size' at the 4 image corners 445 444 for (int j = 0; j < MEASURE_SAMPLES; j++) { -
trunk/psModules/src/extras/pmVisualUtils.c
r31373 r34085 424 424 nwritten = fwrite (line, 1, strlen(line), output); 425 425 } 426 if (nwritten < 1) { 427 } 426 428 } 427 429 -
trunk/psModules/src/extras/psPipe.c
r23487 r34085 105 105 106 106 status = execvp (argv[0], argv); 107 108 // this statement exits the child, not the parent, process 109 exit (1); 107 if (status < 0) { psWarning ("error running exec for child process"); } 108 exit (1); // this statement exits the child, not the parent, process 110 109 } 111 110 psFree (cmd); -
trunk/psModules/src/objects/models/pmModel_PGAUSS.c
r32347 r34085 261 261 { 262 262 psF64 z; 263 int Nstep = 0;264 263 psEllipseShape shape; 265 264 … … 285 284 // use the fact that f is monotonically decreasing 286 285 z = 0; 287 Nstep = 0;288 286 289 287 // choose a z value guaranteed to be beyond our limit -
trunk/psModules/src/objects/models/pmModel_PS1_V1.c
r32347 r34085 283 283 { 284 284 psF64 z; 285 int Nstep = 0;286 285 psEllipseShape shape; 287 286 … … 308 307 // use the fact that f is monotonically decreasing 309 308 z = 0; 310 Nstep = 0;311 309 312 310 // choose a z value guaranteed to be beyond our limit -
trunk/psModules/src/objects/models/pmModel_QGAUSS.c
r33417 r34085 284 284 { 285 285 psF64 z; 286 int Nstep = 0;287 286 psEllipseShape shape; 288 287 … … 312 311 // use the fact that f is monotonically decreasing 313 312 z = 0; 314 Nstep = 0;315 313 316 314 // choose a z value guaranteed to be beyond our limit -
trunk/psModules/src/objects/models/pmModel_RGAUSS.c
r32347 r34085 273 273 { 274 274 psF64 z; 275 int Nstep = 0;276 275 psEllipseShape shape; 277 276 … … 296 295 // use the fact that f is monotonically decreasing 297 296 z = 0; 298 Nstep = 0;299 297 300 298 // choose a z value guaranteed to be beyond our limit -
trunk/psModules/src/objects/pmModelFuncs.h
r33993 r34085 29 29 # define PM_MODEL_FUNCS_H 30 30 31 # define HAVE_MODEL_VAR 132 33 31 /// @addtogroup Objects Object Detection / Analysis Functions 34 32 /// @{ … … 57 55 PM_MODEL_OP_NORM = 0x20, 58 56 PM_MODEL_OP_NOISE = 0x40, 59 # if (HAVE_MODEL_VAR)60 57 PM_MODEL_OP_MODELVAR = 0x80, 61 # endif62 58 } pmModelOpMode; 63 59 -
trunk/psModules/src/objects/pmModelUtils.c
r33417 r34085 43 43 44 44 #include "pmErrorCodes.h" 45 46 // XX static bool useModelVar = false; 47 // XX 48 // XX void pmModelSetModelVarOption (bool option) { 49 // XX useModelVar = option; 50 // XX } 51 // XX bool pmModelGetModelVarOption (void) { 52 // XX return useModelVar; 53 // XX } 45 54 46 55 /***************************************************************************** -
trunk/psModules/src/objects/pmModelUtils.h
r31153 r34085 46 46 bool pmModelSetShape (float *Sxx, float *Sxy, float *Syy, pmMoments *moments); 47 47 48 // XXX void pmModelSetModelVarOption (bool option); 49 // XXX bool pmModelGetModelVarOption (void); 50 48 51 /// @} 49 52 # endif /* PM_MODEL_UTILS_H */ -
trunk/psModules/src/objects/pmPSFtryMakePSF.c
r30044 r34085 231 231 // XXX we are using the same stats structure on each pass: do we need to re-init it? 232 232 // XXX we hardwire this to SAMPLE stats above (psphotChoosePSF.c), hardwire here instead? 233 psStatsOptions meanOption = psStatsMeanOption(psf->psfTrendStats->options); 234 psStatsOptions stdevOption = psStatsStdevOption(psf->psfTrendStats->options); 235 233 236 234 pmTrend2D *trend = NULL; 237 float mean, stdev;238 235 239 236 // XXX we are using the same stats structure on each pass: do we need to re-init it? … … 249 246 return true; 250 247 } 248 249 # if (PS_TRACE_ON) 250 float mean, stdev; 251 psStatsOptions meanOption = psStatsMeanOption(psf->psfTrendStats->options); 252 psStatsOptions stdevOption = psStatsStdevOption(psf->psfTrendStats->options); 251 253 mean = psStatsGetValue (trend->stats, meanOption); 252 254 stdev = psStatsGetValue (trend->stats, stdevOption); 253 255 psTrace ("psModules.objects", 4, "clipped E0 : %f +/- %f keeping %ld of %ld\n", mean, stdev, psf->psfTrendStats->clippedNvalues, e0->n); 256 # endif 257 254 258 if (psf->psfTrendMode == PM_TREND_MAP) psImageMapCleanup (trend->map); 255 259 pmSourceVisualPSFModelResid (trend, x, y, e0, srcMask); … … 264 268 return true; 265 269 } 270 # if (PS_TRACE_ON) 266 271 mean = psStatsGetValue (trend->stats, meanOption); 267 272 stdev = psStatsGetValue (trend->stats, stdevOption); 268 273 psTrace ("psModules.objects", 4, "clipped E1 : %f +/- %f keeping %ld of %ld\n", mean, stdev, psf->psfTrendStats->clippedNvalues, e1->n); 274 # endif 269 275 if (psf->psfTrendMode == PM_TREND_MAP) psImageMapCleanup (trend->map); 270 276 pmSourceVisualPSFModelResid (trend, x, y, e1, srcMask); … … 279 285 return true; 280 286 } 287 # if (PS_TRACE_ON) 281 288 mean = psStatsGetValue (trend->stats, meanOption); 282 289 stdev = psStatsGetValue (trend->stats, stdevOption); 283 290 psTrace ("psModules.objects", 4, "clipped E2 : %f +/- %f keeping %ld of %ld\n", mean, stdev, psf->psfTrendStats->clippedNvalues, e2->n); 291 # endif 284 292 if (psf->psfTrendMode == PM_TREND_MAP) psImageMapCleanup (trend->map); 285 293 pmSourceVisualPSFModelResid (trend, x, y, e2, srcMask); -
trunk/psModules/src/objects/pmSource.c
r33993 r34085 51 51 psFree(tmp->pixels); 52 52 psFree(tmp->variance); 53 # if (HAVE_MODEL_VAR)54 53 psFree(tmp->modelVar); 55 # endif56 54 psFree(tmp->maskObj); 57 55 psFree(tmp->maskView); … … 80 78 psFree (source->pixels); 81 79 psFree (source->variance); 82 # if (HAVE_MODEL_VAR)83 80 psFree (source->modelVar); 84 # endif85 81 psFree (source->maskObj); 86 82 psFree (source->maskView); … … 90 86 source->pixels = NULL; 91 87 source->variance = NULL; 92 # if (HAVE_MODEL_VAR)93 88 source->modelVar = NULL; 94 # endif95 89 source->maskObj = NULL; 96 90 source->maskView = NULL; … … 122 116 source->pixels = NULL; 123 117 source->variance = NULL; 124 # if (HAVE_MODEL_VAR)125 118 source->modelVar = NULL; 126 # endif127 119 source->maskObj = NULL; 128 120 source->maskView = NULL; … … 212 204 source->pixels = in->pixels ? psImageCopyView(NULL, in->pixels) : NULL; 213 205 source->variance = in->variance ? psImageCopyView(NULL, in->variance) : NULL; 214 # if (HAVE_MODEL_VAR)215 206 source->modelVar = NULL; 216 # endif217 207 source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL; 218 208 … … 1044 1034 bool addNoise = mode & PM_MODEL_OP_NOISE; 1045 1035 1046 # if (HAVE_MODEL_VAR)1047 1036 bool addModelVar = mode & PM_MODEL_OP_MODELVAR; 1048 1037 if (addModelVar) psAssert (source->modelVar, "programming error"); 1049 # endif1050 1038 1051 1039 // require the use of pmModelAddWithOffset if we are adding noise (because the model size and norm are rescaled) … … 1070 1058 } 1071 1059 1072 # if (HAVE_MODEL_VAR) 1073 psF32 **target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32; 1074 # else 1075 psF32 **target = source->pixels->data.F32; 1076 # endif 1060 psF32 **target = NULL; 1061 target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32; 1077 1062 1078 1063 for (int iy = 0; iy < source->modelFlux->numRows; iy++) { … … 1089 1074 } 1090 1075 } 1091 # if (HAVE_MODEL_VAR) 1076 // do not change the flag here if we are adding/subtracting from modelVar 1092 1077 if (!addModelVar) { 1093 if (add) {1094 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;1095 } else {1096 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;1097 }1078 if (add) { 1079 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1080 } else { 1081 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1082 } 1098 1083 } 1099 # else1100 if (add) {1101 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;1102 } else {1103 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;1104 }1105 # endif1106 1084 return true; 1107 1085 } … … 1111 1089 target = source->variance; 1112 1090 } 1113 # if (HAVE_MODEL_VAR)1114 1091 if (addModelVar) { 1115 target = source->modelVar; 1116 } 1117 # endif 1092 target = source->modelVar; 1093 } 1118 1094 1119 1095 if (add) { 1120 1096 status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1121 # if (HAVE_MODEL_VAR)1122 1097 if (!addNoise && !addModelVar) source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1123 # else1124 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;1125 # endif1126 1098 } else { 1127 1099 status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1128 # if (HAVE_MODEL_VAR)1129 1100 if (!addNoise && !addModelVar) source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1130 # else 1131 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1132 # endif 1101 } 1102 if (!status) { 1103 // XXX maybe raise an error or warning? 1133 1104 } 1134 1105 … … 1200 1171 status = pmModelSubWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy); 1201 1172 } 1173 if (!status) { 1174 // XXX raise an error or warning? 1175 } 1202 1176 1203 1177 // restore original values … … 1287 1261 } else { 1288 1262 status = pmModelSubWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy); 1263 } 1264 if (!status) { 1265 // XXX raise an error or warning? 1289 1266 } 1290 1267 -
trunk/psModules/src/objects/pmSource.h
r33993 r34085 72 72 psImage *pixels; ///< Rectangular region including object pixels. 73 73 psImage *variance; ///< Image variance. 74 # if (HAVE_MODEL_VAR)75 74 psImage *modelVar; ///< variance based on current models 76 # endif77 75 psImage *maskObj; ///< unique mask for this object which marks included pixels associated with objects. 78 76 psImage *maskView; ///< view into global image mask for this object region -
trunk/psModules/src/objects/pmSourceIO_CMP.c
r32347 r34085 65 65 int i, type; 66 66 // psMetadataItem *mdi; 67 psF32 *PAR , *dPAR;67 psF32 *PAR; 68 68 float lsky = 0; 69 69 bool status; … … 130 130 131 131 PAR = model->params->data.F32; 132 dPAR = model->dparams->data.F32;133 132 134 133 type = pmSourceGetDophotType (source); … … 174 173 bool status; 175 174 int Ninstar; 176 psF32 *PAR , *dPAR;175 psF32 *PAR; 177 176 psEllipseAxes axes; 178 177 … … 185 184 } 186 185 187 // find config information for output header188 float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");189 if (!status)190 ZERO_POINT = 25.0;186 // XXX unused // find config information for output header 187 // XXX unused float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT"); 188 // XXX unused if (!status) 189 // XXX unused ZERO_POINT = 25.0; 191 190 192 191 // how many lines in the header? … … 273 272 274 273 PAR = source->modelPSF->params->data.F32; 275 dPAR = source->modelPSF->dparams->data.F32;276 274 277 275 PAR[PM_PAR_SKY] = pow (atof (array->data[5]), 10.0); -
trunk/psModules/src/objects/pmSourceIO_PS1_CAL_0.c
r32347 r34085 322 322 } 323 323 324 # define WRITE_AP_DATA 0 325 324 326 bool pmSourcesWrite_PS1_CAL_0_XSRC (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe) 325 327 { … … 338 340 } 339 341 342 # if (WRITE_AP_DATA) 340 343 bool calMags = false; 341 344 bool status1 = false; … … 350 353 calMags = true; 351 354 } 355 # endif 352 356 353 357 // create a header to hold the output data … … 424 428 psMetadataAdd (row, PS_LIST_TAIL, "Y_EXT_SIG", PS_DATA_F32, "Sigma in EXT y coordinate", yErr); 425 429 426 # if ( 0)430 # if (WRITE_AP_DATA) 427 431 // Petrosian measurements 428 432 // XXX insert header data: petrosian ref radius, flux ratio -
trunk/psModules/src/objects/pmSourceIO_SMPDATA.c
r32347 r34085 63 63 psMetadata *row; 64 64 int i; 65 psF32 *PAR , *dPAR;65 psF32 *PAR; 66 66 bool status; 67 67 psEllipseAxes axes; … … 85 85 if (model != NULL) { 86 86 PAR = model->params->data.F32; 87 dPAR = model->dparams->data.F32;88 87 xPos = PAR[PM_PAR_XPOS]; 89 88 yPos = PAR[PM_PAR_YPOS]; … … 145 144 146 145 bool status; 147 psF32 *PAR , *dPAR;146 psF32 *PAR; 148 147 psEllipseAxes axes; 149 148 float lsky; … … 176 175 177 176 PAR = model->params->data.F32; 178 dPAR = model->dparams->data.F32;179 177 180 178 psMetadata *row = table->data[i]; -
trunk/psModules/src/objects/pmSourceIO_SX.c
r32347 r34085 56 56 PS_ASSERT_PTR_NON_NULL(filename, false); 57 57 58 psF32 *PAR , *dPAR;58 psF32 *PAR; 59 59 psEllipseAxes axes; 60 60 … … 77 77 78 78 PAR = model->params->data.F32; 79 dPAR = model->dparams->data.F32;80 79 81 80 // pmSourceSextractType (source, &type, &flags); -
trunk/psModules/src/objects/pmSourcePhotometry.c
r33993 r34085 899 899 } 900 900 901 # if (HAVE_MODEL_VAR)902 901 double pmSourceModelWeight(const pmSource *Mi, int term, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal) 903 # else904 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal)905 # endif906 902 { 907 903 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 908 # if (HAVE_MODEL_VAR) 909 double flux = 0, wt = 1.0, factor = 0; 910 # else 911 double flux = 0, wt = 0, factor = 0; 912 # endif 904 double flux = 0; 905 double wt = 1.0; 906 double factor = 0; 913 907 914 908 const psImage *Pi = Mi->modelFlux; 915 909 assert (Pi != NULL); 916 910 917 # if (HAVE_MODEL_VAR)918 911 const psImage *Wi = NULL; 919 912 switch (fitVarMode) { … … 921 914 break; 922 915 case PM_SOURCE_PHOTFIT_IMAGE_VAR: 916 case PM_SOURCE_PHOTFIT_MODEL_SKY: 917 Wi = Mi->variance; 918 psAssert (Wi, "programming error"); 919 break; 920 case PM_SOURCE_PHOTFIT_MODEL_VAR: 921 Wi = Mi->modelVar; 922 psAssert (Wi, "programming error"); 923 break; 924 case PM_SOURCE_PHOTFIT_NONE: 925 psAbort("programming error"); 926 } 927 const psImage *Ti = Mi->maskObj; 928 assert (Ti != NULL); 929 930 for (int yi = 0; yi < Pi->numRows; yi++) { 931 for (int xi = 0; xi < Pi->numCols; xi++) { 932 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi] & maskVal) 933 continue; 934 if (fitVarMode != PM_SOURCE_PHOTFIT_CONST) { 935 wt = covarFactor * Wi->data.F32[yi][xi]; 936 if (wt == 0) continue; 937 } 938 switch (term) { 939 case 0: 940 factor = 1; 941 break; 942 case 1: 943 factor = xi + Pi->col0; 944 break; 945 case 2: 946 factor = yi + Pi->row0; 947 break; 948 default: 949 psAbort("invalid term for pmSourceWeight"); 950 } 951 952 // wt is 1.0 for CONST 953 flux += (factor * Pi->data.F32[yi][xi]) / wt; 954 } 955 } 956 return flux; 957 } 958 959 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal) 960 { 961 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 962 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 963 int Xs, Xe, Ys, Ye; 964 int xi, xj, yi, yj; 965 int xIs, xJs, yIs, yJs; 966 int xIe, yIe; 967 double flux; 968 double wt = 1.0; 969 970 const psImage *Pi = Mi->modelFlux; 971 assert (Pi != NULL); 972 const psImage *Pj = Mj->modelFlux; 973 assert (Pj != NULL); 974 975 const psImage *Wi = NULL; 976 switch (fitVarMode) { 977 case PM_SOURCE_PHOTFIT_CONST: 978 break; 979 case PM_SOURCE_PHOTFIT_IMAGE_VAR: 980 case PM_SOURCE_PHOTFIT_MODEL_SKY: 981 Wi = Mi->variance; 982 psAssert (Wi, "programming error"); 983 break; 984 case PM_SOURCE_PHOTFIT_MODEL_VAR: 985 Wi = Mi->modelVar; 986 psAssert (Wi, "programming error"); 987 break; 988 case PM_SOURCE_PHOTFIT_NONE: 989 psAbort("programming error"); 990 } 991 992 const psImage *Ti = Mi->maskObj; 993 assert (Ti != NULL); 994 const psImage *Tj = Mj->maskObj; 995 assert (Tj != NULL); 996 997 Xs = PS_MAX (Pi->col0, Pj->col0); 998 Xe = PS_MIN (Pi->col0 + Pi->numCols, Pj->col0 + Pj->numCols); 999 1000 Ys = PS_MAX (Pi->row0, Pj->row0); 1001 Ye = PS_MIN (Pi->row0 + Pi->numRows, Pj->row0 + Pj->numRows); 1002 1003 xIs = Xs - Pi->col0; 1004 xJs = Xs - Pj->col0; 1005 yIs = Ys - Pi->row0; 1006 yJs = Ys - Pj->row0; 1007 1008 xIe = Xe - Pi->col0; 1009 yIe = Ye - Pi->row0; 1010 1011 // note that weight is addressing the same image pixels 1012 flux = 0; 1013 for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) { 1014 for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) { 1015 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi] & maskVal) 1016 continue; 1017 if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj] & maskVal) 1018 continue; 1019 1020 float value = (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 1021 switch (fitVarMode) { 1022 case PM_SOURCE_PHOTFIT_CONST: 1023 wt = 1.0; 1024 break; 1025 case PM_SOURCE_PHOTFIT_IMAGE_VAR: 1026 case PM_SOURCE_PHOTFIT_MODEL_SKY: 1027 case PM_SOURCE_PHOTFIT_MODEL_VAR: 1028 wt = covarFactor * Wi->data.F32[yi][xi]; 1029 break; 1030 case PM_SOURCE_PHOTFIT_NONE: 1031 psAbort("programming error"); 1032 } 1033 // skip pixels with nonsense weight values 1034 if (wt <= 0) continue; 1035 1036 flux += value / wt; 1037 } 1038 } 1039 return flux; 1040 } 1041 1042 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal) 1043 { 1044 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 1045 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 1046 int Xs, Xe, Ys, Ye; 1047 int xi, xj, yi, yj; 1048 int xIs, xJs, yIs, yJs; 1049 int xIe, yIe; 1050 double flux; 1051 double wt = 1.0; 1052 1053 const psImage *Pi = Mi->pixels; 1054 assert (Pi != NULL); 1055 const psImage *Pj = Mj->modelFlux; 1056 assert (Pj != NULL); 1057 1058 const psImage *Wi = NULL; 1059 switch (fitVarMode) { 1060 case PM_SOURCE_PHOTFIT_CONST: 1061 break; 1062 case PM_SOURCE_PHOTFIT_IMAGE_VAR: 1063 case PM_SOURCE_PHOTFIT_MODEL_SKY: 923 1064 Wi = Mi->variance; 924 1065 psAssert (Wi, "programming error"); … … 931 1072 psAbort("programming error"); 932 1073 } 933 # else934 const psImage *Wi = Mi->variance;935 if (!unweighted_sum) {936 assert (Wi != NULL);937 }938 # endif939 const psImage *Ti = Mi->maskObj;940 assert (Ti != NULL);941 942 for (int yi = 0; yi < Pi->numRows; yi++) {943 for (int xi = 0; xi < Pi->numCols; xi++) {944 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi] & maskVal)945 continue;946 # if (HAVE_MODEL_VAR)947 if (fitVarMode != PM_SOURCE_PHOTFIT_CONST) {948 wt = covarFactor * Wi->data.F32[yi][xi];949 if (wt == 0) continue;950 }951 # else952 if (!unweighted_sum) {953 wt = covarFactor * Wi->data.F32[yi][xi];954 if (wt == 0)955 continue;956 }957 # endif958 959 switch (term) {960 case 0:961 factor = 1;962 break;963 case 1:964 factor = xi + Pi->col0;965 break;966 case 2:967 factor = yi + Pi->row0;968 break;969 default:970 psAbort("invalid term for pmSourceWeight");971 }972 973 # if (HAVE_MODEL_VAR)974 // wt is 1.0 for CONST975 flux += (factor * Pi->data.F32[yi][xi]) / wt;976 # else977 if (unweighted_sum) {978 flux += (factor * Pi->data.F32[yi][xi]);979 } else {980 flux += (factor * Pi->data.F32[yi][xi]) / wt;981 }982 # endif983 }984 }985 return flux;986 }987 988 # if (HAVE_MODEL_VAR)989 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal)990 # else991 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal)992 # endif993 {994 PS_ASSERT_PTR_NON_NULL(Mi, NAN);995 PS_ASSERT_PTR_NON_NULL(Mj, NAN);996 int Xs, Xe, Ys, Ye;997 int xi, xj, yi, yj;998 int xIs, xJs, yIs, yJs;999 int xIe, yIe;1000 # if (HAVE_MODEL_VAR)1001 double flux;1002 double wt = 1.0;1003 # else1004 double flux, wt;1005 # endif1006 1007 const psImage *Pi = Mi->modelFlux;1008 assert (Pi != NULL);1009 const psImage *Pj = Mj->modelFlux;1010 assert (Pj != NULL);1011 1012 # if (HAVE_MODEL_VAR)1013 const psImage *Wi = NULL;1014 switch (fitVarMode) {1015 case PM_SOURCE_PHOTFIT_CONST:1016 break;1017 case PM_SOURCE_PHOTFIT_IMAGE_VAR:1018 Wi = Mi->variance;1019 psAssert (Wi, "programming error");1020 break;1021 case PM_SOURCE_PHOTFIT_MODEL_VAR:1022 Wi = Mi->modelVar;1023 psAssert (Wi, "programming error");1024 break;1025 case PM_SOURCE_PHOTFIT_NONE:1026 psAbort("programming error");1027 }1028 # else1029 const psImage *Wi = Mi->variance;1030 if (!unweighted_sum) {1031 assert (Wi != NULL);1032 }1033 # endif1034 1074 1035 1075 const psImage *Ti = Mi->maskObj; … … 1052 1092 yIe = Ye - Pi->row0; 1053 1093 1054 // note that weight is addressing the same image pixels 1094 // note that weight is addressing the same image pixels, 1055 1095 flux = 0; 1056 1096 for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) { … … 1061 1101 continue; 1062 1102 1063 # if (HAVE_MODEL_VAR)1064 1103 float value = (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 1065 1104 switch (fitVarMode) { … … 1068 1107 break; 1069 1108 case PM_SOURCE_PHOTFIT_IMAGE_VAR: 1109 case PM_SOURCE_PHOTFIT_MODEL_SKY: 1070 1110 case PM_SOURCE_PHOTFIT_MODEL_VAR: 1071 1111 wt = covarFactor * Wi->data.F32[yi][xi]; … … 1078 1118 1079 1119 flux += value / wt; 1080 # else1081 // XXX skip the nonsense weight pixels?1082 if (unweighted_sum) {1083 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]);1084 } else {1085 wt = covarFactor * Wi->data.F32[yi][xi];1086 if (wt > 0) {1087 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt;1088 }1089 }1090 # endif1091 1120 } 1092 1121 } 1093 1122 return flux; 1094 1123 } 1095 1096 # if (HAVE_MODEL_VAR)1097 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal)1098 # else1099 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal)1100 # endif1101 {1102 PS_ASSERT_PTR_NON_NULL(Mi, NAN);1103 PS_ASSERT_PTR_NON_NULL(Mj, NAN);1104 int Xs, Xe, Ys, Ye;1105 int xi, xj, yi, yj;1106 int xIs, xJs, yIs, yJs;1107 int xIe, yIe;1108 # if (HAVE_MODEL_VAR)1109 double flux;1110 double wt = 1.0;1111 # else1112 double flux, wt;1113 # endif1114 1115 const psImage *Pi = Mi->pixels;1116 assert (Pi != NULL);1117 const psImage *Pj = Mj->modelFlux;1118 assert (Pj != NULL);1119 1120 # if (HAVE_MODEL_VAR)1121 const psImage *Wi = NULL;1122 switch (fitVarMode) {1123 case PM_SOURCE_PHOTFIT_CONST:1124 break;1125 case PM_SOURCE_PHOTFIT_IMAGE_VAR:1126 Wi = Mi->variance;1127 psAssert (Wi, "programming error");1128 break;1129 case PM_SOURCE_PHOTFIT_MODEL_VAR:1130 Wi = Mi->modelVar;1131 psAssert (Wi, "programming error");1132 break;1133 case PM_SOURCE_PHOTFIT_NONE:1134 psAbort("programming error");1135 }1136 # else1137 const psImage *Wi = Mi->variance;1138 if (!unweighted_sum) {1139 assert (Wi != NULL);1140 }1141 # endif1142 1143 const psImage *Ti = Mi->maskObj;1144 assert (Ti != NULL);1145 const psImage *Tj = Mj->maskObj;1146 assert (Tj != NULL);1147 1148 Xs = PS_MAX (Pi->col0, Pj->col0);1149 Xe = PS_MIN (Pi->col0 + Pi->numCols, Pj->col0 + Pj->numCols);1150 1151 Ys = PS_MAX (Pi->row0, Pj->row0);1152 Ye = PS_MIN (Pi->row0 + Pi->numRows, Pj->row0 + Pj->numRows);1153 1154 xIs = Xs - Pi->col0;1155 xJs = Xs - Pj->col0;1156 yIs = Ys - Pi->row0;1157 yJs = Ys - Pj->row0;1158 1159 xIe = Xe - Pi->col0;1160 yIe = Ye - Pi->row0;1161 1162 // note that weight is addressing the same image pixels,1163 flux = 0;1164 for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) {1165 for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) {1166 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi] & maskVal)1167 continue;1168 if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj] & maskVal)1169 continue;1170 1171 # if (HAVE_MODEL_VAR)1172 float value = (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]);1173 switch (fitVarMode) {1174 case PM_SOURCE_PHOTFIT_CONST:1175 wt = 1.0;1176 break;1177 case PM_SOURCE_PHOTFIT_IMAGE_VAR:1178 case PM_SOURCE_PHOTFIT_MODEL_VAR:1179 wt = covarFactor * Wi->data.F32[yi][xi];1180 break;1181 case PM_SOURCE_PHOTFIT_NONE:1182 psAbort("programming error");1183 }1184 // skip pixels with nonsense weight values1185 if (wt <= 0) continue;1186 1187 flux += value / wt;1188 1189 # else1190 // XXX skip the nonsense weight pixels?1191 if (unweighted_sum) {1192 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]);1193 } else {1194 wt = covarFactor * Wi->data.F32[yi][xi];1195 if (wt > 0) {1196 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt;1197 }1198 }1199 # endif1200 }1201 }1202 return flux;1203 } -
trunk/psModules/src/objects/pmSourcePhotometry.h
r33993 r34085 38 38 } pmSourcePhotometryMode; 39 39 40 # if (HAVE_MODEL_VAR)41 40 typedef enum { 42 41 PM_SOURCE_PHOTFIT_NONE = 0, … … 44 43 PM_SOURCE_PHOTFIT_IMAGE_VAR = 2, 45 44 PM_SOURCE_PHOTFIT_MODEL_VAR = 3, 45 PM_SOURCE_PHOTFIT_MODEL_SKY = 4, // XXX bad name: set variance floor based on mean variance image (variance of sky) 46 46 } pmSourceFitVarMode; 47 # endif48 47 49 48 bool pmSourcePhotometryModel( … … 84 83 bool pmSourceMeasureDiffStats (pmSource *source, psImageMaskType maskVal, psImageMaskType markVal); 85 84 86 # if (HAVE_MODEL_VAR)87 85 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal); 88 86 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal); 89 87 double pmSourceModelWeight(const pmSource *Mi, int term, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal); 90 # else91 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal);92 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal);93 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal);94 # endif95 88 96 89 bool pmSourceNeighborFlags (pmSource *source); -
trunk/psModules/test/tap/src/tap.c
r11550 r34085 87 87 if(test_name != NULL) { 88 88 va_start(ap, test_name); 89 vasprintf(&local_test_name, test_name, ap); 89 int status = vasprintf(&local_test_name, test_name, ap); 90 if (status) {/* warning? */} 90 91 va_end(ap); 91 92 … … 303 304 304 305 va_start(ap, fmt); 305 asprintf(&skip_msg, fmt, ap); 306 int status = asprintf(&skip_msg, fmt, ap); 307 if (status) {/* warning? */} 306 308 va_end(ap); 307 309 … … 328 330 329 331 va_start(ap, fmt); 330 vasprintf(&todo_msg, fmt, ap); 332 int status = vasprintf(&todo_msg, fmt, ap); 333 if (status) {/* warning? */} 331 334 va_end(ap); 332 335
Note:
See TracChangeset
for help on using the changeset viewer.
