Changeset 21087
- Timestamp:
- Jan 6, 2009, 7:13:34 AM (17 years ago)
- Location:
- branches/eam_branch_20081230
- Files:
-
- 70 edited
-
ppArith/src/ppArithReadout.c (modified) (2 diffs)
-
ppImage/src/ppImage.h (modified) (1 diff)
-
ppImage/src/ppImageReplaceBackground.c (modified) (4 diffs)
-
ppImage/src/ppImageSetMaskBits.c (modified) (1 diff)
-
ppMerge/src/ppMergeArguments.c (modified) (1 diff)
-
ppMerge/src/ppMergeLoop.c (modified) (1 diff)
-
ppMerge/src/ppMergeLoop_Threaded.c (modified) (3 diffs)
-
ppMerge/src/ppMergeMask.c (modified) (3 diffs)
-
ppMerge/src/ppMergeScaleZero.c (modified) (1 diff)
-
ppMerge/src/ppMergeSetThreads.c (modified) (2 diffs)
-
ppMerge/src/ppMergeThreadLauncher.c (modified) (2 diffs)
-
ppSim/src/ppSimMosaicChip.c (modified) (1 diff)
-
ppSim/src/ppSimPhotom.c (modified) (1 diff)
-
ppSim/src/ppSimPhotomReadout.c (modified) (1 diff)
-
ppSim/src/ppSimPhotomReadoutFake.c (modified) (1 diff)
-
ppSim/src/ppSimPhotomReadoutForce.c (modified) (1 diff)
-
ppStats/src/ppStats.h (modified) (4 diffs)
-
ppStats/src/ppStatsFPA.c (modified) (1 diff)
-
ppStats/src/ppStatsMetadata.c (modified) (1 diff)
-
ppStats/src/ppStatsPixels.c (modified) (1 diff)
-
ppStats/src/ppStatsReadout.c (modified) (3 diffs)
-
psastro/src/psastroAstromGuess.c (modified) (1 diff)
-
psastro/src/psastroFixChips.c (modified) (1 diff)
-
psastro/src/psastroLuminosityFunction.c (modified) (2 diffs)
-
psastro/src/psastroMaskUpdates.Mosaic.c (modified) (10 diffs)
-
psastro/src/psastroMaskUpdates.c (modified) (11 diffs)
-
psastro/src/psastroMosaicFPtoTP.c (modified) (1 diff)
-
psphot/src/psphot.h (modified) (9 diffs)
-
psphot/src/psphotAddNoise.c (modified) (1 diff)
-
psphot/src/psphotAnnuli.c (modified) (1 diff)
-
psphot/src/psphotApResid.c (modified) (6 diffs)
-
psphot/src/psphotBlendFit.c (modified) (1 diff)
-
psphot/src/psphotChoosePSF.c (modified) (2 diffs)
-
psphot/src/psphotExtendedSourceAnalysis.c (modified) (1 diff)
-
psphot/src/psphotExtendedSourceFits.c (modified) (1 diff)
-
psphot/src/psphotExtendedSources.c (modified) (1 diff)
-
psphot/src/psphotFindDetections.c (modified) (1 diff)
-
psphot/src/psphotFindFootprints.c (modified) (1 diff)
-
psphot/src/psphotFitSet.c (modified) (1 diff)
-
psphot/src/psphotFitSourcesLinear.c (modified) (6 diffs)
-
psphot/src/psphotGuessModels.c (modified) (2 diffs)
-
psphot/src/psphotIsophotal.c (modified) (1 diff)
-
psphot/src/psphotKron.c (modified) (1 diff)
-
psphot/src/psphotMagnitudes.c (modified) (1 diff)
-
psphot/src/psphotMakeGrowthCurve.c (modified) (1 diff)
-
psphot/src/psphotMakeResiduals.c (modified) (10 diffs)
-
psphot/src/psphotMaskReadout.c (modified) (1 diff)
-
psphot/src/psphotModelBackground.c (modified) (1 diff)
-
psphot/src/psphotModelTest.c (modified) (1 diff)
-
psphot/src/psphotModelWithPSF.c (modified) (9 diffs)
-
psphot/src/psphotMosaicChip.c (modified) (1 diff)
-
psphot/src/psphotOutput.c (modified) (6 diffs)
-
psphot/src/psphotPSFConvModel.c (modified) (4 diffs)
-
psphot/src/psphotPetrosian.c (modified) (1 diff)
-
psphot/src/psphotRadialPlot.c (modified) (1 diff)
-
psphot/src/psphotRadialProfile.c (modified) (2 diffs)
-
psphot/src/psphotRadiusChecks.c (modified) (3 diffs)
-
psphot/src/psphotReplaceUnfit.c (modified) (6 diffs)
-
psphot/src/psphotRoughClass.c (modified) (1 diff)
-
psphot/src/psphotSetMaskBits.c (modified) (2 diffs)
-
psphot/src/psphotSignificanceImage.c (modified) (2 diffs)
-
psphot/src/psphotSkyReplace.c (modified) (1 diff)
-
psphot/src/psphotSourceFits.c (modified) (5 diffs)
-
psphot/src/psphotSourcePlots.c (modified) (1 diff)
-
psphot/src/psphotSourceSize.c (modified) (11 diffs)
-
psphot/src/psphotSourceStats.c (modified) (1 diff)
-
psphot/src/psphotSubtractBackground.c (modified) (1 diff)
-
psphot/src/psphotTestPSF.c (modified) (1 diff)
-
psphot/src/psphotTestSourceOutput.c (modified) (1 diff)
-
psphot/src/psphotVisual.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20081230/ppArith/src/ppArithReadout.c
r15597 r21087 26 26 outImage = output->mask; 27 27 if (!outImage) { 28 output->mask = outImage = psImageAlloc(inImage1->numCols, inImage1->numRows, PS_TYPE_ MASK);28 output->mask = outImage = psImageAlloc(inImage1->numCols, inImage1->numRows, PS_TYPE_IMAGE_MASK); 29 29 } 30 30 if (!output->image) { … … 37 37 outImage = output->image; 38 38 if (!outImage) { 39 output->mask = outImage = psImageAlloc(inImage1->numCols, inImage1->numRows, PS_TYPE_ MASK);39 output->mask = outImage = psImageAlloc(inImage1->numCols, inImage1->numRows, PS_TYPE_IMAGE_MASK); 40 40 } 41 41 } -
branches/eam_branch_20081230/ppImage/src/ppImage.h
r21072 r21087 58 58 59 59 // make values for abstract concepts of masking 60 ps MaskType maskValue; // apply this bit-mask to choose masked bits61 ps MaskType markValue; // apply this bit-mask to choose masked bits62 ps MaskType satMask; // Mask value to give saturated pixels63 ps MaskType badMask; // Mask value to give bad pixels64 ps MaskType flatMask; // Mask value to give bad flat pixels65 ps MaskType blankMask; // Mask value to give blank pixels60 psImageMaskType maskValue; // apply this bit-mask to choose masked bits 61 psImageMaskType markValue; // apply this bit-mask to choose masked bits 62 psImageMaskType satMask; // Mask value to give saturated pixels 63 psImageMaskType badMask; // Mask value to give bad pixels 64 psImageMaskType flatMask; // Mask value to give bad flat pixels 65 psImageMaskType blankMask; // Mask value to give blank pixels 66 66 67 67 // non-linear correction parameters -
branches/eam_branch_20081230/ppImage/src/ppImageReplaceBackground.c
r21072 r21087 30 30 // XXX Should this be options->maskValue or options->maskValue & ~options->satMask? 31 31 // The latter will leave saturated pixels high 32 ps MaskType maskVal = options->maskValue;32 psImageMaskType maskVal = options->maskValue; 33 33 34 34 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 35 psMetadataAdd U8(psphotRecipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "user-defined mask", maskVal);35 psMetadataAddImageMask(psphotRecipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "user-defined mask", maskVal); 36 36 37 37 // Since we are working on a chip-mosaicked image, there should only be a single cell and readout … … 146 146 if (!isfinite(value)) { 147 147 image->data.F32[y][x] = NAN; 148 mask->data.PS_TYPE_ MASK_DATA[y][x] |= options->badMask;148 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->badMask; 149 149 } else { 150 150 image->data.F32[y][x] -= value; … … 157 157 for (int y = 0; y < numRows; y++) { 158 158 for (int x = 0; x < numCols; x++) { 159 if (mask && mask->data.PS_TYPE_ MASK_DATA[y][x] & maskVal) {159 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) { 160 160 image->data.F32[y][x] = 0.0; 161 161 } else { … … 163 163 if (!isfinite(value)) { 164 164 image->data.F32[y][x] = NAN; 165 mask->data.PS_TYPE_ MASK_DATA[y][x] |= options->badMask;165 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->badMask; 166 166 } else { 167 167 image->data.F32[y][x] -= value; -
branches/eam_branch_20081230/ppImage/src/ppImageSetMaskBits.c
r21072 r21087 38 38 39 39 // set maskValue and markValue in the psphot recipe 40 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "user-defined mask", options->maskValue);41 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "user-defined mask", options->markValue);40 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "user-defined mask", options->maskValue); 41 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "user-defined mask", options->markValue); 42 42 43 43 return true; -
branches/eam_branch_20081230/ppMerge/src/ppMergeArguments.c
r21072 r21087 94 94 } \ 95 95 } \ 96 ps MaskType mask = pmConfigMask(str, config); \97 psMetadataAdd U8(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, mask); \96 psImageMaskType mask = pmConfigMask(str, config); \ 97 psMetadataAddImageMask(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, mask); \ 98 98 } 99 99 -
branches/eam_branch_20081230/ppMerge/src/ppMergeLoop.c
r18757 r21087 38 38 39 39 // set the mask and mark bit values based on the named masks 40 ps MaskType maskVal;41 ps MaskType markVal;40 psImageMaskType maskVal; 41 psImageMaskType markVal; 42 42 if (!pmConfigMaskSetBits (&maskVal, &markVal, config)) { 43 43 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values"); -
branches/eam_branch_20081230/ppMerge/src/ppMergeLoop_Threaded.c
r21072 r21087 54 54 55 55 // set the mask and mark bit values based on the named masks 56 ps MaskType maskVal;57 ps MaskType markVal;56 psImageMaskType maskVal; 57 psImageMaskType markVal; 58 58 if (!pmConfigMaskSetBits (&maskVal, &markVal, config)) { 59 59 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values"); … … 257 257 psArrayAdd(job->args, 1, psScalarAlloc(iter, PS_TYPE_S32)); 258 258 psArrayAdd(job->args, 1, psScalarAlloc(rej, PS_TYPE_F32)); 259 psArrayAdd(job->args, 1, psScalarAlloc(maskVal, PS_TYPE_ U8));259 psArrayAdd(job->args, 1, psScalarAlloc(maskVal, PS_TYPE_IMAGE_MASK)); 260 260 261 261 // call: pmDarkCombine(outCell, fileGroup->readouts, iter, rej, maskVal); … … 276 276 psArrayAdd(job->args, 1, psScalarAlloc(iter, PS_TYPE_S32)); 277 277 psArrayAdd(job->args, 1, psScalarAlloc(rej, PS_TYPE_F32)); 278 psArrayAdd(job->args, 1, psScalarAlloc(maskVal, PS_TYPE_ U8));278 psArrayAdd(job->args, 1, psScalarAlloc(maskVal, PS_TYPE_IMAGE_MASK)); 279 279 280 280 // call: pmShutterCorrectionGenerate(outRO, pattern, fileGroup->readouts, shutterRef, -
branches/eam_branch_20081230/ppMerge/src/ppMergeMask.c
r18756 r21087 26 26 float smoothScale = psMetadataLookupF32(&mdok, config->arguments, "MASK.SMOOTH.SCALE"); // Radius to grow mask 27 27 28 ps MaskType markVal;29 ps MaskType maskValRaw;28 psImageMaskType markVal; 29 psImageMaskType maskValRaw; 30 30 if (!pmConfigMaskSetBits (&maskValRaw, &markVal, config)) { 31 31 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values"); … … 34 34 35 35 char *maskOutName = psMetadataLookupStr (&mdok, config->arguments, "MASK.SET.VALUE"); 36 ps MaskType maskValOut = pmConfigMaskGet (maskOutName, config);36 psImageMaskType maskValOut = pmConfigMaskGet (maskOutName, config); 37 37 if (!maskValOut) { 38 38 psError (PS_ERR_UNKNOWN, true, "Undefined output mask bit value"); … … 137 137 int x = pixel % numCols; 138 138 int y = pixel / numCols; 139 if (mask && (mask->data.PS_TYPE_ MASK_DATA[y][x] & maskValRaw)) continue;140 if (outMask && (outMask->data.PS_TYPE_ MASK_DATA[y][x] & maskValOut)) continue;139 if (mask && (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskValRaw)) continue; 140 if (outMask && (outMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskValOut)) continue; 141 141 if (!isfinite(image->data.F32[y][x])) continue; 142 142 -
branches/eam_branch_20081230/ppMerge/src/ppMergeScaleZero.c
r21072 r21087 80 80 pmReadout *readout = cell->readouts->data[0]; // Readout of interest 81 81 82 ps MaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask82 psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask 83 83 84 84 switch (type) { -
branches/eam_branch_20081230/ppMerge/src/ppMergeSetThreads.c
r19299 r21087 29 29 psScalar *maskVal = job->args->data[4]; 30 30 31 bool status = pmDarkCombine(outCell, fileGroup->readouts, iter->data.S32, rej->data.F32, maskVal->data. U8);31 bool status = pmDarkCombine(outCell, fileGroup->readouts, iter->data.S32, rej->data.F32, maskVal->data.PS_TYPE_IMAGE_MASK_DATA); 32 32 33 33 // after we are done, tell the I/O system that this file group is done … … 49 49 psScalar *maskVal = job->args->data[7]; 50 50 51 bool status = pmShutterCorrectionGenerate(output, pattern, fileGroup->readouts, shutterRef->data.F32, data, iter->data.S32, rej->data.F32, maskVal->data. U8);51 bool status = pmShutterCorrectionGenerate(output, pattern, fileGroup->readouts, shutterRef->data.F32, data, iter->data.S32, rej->data.F32, maskVal->data.PS_TYPE_IMAGE_MASK_DATA); 52 52 53 53 // after we are done, tell the I/O system that this file group is done -
branches/eam_branch_20081230/ppMerge/src/ppMergeThreadLauncher.c
r18839 r21087 60 60 psScalar *maskVal = job->args->data[6]; 61 61 62 bool status = pmDarkCombine(outCell, fileGroup->readouts, darkOrdinates, darkNorm, iter->data.S32, rej->data.F32, maskVal->data. U8);62 bool status = pmDarkCombine(outCell, fileGroup->readouts, darkOrdinates, darkNorm, iter->data.S32, rej->data.F32, maskVal->data.PS_TYPE_IMAGE_MASK_DATA); 63 63 if (!status) { 64 64 self->fault = true; … … 82 82 psScalar *maskVal = job->args->data[6]; 83 83 84 bool status = pmShutterCorrectionGenerate(output, NULL, fileGroup->readouts, shutterRef->data.F32, data, iter->data.S32, rej->data.F32, maskVal->data. U8);84 bool status = pmShutterCorrectionGenerate(output, NULL, fileGroup->readouts, shutterRef->data.F32, data, iter->data.S32, rej->data.F32, maskVal->data.PS_TYPE_IMAGE_MASK_DATA); 85 85 if (!status) { 86 86 self->fault = true; -
branches/eam_branch_20081230/ppSim/src/ppSimMosaicChip.c
r18712 r21087 2 2 3 3 // XXX this is essentially identical to ppImageMosaicChip 4 bool ppSimMosaicChip(pmConfig *config, const ps MaskType blankMask, const pmFPAview *view,4 bool ppSimMosaicChip(pmConfig *config, const psImageMaskType blankMask, const pmFPAview *view, 5 5 const char *outFile, const char *inFile) 6 6 { -
branches/eam_branch_20081230/ppSim/src/ppSimPhotom.c
r20410 r21087 15 15 psphotInit (); 16 16 17 XXX : should this be a psImageMaskType? 17 18 int blankMask = 0; // XXX not sure what this should be set to... 18 19 ppSimMosaicChip(config, blankMask, view, "PPSIM.FORCE.CHIP", "PPSIM.INPUT"); -
branches/eam_branch_20081230/ppSim/src/ppSimPhotomReadout.c
r20403 r21087 96 96 97 97 // XXX fake sources should measure peak->x,y, force sources should not 98 ps MaskType maskVal = 0xff;98 psImageMaskType maskVal = 0xff; 99 99 psImage *significance = psphotSignificanceImage (readout, recipe, 1, maskVal); 100 100 ppSimDetections (significance, recipe, fakeSources); -
branches/eam_branch_20081230/ppSim/src/ppSimPhotomReadoutFake.c
r20403 r21087 76 76 77 77 // XXX fake sources should measure peak->x,y, force sources should not 78 ps MaskType maskVal = 0xff;78 psImageMaskType maskVal = 0xff; 79 79 psImage *significance = psphotSignificanceImage (readout, recipe, 1, maskVal); 80 80 ppSimDetections (significance, recipe, fakeSources); -
branches/eam_branch_20081230/ppSim/src/ppSimPhotomReadoutForce.c
r20403 r21087 69 69 70 70 // XXX fake sources should measure peak->x,y, force sources should not 71 ps MaskType maskVal = 0xff;71 psImageMaskType maskVal = 0xff; 72 72 psImage *significance = psphotSignificanceImage (readout, recipe, 1, maskVal); 73 73 ppSimDetections (significance, recipe, forceSources); -
branches/eam_branch_20081230/ppStats/src/ppStats.h
r21072 r21087 24 24 bool doFirstReadout3D; // for 3D data, use the first readout? 25 25 float sample; // Fraction of cell to sample for statistics 26 ps MaskType maskVal;// Mask value for images26 psImageMaskType maskVal; // Mask value for images 27 27 psList *chips; // Chips to look at 28 28 psList *cells; // Cells to look at … … 45 45 pmFPA *fpa, // FPA for which to get statistics 46 46 pmFPAview *view, // View for analysis 47 ps MaskType maskVal, // Value to mask47 psImageMaskType maskVal, // Value to mask 48 48 pmConfig *config // Configuration 49 49 ); … … 77 77 pmFPA *fpa, // FPA for which to get statistics 78 78 pmFPAview *view, // View for analysis 79 ps MaskType maskVal, // Value to mask79 psImageMaskType maskVal, // Value to mask 80 80 pmConfig *config // Configuration 81 81 ); … … 85 85 pmFPA *fpa, // FPA for which to get statistics 86 86 pmFPAview *view, // View for analysis 87 ps MaskType maskVal, // Value to mask87 psImageMaskType maskVal, // Value to mask 88 88 pmConfig *config // Configuration 89 89 ); -
branches/eam_branch_20081230/ppStats/src/ppStatsFPA.c
r21072 r21087 4 4 pmFPA *fpa, // FPA for which to get statistics 5 5 pmFPAview *view, // View for analysis 6 ps MaskType maskVal, // Value to mask6 psImageMaskType maskVal, // Value to mask 7 7 pmConfig *config // Configuration 8 8 ) -
branches/eam_branch_20081230/ppStats/src/ppStatsMetadata.c
r21072 r21087 5 5 pmFPA *fpa, // FPA for which to get statistics 6 6 pmFPAview *view, // View for analysis 7 ps MaskType maskVal, // Value to mask7 psImageMaskType maskVal, // Value to mask 8 8 pmConfig *config // Configuration 9 9 ) -
branches/eam_branch_20081230/ppStats/src/ppStatsPixels.c
r21072 r21087 5 5 pmFPA *fpa, // FPA for which to get statistics 6 6 pmFPAview *view, // View for analysis 7 ps MaskType maskVal, // Value to mask7 psImageMaskType maskVal, // Value to mask 8 8 pmConfig *config // Configuration 9 9 ) -
branches/eam_branch_20081230/ppStats/src/ppStatsReadout.c
r21072 r21087 63 63 int sampleSpace = 1.0 / data->sample; // Space between samples 64 64 psVector *sampleValues = psVectorAlloc(numSamples, PS_TYPE_F32); // Vector of samples 65 psVector *sampleMask = psVectorAlloc(numSamples, PS_TYPE_ MASK); // Corresponding mask65 psVector *sampleMask = psVectorAlloc(numSamples, PS_TYPE_VECTOR_MASK); // Corresponding mask 66 66 if (!mask) { 67 67 psVectorInit(sampleMask, 0); … … 72 72 int x = j % image->numCols; 73 73 sampleValues->data.F32[i] = image->data.F32[y][x]; 74 if ((!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & data->maskVal)) && 75 !isfinite(sampleValues->data.F32[i])) { 74 if ((!mask || !(mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & data->maskVal)) && !isfinite(sampleValues->data.F32[i])) { 76 75 if (!warnNonFinite) { 77 psWarning("Unmasked non-finite value detected at %d,%d; suppressing further warnings", 78 x, y); 76 psWarning("Unmasked non-finite value detected at %d,%d; suppressing further warnings", x, y); 79 77 warnNonFinite = true; 80 78 } 81 sampleMask->data.PS_TYPE_ MASK_DATA[i] = data->maskVal;79 sampleMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 82 80 } else if (mask) { 83 sampleMask->data.PS_TYPE_MASK_DATA[i] = mask->data.PS_TYPE_MASK_DATA[y][x];81 sampleMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 84 82 } 85 83 } 86 if (!psVectorStats(data->stats, sampleValues, NULL, sampleMask, data->maskVal)) {84 if (!psVectorStats(data->stats, sampleValues, NULL, sampleMask, 1)) { 87 85 psWarning("Unable to perform statistics on readout %s.\n", readoutName); 88 86 psErrorClear(); … … 179 177 for (int j = 0; j < readout->mask->numRows; j++) { 180 178 for (int i = 0; i < readout->mask->numCols; i++) { 181 if (readout->mask->data.PS_TYPE_ MASK_DATA[j][i] & data->maskVal) {179 if (readout->mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & data->maskVal) { 182 180 numBad++; 183 181 } -
branches/eam_branch_20081230/psastro/src/psastroAstromGuess.c
r20805 r21087 267 267 psVector *cornerDn = psVectorAllocEmpty (100, PS_TYPE_F32); 268 268 269 psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_ U8);269 psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_VECTOR_MASK); 270 270 271 271 if (DEBUG) psastroDumpCorners ("corners.up.guess3.dat", "corners.dn.guess3.dat", fpa); -
branches/eam_branch_20081230/psastro/src/psastroFixChips.c
r20805 r21087 160 160 psPlaneTransform *map = psPlaneTransformAlloc (1, 1); 161 161 162 psVector *mask = psVectorAlloc (nPts, PS_TYPE_ U8);162 psVector *mask = psVectorAlloc (nPts, PS_TYPE_VECTOR_MASK); 163 163 psVectorInit (mask, 0); 164 164 -
branches/eam_branch_20081230/psastro/src/psastroLuminosityFunction.c
r20805 r21087 91 91 psLogMsg ("psastro", 4, "fitting %d points to luminosity function\n", n); 92 92 93 psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_ MASK);93 psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_VECTOR_MASK); 94 94 psVectorInit (mask, 0); 95 95 … … 108 108 double mMaxValid = NAN; 109 109 for (int i = 0; i < Mag->n; i++) { 110 if (mask->data. U8[i]) continue;110 if (mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue; 111 111 if (isnan(mMinValid) || (Mag->data.F32[i] < mMinValid)) { 112 112 mMinValid = Mag->data.F32[i]; -
branches/eam_branch_20081230/psastro/src/psastroMaskUpdates.Mosaic.c
r20650 r21087 9 9 pmCell *pmCellInChip (pmChip *chip, float x, float y); 10 10 bool pmCellCoordsForChip (float *xCell, float *yCell, pmCell *cell, float xChip, float yChip); 11 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY);12 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta);13 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW);14 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);15 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1);11 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY); 12 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta); 13 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW); 14 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords); 15 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1); 16 16 17 17 // create a mask or mask regions based on the collection of reference stars that are … … 25 25 float zeropt, exptime; 26 26 27 ps MaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels28 ps MaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels27 psImageMaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels 28 psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels 29 29 30 30 // select the current recipe … … 342 342 343 343 // XXX should be doing an OR 344 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY) {344 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) { 345 345 346 346 // XXX need to worry about row0, col0 … … 357 357 if (r2 > 1.0) continue; 358 358 359 mask->data. U8[jy][jx] |= value;359 mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value; 360 360 } 361 361 } … … 364 364 365 365 // XXX should be doing an OR 366 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta) {366 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) { 367 367 368 368 // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta … … 379 379 380 380 // identify the quadrant and draw the correct line 381 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW) {381 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) { 382 382 383 383 int FlipDirect, FlipCoords; … … 408 408 // use the Bresenham line drawing technique 409 409 // integer-only Bresenham line-draw version which is fast 410 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {410 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) { 411 411 412 412 int X, Y, dX, dY; … … 425 425 if (y < 0) continue; 426 426 if (y >= mask->numCols) continue; 427 mask->data. U8[X][y] |= value;427 mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value; 428 428 } 429 429 } else { … … 432 432 if (y < 0) continue; 433 433 if (y >= mask->numRows) continue; 434 mask->data. U8[y][X] |= value;434 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value; 435 435 } 436 436 } … … 450 450 } 451 451 452 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1) {452 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) { 453 453 for (int iy = PS_MAX(0,y0); iy < PS_MIN(y1,mask->numRows); iy++) { 454 454 for (int ix = PS_MAX(0,x0); ix < PS_MIN(x1,mask->numCols); ix++) { 455 mask->data. U8[iy][ix] |= value;456 } 457 } 458 } 459 455 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value; 456 } 457 } 458 } 459 -
branches/eam_branch_20081230/psastro/src/psastroMaskUpdates.c
r21072 r21087 11 11 bool pmChipCoordsForCell (float *xChip, float *yChip, pmCell *cell, float xCell, float yCell); 12 12 13 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY);14 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta);15 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW);16 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);17 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1);13 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY); 14 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta); 15 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW); 16 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords); 17 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1); 18 18 19 19 // create a mask or mask regions based on the collection of reference stars that are … … 27 27 float zeropt, exptime; 28 28 29 ps MaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels30 31 // ps MaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels29 psImageMaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels 30 31 // psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels 32 32 33 33 // select the current recipe … … 376 376 377 377 // XXX should be doing an OR 378 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY) {378 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) { 379 379 380 380 // XXX need to worry about row0, col0 … … 391 391 if (r2 > 1.0) continue; 392 392 393 mask->data. U8[jy][jx] |= value;393 mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value; 394 394 } 395 395 } … … 398 398 399 399 // XXX should be doing an OR 400 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta) {400 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) { 401 401 402 402 // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta … … 413 413 414 414 // identify the quadrant and draw the correct line 415 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW) {415 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) { 416 416 417 417 int FlipDirect, FlipCoords; … … 442 442 // use the Bresenham line drawing technique 443 443 // integer-only Bresenham line-draw version which is fast 444 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {444 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) { 445 445 446 446 int X, Y, dX, dY; … … 459 459 if (y < 0) continue; 460 460 if (y >= mask->numCols) continue; 461 mask->data. U8[X][y] |= value;461 mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value; 462 462 } 463 463 } else { … … 466 466 if (y < 0) continue; 467 467 if (y >= mask->numRows) continue; 468 mask->data. U8[y][X] |= value;468 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value; 469 469 } 470 470 } … … 484 484 } 485 485 486 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1) {486 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) { 487 487 488 488 int xs = PS_MAX (0, PS_MIN (mask->numCols, PS_MIN (x0, x1))); … … 493 493 for (int iy = ys; iy < ye; iy++) { 494 494 for (int ix = xs; ix < xe; ix++) { 495 mask->data. U8[iy][ix] |= value;496 } 497 } 498 } 499 495 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value; 496 } 497 } 498 } 499 -
branches/eam_branch_20081230/psastro/src/psastroMosaicFPtoTP.c
r19314 r21087 74 74 75 75 // constant errors 76 psVector *mask = psVectorAlloc (X->n, PS_TYPE_ U8);76 psVector *mask = psVectorAlloc (X->n, PS_TYPE_VECTOR_MASK); 77 77 psVectorInit (mask, 0); 78 78 -
branches/eam_branch_20081230/psphot/src/psphot.h
r20938 r21087 18 18 pmPSF *psf; 19 19 psRegion *region; 20 ps MaskType maskVal;21 ps MaskType markVal;20 psImageMaskType maskVal; 21 psImageMaskType markVal; 22 22 } psphotGuessModelForRegionArgs; 23 23 … … 53 53 bool psphotGuessModelForRegion (psphotGuessModelForRegionArgs *args); 54 54 bool psphotBlendFit (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf); 55 bool psphotReplaceUnfitSources (psArray *sources, ps MaskType maskVal);55 bool psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal); 56 56 bool psphotReplaceAllSources (psArray *sources, psMetadata *recipe); 57 57 bool psphotRemoveAllSources (psArray *sources, psMetadata *recipe); … … 64 64 65 65 // used by psphotFindDetections 66 psImage *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, const int pass, ps MaskType maskVal);66 psImage *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, const int pass, psImageMaskType maskVal); 67 67 psArray *psphotFindPeaks (psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax); 68 bool psphotFindFootprints (pmDetections *detections, psImage *significance, pmReadout *readout, psMetadata *recipe, const int pass, ps MaskType maskVal);68 bool psphotFindFootprints (pmDetections *detections, psImage *significance, pmReadout *readout, psMetadata *recipe, const int pass, psImageMaskType maskVal); 69 69 psErrorCode psphotCullPeaks(const psImage *img, const psImage *weight, const psMetadata *recipe, psArray *footprints); 70 70 … … 75 75 // basic support functions 76 76 void psphotModelClassInit (void); 77 bool psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore, ps MaskType maskVal);77 bool psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore, psImageMaskType maskVal); 78 78 bool psphotSetMaskAndWeight (pmConfig *config, pmReadout *readout, psMetadata *recipe); 79 79 void psphotSourceFreePixels (psArray *sources); … … 81 81 // functions to set the correct source pixels 82 82 bool psphotInitRadiusPSF (const psMetadata *recipe, const pmModelType type); 83 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model, ps MaskType markVal);84 bool psphotCheckRadiusPSFBlend (pmReadout *readout, pmSource *source, pmModel *model, ps MaskType markVal, float dR);83 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model, psImageMaskType markVal); 84 bool psphotCheckRadiusPSFBlend (pmReadout *readout, pmSource *source, pmModel *model, psImageMaskType markVal, float dR); 85 85 bool psphotInitRadiusEXT (psMetadata *recipe, pmModelType type); 86 bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model, ps MaskType markVal);86 bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model, psImageMaskType markVal); 87 87 88 88 // output functions … … 103 103 bool psphotInitLimitsPSF (psMetadata *recipe, pmReadout *readout); 104 104 bool psphotInitLimitsEXT (psMetadata *recipe); 105 bool psphotFitBlend (pmReadout *readout, pmSource *source, pmPSF *psf, ps MaskType maskVal, psMaskType markVal);106 bool psphotFitBlob (pmReadout *readout, pmSource *source, psArray *sources, pmPSF *psf, ps MaskType maskVal, psMaskType markVal);107 bool psphotFitPSF (pmReadout *readout, pmSource *source, pmPSF *psf, ps MaskType maskVal, psMaskType markVal);108 pmModel *psphotFitEXT (pmReadout *readout, pmSource *source, pmModelType modelType, ps MaskType maskVal, psMaskType markVal);109 psArray *psphotFitDBL (pmReadout *readout, pmSource *source, ps MaskType maskVal, psMaskType markVal);105 bool psphotFitBlend (pmReadout *readout, pmSource *source, pmPSF *psf, psImageMaskType maskVal, psImageMaskType markVal); 106 bool psphotFitBlob (pmReadout *readout, pmSource *source, psArray *sources, pmPSF *psf, psImageMaskType maskVal, psImageMaskType markVal); 107 bool psphotFitPSF (pmReadout *readout, pmSource *source, pmPSF *psf, psImageMaskType maskVal, psImageMaskType markVal); 108 pmModel *psphotFitEXT (pmReadout *readout, pmSource *source, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal); 109 psArray *psphotFitDBL (pmReadout *readout, pmSource *source, psImageMaskType maskVal, psImageMaskType markVal); 110 110 111 111 // functions to support simultaneous multi-source fitting 112 bool psphotFitSet (pmSource *oneSrc, pmModel *oneModel, char *fitset, pmSourceFitMode mode, ps MaskType maskVal);112 bool psphotFitSet (pmSource *oneSrc, pmModel *oneModel, char *fitset, pmSourceFitMode mode, psImageMaskType maskVal); 113 113 114 114 // plotting functions (available if libkapa is installed) … … 131 131 bool psphotMosaicSubimage (psImage *outImage, pmSource *source, int Xo, int Yo, int DX, int DY, bool normalize); 132 132 133 bool psphotAddWithTest (pmSource *source, bool useState, ps MaskType maskVal);134 bool psphotSubWithTest (pmSource *source, bool useState, ps MaskType maskVal);135 bool psphotSetState (pmSource *source, bool curState, ps MaskType maskVal);133 bool psphotAddWithTest (pmSource *source, bool useState, psImageMaskType maskVal); 134 bool psphotSubWithTest (pmSource *source, bool useState, psImageMaskType maskVal); 135 bool psphotSetState (pmSource *source, bool curState, psImageMaskType maskVal); 136 136 bool psphotDeblendSatstars (psArray *sources, psMetadata *recipe); 137 137 bool psphotSourceSize (pmConfig *config, pmReadout *readout, psArray *sources, psMetadata *recipe, long first); 138 138 139 bool psphotMakeResiduals (psArray *sources, psMetadata *recipe, pmPSF *psf, ps MaskType maskVal);140 141 pmModel *psphotPSFConvModel (pmReadout *readout, pmSource *source, pmModelType modelType, ps MaskType maskVal, psMaskType markVal, int psfSize);139 bool psphotMakeResiduals (psArray *sources, psMetadata *recipe, pmPSF *psf, psImageMaskType maskVal); 140 141 pmModel *psphotPSFConvModel (pmReadout *readout, pmSource *source, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal, int psfSize); 142 142 143 143 psKernel *psphotKernelFromPSF (pmSource *source, int nPix); 144 144 145 bool psphotRadialProfile (pmSource *source, psMetadata *recipe, ps MaskType maskVal);146 bool psphotPetrosian (pmSource *source, psMetadata *recipe, ps MaskType maskVal);147 bool psphotIsophotal (pmSource *source, psMetadata *recipe, ps MaskType maskVal);148 bool psphotAnnuli (pmSource *source, psMetadata *recipe, ps MaskType maskVal);149 bool psphotKron (pmSource *source, psMetadata *recipe, ps MaskType maskVal);145 bool psphotRadialProfile (pmSource *source, psMetadata *recipe, psImageMaskType maskVal); 146 bool psphotPetrosian (pmSource *source, psMetadata *recipe, psImageMaskType maskVal); 147 bool psphotIsophotal (pmSource *source, psMetadata *recipe, psImageMaskType maskVal); 148 bool psphotAnnuli (pmSource *source, psMetadata *recipe, psImageMaskType maskVal); 149 bool psphotKron (pmSource *source, psMetadata *recipe, psImageMaskType maskVal); 150 150 151 151 // psphotVisual functions … … 162 162 bool psphotVisualShowSatStars (psMetadata *recipe, pmPSF *psf, psArray *sources); 163 163 bool psphotVisualShowPSFModel (pmReadout *readout, pmPSF *psf); 164 bool psphotVisualPlotRadialProfile (int myKapa, pmSource *source, ps MaskType maskVal);164 bool psphotVisualPlotRadialProfile (int myKapa, pmSource *source, psImageMaskType maskVal); 165 165 bool psphotVisualPlotRadialProfiles (psMetadata *recipe, psArray *sources); 166 166 bool psphotVisualShowFlags (psArray *sources); … … 217 217 bool psphotMakeFluxScale (psImage *image, psMetadata *recipe, pmPSF *psf); 218 218 bool psphotMakeGrowthCurve (pmReadout *readout, psMetadata *recipe, pmPSF *psf); 219 bool psphotDumpPSFStars (pmReadout *readout, pmPSFtry *try, float radius, ps MaskType maskVal, psMaskType markVal);219 bool psphotDumpPSFStars (pmReadout *readout, pmPSFtry *try, float radius, psImageMaskType maskVal, psImageMaskType markVal); 220 220 221 221 bool psphotCheckStarDistribution (psArray *sources, psArray *stars, pmPSFOptions *options); -
branches/eam_branch_20081230/psphot/src/psphotAddNoise.c
r21072 r21087 23 23 24 24 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 25 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels25 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 26 26 assert (maskVal); 27 27 -
branches/eam_branch_20081230/psphot/src/psphotAnnuli.c
r17396 r21087 1 1 # include "psphotInternal.h" 2 2 3 bool psphotAnnuli (pmSource *source, psMetadata *recipe, ps MaskType maskVal) {3 bool psphotAnnuli (pmSource *source, psMetadata *recipe, psImageMaskType maskVal) { 4 4 5 5 assert (source->extpars); -
branches/eam_branch_20081230/psphot/src/psphotApResid.c
r21072 r21087 33 33 34 34 // bit-masks to test for good/bad pixels 35 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");35 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 36 36 assert (maskVal); 37 37 38 38 // bit-mask to mark pixels not used in analysis 39 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");39 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 40 40 assert (markVal); 41 41 … … 70 70 pmSourceMagnitudesInit (recipe); 71 71 72 psVector *mask = psVectorAllocEmpty (300, PS_TYPE_ U8);72 psVector *mask = psVectorAllocEmpty (300, PS_TYPE_VECTOR_MASK); 73 73 psVector *mag = psVectorAllocEmpty (300, PS_TYPE_F32); 74 74 psVector *xPos = psVectorAllocEmpty (300, PS_TYPE_F32); … … 118 118 yPos->data.F32[Npsf] = model->params->data.F32[PM_PAR_YPOS]; 119 119 120 mask->data. U8[Npsf] = 0;120 mask->data.PS_TYPE_VECTOR_MASK_DATA[Npsf] = 0; 121 121 122 122 dMag->data.F32[Npsf] = model->dparams->data.F32[PM_PAR_I0] / model->params->data.F32[PM_PAR_I0]; … … 197 197 mag->data.F32[i], dMag->data.F32[i], dMagSys->data.F32[i], 198 198 apResid->data.F32[i], apResidRes->data.F32[i], 199 mask->data. U8[i]);199 mask->data.PS_TYPE_VECTOR_MASK_DATA[i]); 200 200 } 201 201 fclose (dumpFile); … … 263 263 psVector *dMSubset = psVectorAllocEmpty (nGroup, PS_TYPE_F32); 264 264 psVector *dASubset = psVectorAllocEmpty (nGroup, PS_TYPE_F32); 265 psVector *mkSubset = psVectorAllocEmpty (nGroup, PS_TYPE_ U8);265 psVector *mkSubset = psVectorAllocEmpty (nGroup, PS_TYPE_VECTOR_MASK); 266 266 267 267 int n = 0; … … 272 272 dMSubset->data.F32[j] = dMag->data.F32[N]; 273 273 dASubset->data.F32[j] = dap->data.F32[N]; 274 mkSubset->data. U8[j] = mask->data.U8[N];274 mkSubset->data.PS_TYPE_VECTOR_MASK_DATA[j] = mask->data.PS_TYPE_VECTOR_MASK_DATA[N]; 275 275 } 276 276 dMSubset->n = j; -
branches/eam_branch_20081230/psphot/src/psphotBlendFit.c
r20453 r21087 13 13 14 14 // bit-masks to test for good/bad pixels 15 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");15 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 16 16 assert (maskVal); 17 17 18 18 // bit-mask to mark pixels not used in analysis 19 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");19 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 20 20 assert (markVal); 21 21 -
branches/eam_branch_20081230/psphot/src/psphotChoosePSF.c
r20453 r21087 24 24 25 25 // bit-masks to test for good/bad pixels 26 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");26 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 27 27 assert (maskVal); 28 28 29 29 // bit-mask to mark pixels not used in analysis 30 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");30 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 31 31 assert (markVal); 32 32 … … 258 258 for (int i = 0; i < try->sources->n; i++) { 259 259 pmSource *source = try->sources->data[i]; 260 if (try->mask->data. U8[i]) {260 if (try->mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 261 261 source->mode &= ~PM_SOURCE_MODE_PSFSTAR; 262 262 } -
branches/eam_branch_20081230/psphot/src/psphotExtendedSourceAnalysis.c
r19881 r21087 12 12 13 13 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 14 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels14 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 15 15 assert (maskVal); 16 16 -
branches/eam_branch_20081230/psphot/src/psphotExtendedSourceFits.c
r19881 r21087 13 13 14 14 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 15 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels15 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 16 16 assert (maskVal); 17 17 18 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT"); // Mask value for bad pixels18 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); // Mask value for bad pixels 19 19 assert (markVal); 20 20 -
branches/eam_branch_20081230/psphot/src/psphotExtendedSources.c
r17111 r21087 12 12 13 13 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 14 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels14 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 15 15 assert (maskVal); 16 16 -
branches/eam_branch_20081230/psphot/src/psphotFindDetections.c
r20453 r21087 10 10 11 11 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 12 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels12 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 13 13 assert (maskVal); 14 14 -
branches/eam_branch_20081230/psphot/src/psphotFindFootprints.c
r21072 r21087 1 1 # include "psphotInternal.h" 2 2 3 bool psphotFindFootprints (pmDetections *detections, psImage *significance, pmReadout *readout, psMetadata *recipe, const int pass, ps MaskType maskVal) {3 bool psphotFindFootprints (pmDetections *detections, psImage *significance, pmReadout *readout, psMetadata *recipe, const int pass, psImageMaskType maskVal) { 4 4 5 5 bool status; -
branches/eam_branch_20081230/psphot/src/psphotFitSet.c
r14337 r21087 2 2 3 3 // This is only used by psphotModelTest.c 4 bool psphotFitSet (pmSource *source, pmModel *oneModel, char *fitset, pmSourceFitMode mode, ps MaskType maskVal) {4 bool psphotFitSet (pmSource *source, pmModel *oneModel, char *fitset, pmSourceFitMode mode, psImageMaskType maskVal) { 5 5 6 6 double x, y, Io; -
branches/eam_branch_20081230/psphot/src/psphotFitSourcesLinear.c
r20938 r21087 10 10 // the analysis is performed wrt the simulated pixel values 11 11 12 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, ps MaskType markVal);12 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psImageMaskType markVal); 13 13 14 14 bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, bool final) { … … 23 23 24 24 // bit-masks to test for good/bad pixels 25 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");25 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 26 26 assert (maskVal); 27 27 28 28 // bit-mask to mark pixels not used in analysis 29 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");29 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 30 30 assert (markVal); 31 31 … … 233 233 // on the pixels which correspond to all of the sources of interest. These elements fill in 234 234 // the border matrix components in the sparse matrix equation. 235 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, ps MaskType markVal) {235 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psImageMaskType markVal) { 236 236 237 237 // generate the image-wide weight terms … … 248 248 float x = model->params->data.F32[PM_PAR_XPOS]; 249 249 float y = model->params->data.F32[PM_PAR_YPOS]; 250 psImageMaskCircle (source->maskView, x, y, model->radiusFit, "AND", PS_NOT_ U8(markVal));250 psImageMaskCircle (source->maskView, x, y, model->radiusFit, "AND", PS_NOT_IMAGE_MASK(markVal)); 251 251 } 252 252 … … 254 254 psF32 **image = readout->image->data.F32; 255 255 psF32 **weight = readout->weight->data.F32; 256 ps U8 **mask = readout->mask->data.U8;256 psImageMaskType **mask = readout->mask->data.PS_TYPE_IMAGE_MASK_DATA; 257 257 258 258 double w, x, y, x2, xy, y2, xc, yc, wt, f, fo, fx, fy; … … 288 288 289 289 // turn off MARK for all image pixels 290 psImageMaskRegion (readout->mask, fullArray, "AND", PS_NOT_ U8(markVal));290 psImageMaskRegion (readout->mask, fullArray, "AND", PS_NOT_IMAGE_MASK(markVal)); 291 291 292 292 // set the Border T elements -
branches/eam_branch_20081230/psphot/src/psphotGuessModels.c
r20453 r21087 40 40 41 41 // bit-masks to test for good/bad pixels 42 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");42 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 43 43 assert (maskVal); 44 44 45 45 // bit-mask to mark pixels not used in analysis 46 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");46 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 47 47 assert (markVal); 48 48 … … 177 177 pmPSF *psf = args->psf; 178 178 psRegion *region = args->region; 179 ps MaskType maskVal = args->maskVal;180 ps MaskType markVal = args->markVal;179 psImageMaskType maskVal = args->maskVal; 180 psImageMaskType markVal = args->markVal; 181 181 182 182 int nSrc = 0; -
branches/eam_branch_20081230/psphot/src/psphotIsophotal.c
r17561 r21087 1 1 # include "psphotInternal.h" 2 2 3 bool psphotIsophotal (pmSource *source, psMetadata *recipe, ps MaskType maskVal) {3 bool psphotIsophotal (pmSource *source, psMetadata *recipe, psImageMaskType maskVal) { 4 4 5 5 assert (source->extpars); -
branches/eam_branch_20081230/psphot/src/psphotKron.c
r17396 r21087 1 1 # include "psphotInternal.h" 2 2 3 bool psphotKron (pmSource *source, psMetadata *recipe, ps MaskType maskVal) {3 bool psphotKron (pmSource *source, psMetadata *recipe, psImageMaskType maskVal) { 4 4 5 5 psLogMsg ("psphot", PS_LOG_INFO, "not implemented\n"); -
branches/eam_branch_20081230/psphot/src/psphotMagnitudes.c
r20453 r21087 17 17 18 18 // bit-masks to test for good/bad pixels 19 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");19 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 20 20 assert (maskVal); 21 21 22 22 // bit-mask to mark pixels not used in analysis 23 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");23 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 24 24 assert (markVal); 25 25 -
branches/eam_branch_20081230/psphot/src/psphotMakeGrowthCurve.c
r20453 r21087 11 11 12 12 // bit-masks to test for good/bad pixels 13 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");13 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 14 14 assert (maskVal); 15 15 16 16 // bit-mask to mark pixels not used in analysis 17 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");17 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 18 18 assert (markVal); 19 19 -
branches/eam_branch_20081230/psphot/src/psphotMakeResiduals.c
r20453 r21087 1 1 # include "psphotInternal.h" 2 2 3 bool psphotMakeResiduals (psArray *sources, psMetadata *recipe, pmPSF *psf, psMaskType maskVal) { 3 XXX this function is probably broken: fmasks is confused between Image and Vector. it is used by psVectorStats, so it must be Vector, but 4 is populated by mflux, which seems to be Image.. 5 bool psphotMakeResiduals (psArray *sources, psMetadata *recipe, pmPSF *psf, psImageMaskType maskVal) { 4 6 5 7 bool status, isPSF; 6 8 double flux, dflux; 7 ps U8mflux;9 psImageMaskType mflux; 8 10 9 11 psTimerStart ("psphot.residuals"); … … 69 71 // - set output pixel, weight, and mask 70 72 71 // XXX need to set these correctly!!73 XXX need to set these correctly based on the RECIPE values 72 74 const int badMask = 1; // mask bits 73 75 const int poorMask = 2; // from psImageInterpolate … … 95 97 psImage *image = psImageCopy (NULL, source->pixels, PS_TYPE_F32); 96 98 psImage *weight = psImageCopy (NULL, source->weight, PS_TYPE_F32); 97 psImage *mask = psImageCopy (NULL, source->maskView, PS_TYPE_ U8);99 psImage *mask = psImageCopy (NULL, source->maskView, PS_TYPE_IMAGE_MASK); 98 100 pmModelSub (image, mask, model, PM_MODEL_OP_FUNC, maskVal); 99 101 … … 131 133 psVector *fluxes = psVectorAlloc (input->n, PS_TYPE_F32); 132 134 psVector *dfluxes = psVectorAlloc (input->n, PS_TYPE_F32); 133 psVector *fmasks = psVectorAlloc (input->n, PS_TYPE_ U8);135 psVector *fmasks = psVectorAlloc (input->n, PS_TYPE_VECTOR_MASK); 134 136 135 137 // statistic to use to determine baseline for clipping … … 166 168 // This pixel is off the image 167 169 offImage = true; 168 fmasks->data. U8[i] = 1;170 fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 169 171 // fprintf (stderr, "off image: %f %f : %f %f\n", ix, iy, flux, dflux); 170 172 } 171 173 fluxes->data.F32[i] = flux; 172 174 dfluxes->data.F32[i] = dflux; 173 fmasks->data. U8[i] = mflux;175 fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = mflux; // XXX is mflux IMAGE or VECTOR type? 174 176 if (isnan(flux)) { 175 fmasks->data. U8[i] = 1;176 } 177 if (fmasks->data. U8[i] == 0) {177 fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 178 } 179 if (fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) { 178 180 nGoodPixel ++; 179 181 } … … 186 188 resid->Rx->data.F32[oy][ox] = 0.0; 187 189 resid->Ry->data.F32[oy][ox] = 0.0; 188 resid->mask->data. U8[oy][ox] = 1;190 resid->mask->data.PS_TYPE_IMAGE_MASK_DATA[oy][ox] = 1; 189 191 continue; 190 192 } … … 204 206 // make this a user option 205 207 if (swing > nSigma) { 206 fmasks->data. U8[i] = clippedMask;207 } 208 if (!fmasks->data. U8[i]) nKeep++;208 fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = clippedMask; 209 } 210 if (!fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i]) nKeep++; 209 211 } 210 212 … … 220 222 221 223 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*fluxStats->sampleStdev/sqrt(nKeep)) { 222 resid->mask->data. U8[oy][ox] = 1;223 } 224 225 // fprintf (stderr, "res: %2d %2d : %6.4f %6.4f %6.4f %3d %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], fluxStats->sampleStdev, fluxStats->sampleStdev/sqrt(nKeep), nKeep, resid->mask->data. U8[oy][ox]);224 resid->mask->data.PS_TYPE_IMAGE_MASK_DATA[oy][ox] = 1; 225 } 226 227 // fprintf (stderr, "res: %2d %2d : %6.4f %6.4f %6.4f %3d %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], fluxStats->sampleStdev, fluxStats->sampleStdev/sqrt(nKeep), nKeep, resid->mask->data.PS_TYPE_IMAGE_MASK_DATA[oy][ox]); 226 228 227 229 } else { … … 230 232 psVectorInit(B, 0.0); 231 233 for (int i = 0; i < fluxes->n; i++) { 232 if (fmasks->data. U8[i]) continue;234 if (fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue; 233 235 B->data.F64[0] += fluxes->data.F32[i]/dfluxes->data.F32[i]; 234 236 B->data.F64[1] += fluxes->data.F32[i]*xC->data.F32[i]/dfluxes->data.F32[i]; … … 260 262 261 263 float dRo = sqrt(A->data.F32[0][0]); 262 // fprintf (stderr, "res: %2d %2d : %6.4f %6.4f %6.4f %3d %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], dRo, dRo/sqrt(nKeep), nKeep, resid->mask->data. U8[oy][ox]);264 // fprintf (stderr, "res: %2d %2d : %6.4f %6.4f %6.4f %3d %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], dRo, dRo/sqrt(nKeep), nKeep, resid->mask->data.PS_TYPE_IMAGE_MASK_DATA[oy][ox]); 263 265 264 266 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*dRo/sqrt(nKeep)) { 265 resid->mask->data. U8[oy][ox] = 1;267 resid->mask->data.PS_TYPE_IMAGE_MASK_DATA[oy][ox] = 1; 266 268 } 267 269 //resid->weight->data.F32[oy][ox] = XXX; -
branches/eam_branch_20081230/psphot/src/psphotMaskReadout.c
r18832 r21087 9 9 // XXX drop the write to recipe and move config into psphotRoughClass? 10 10 // XXX alternatively, define a function to set the psphot recipe masks 11 ps MaskType maskSat = pmConfigMaskGet("SAT", config); // Mask value for saturated pixels12 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MASK.SAT", PS_META_REPLACE, "user-defined mask", maskSat);11 psImageMaskType maskSat = pmConfigMaskGet("SAT", config); // Mask value for saturated pixels 12 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MASK.SAT", PS_META_REPLACE, "user-defined mask", maskSat); 13 13 14 ps MaskType maskBad = pmConfigMaskGet("BAD", config); // Mask value for bad pixels15 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MASK.BAD", PS_META_REPLACE, "user-defined mask", maskBad);14 psImageMaskType maskBad = pmConfigMaskGet("BAD", config); // Mask value for bad pixels 15 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MASK.BAD", PS_META_REPLACE, "user-defined mask", maskBad); 16 16 17 17 // generate mask & weight images if they don't already exit -
branches/eam_branch_20081230/psphot/src/psphotModelBackground.c
r21072 r21087 23 23 24 24 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 25 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels25 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 26 26 assert (maskVal); 27 27 -
branches/eam_branch_20081230/psphot/src/psphotModelTest.c
r19881 r21087 13 13 14 14 // bit-masks to test for good/bad pixels 15 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");15 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 16 16 assert (maskVal); 17 17 18 18 // bit-mask to mark pixels not used in analysis 19 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");19 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 20 20 assert (markVal); 21 21 -
branches/eam_branch_20081230/psphot/src/psphotModelWithPSF.c
r17396 r21087 20 20 paramMask = constraint->paramMask; 21 21 if (paramMask != NULL) { 22 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_U8, false);22 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_VECTOR_TYPE, false); 23 23 PS_ASSERT_VECTORS_SIZE_EQUAL(params, paramMask, false); 24 24 } … … 145 145 psImageInit (covar, 0.0); 146 146 for (int j = 0, J = 0; j < params->n; j++) { 147 if (paramMask && (paramMask->data. U8[j])) {147 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) { 148 148 covar->data.F32[j][j] = 1.0; 149 149 continue; 150 150 } 151 151 for (int k = 0, K = 0; k < params->n; k++) { 152 if (paramMask && (paramMask->data. U8[k])) continue;152 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[k])) continue; 153 153 covar->data.F32[j][k] = Alpha->data.F32[J][K]; 154 154 K++; … … 197 197 PS_ASSERT_VECTOR_TYPE(params, PS_TYPE_F32, false); 198 198 if (paramMask) { 199 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_ MASK, false);199 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_VECTOR_MASK, false); 200 200 } 201 201 … … 224 224 // XXX probably should not skipped masked points: 225 225 // XXX skip if convolution of unmasked pixels will not see this pixel 226 // if (source->maskObj->data. U8[i][j]) {226 // if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j]) { 227 227 // continue; 228 228 // } … … 246 246 247 247 for (int n = 0; n < params->n; n++) { 248 if ((paramMask != NULL) && (paramMask->data. U8[n])) { continue; }248 if ((paramMask != NULL) && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n])) { continue; } 249 249 psImage *dmodel = pcm->dmodels->data[n]; 250 250 dmodel->data.F32[i][j] = deriv->data.F32[n]; … … 285 285 // XXX are we doing the right thing with the mask? 286 286 // skip masked points 287 if (source->maskObj->data. U8[i][j]) {287 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j]) { 288 288 continue; 289 289 } … … 308 308 // alpha & beta only contain unmasked elements 309 309 for (int n1 = 0, N1 = 0; n1 < params->n; n1++) { 310 if ((paramMask != NULL) && (paramMask->data. U8[n1])) continue;310 if ((paramMask != NULL) && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n1])) continue; 311 311 psImage *dmodel = pcm->dmodelsConv->data[n1]; 312 312 float weight = dmodel->data.F32[i][j] * yweight; 313 313 for (int n2 = 0, N2 = 0; n2 <= n1; n2++) { 314 if ((paramMask != NULL) && (paramMask->data. U8[n2])) continue;314 if ((paramMask != NULL) && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n2])) continue; 315 315 dmodel = pcm->dmodelsConv->data[n2]; 316 316 alpha->data.F32[N1][N2] += weight * dmodel->data.F32[i][j]; … … 357 357 for (psS32 n = 0; n < params->n; n++) { 358 358 pcm->dmodels->data[n] = NULL; 359 if ((paramMask != NULL) && (paramMask->data. U8[n])) { continue; }359 if ((paramMask != NULL) && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n])) { continue; } 360 360 pcm->dmodels->data[n] = psImageCopy (NULL, source->pixels, PS_TYPE_F32); 361 361 } … … 366 366 for (psS32 n = 0; n < params->n; n++) { 367 367 pcm->dmodelsConv->data[n] = NULL; 368 if ((paramMask != NULL) && (paramMask->data. U8[n])) { continue; }368 if ((paramMask != NULL) && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n])) { continue; } 369 369 pcm->dmodelsConv->data[n] = psImageCopy (NULL, source->pixels, PS_TYPE_F32); 370 370 } -
branches/eam_branch_20081230/psphot/src/psphotMosaicChip.c
r18712 r21087 25 25 } 26 26 27 ps MaskType blankMask = pmConfigMaskGet("BLANK", config);27 psImageMaskType blankMask = pmConfigMaskGet("BLANK", config); 28 28 29 29 // mosaic the chip, forcing a deep copy (resulting images are not subimages) -
branches/eam_branch_20081230/psphot/src/psphotOutput.c
r20237 r21087 74 74 for (int j = 0; j < source->pixels->numCols; j++) { 75 75 // skip masked points 76 if (source->maskObj->data. U8[i][j]) {76 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j]) { 77 77 continue; 78 78 } … … 87 87 source->pixels->data.F32[i][j], 88 88 1.0 / source->weight->data.F32[i][j], 89 source->maskObj->data. U8[i][j]);89 source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j]); 90 90 } 91 91 } … … 237 237 238 238 // XXX add args as needed 239 bool psphotDumpPSFStars (pmReadout *readout, pmPSFtry *try, float radius, ps MaskType maskVal, psMaskType markVal) {239 bool psphotDumpPSFStars (pmReadout *readout, pmPSFtry *try, float radius, psImageMaskType maskVal, psImageMaskType markVal) { 240 240 241 241 psphotSaveImage (NULL, readout->image, "rawstars.fits"); … … 243 243 for (int i = 0; i < try->sources->n; i++) { 244 244 // masked for: bad model fit, outlier in parameters 245 if (try->mask->data. U8[i] & PSFTRY_MASK_ALL)245 if (try->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) 246 246 continue; 247 247 … … 256 256 psImageKeepCircle (source->maskObj, x, y, radius, "OR", markVal); 257 257 pmModelSub (source->pixels, source->maskObj, source->modelPSF, PM_MODEL_OP_FULL, maskVal); 258 psImageKeepCircle (source->maskObj, x, y, radius, "AND", PS_NOT_ U8(markVal));258 psImageKeepCircle (source->maskObj, x, y, radius, "AND", PS_NOT_IMAGE_MASK(markVal)); 259 259 } 260 260 … … 264 264 265 265 // masked for: bad model fit, outlier in parameters 266 if (try->mask->data. U8[i] & PSFTRY_MASK_ALL) continue;266 if (try->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) continue; 267 267 268 268 pmSource *source = try->sources->data[i]; -
branches/eam_branch_20081230/psphot/src/psphotPSFConvModel.c
r21072 r21087 9 9 // modelConv to contain the fitted parameters, and the modelFlux to contain the 10 10 // convolved model image. 11 pmModel *psphotPSFConvModel (pmReadout *readout, pmSource *source, pmModelType modelType, ps MaskType maskVal, psMaskType markVal, int psfSize) {11 pmModel *psphotPSFConvModel (pmReadout *readout, pmSource *source, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal, int psfSize) { 12 12 13 13 // maskVal is used to test for rejected pixels, and must include markVal … … 72 72 // create the minimization constraints 73 73 psMinConstraint *constraint = psMinConstraintAlloc(); 74 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_ U8);74 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK); 75 75 constraint->checkLimits = modelConv->modelLimits; 76 76 … … 79 79 int nParams = params->n - 1; 80 80 psVectorInit (constraint->paramMask, 0); 81 constraint->paramMask->data. U8[PM_PAR_SKY] = 1;81 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_SKY] = 1; 82 82 83 83 // force the floating parameters to fall within the contraint ranges … … 97 97 fprintf (stderr, "%f ", params->data.F32[i]); 98 98 } 99 if ((constraint->paramMask != NULL) && constraint->paramMask->data. U8[i])99 if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 100 100 continue; 101 101 dparams->data.F32[i] = sqrt(covar->data.F32[i][i]); -
branches/eam_branch_20081230/psphot/src/psphotPetrosian.c
r17561 r21087 1 1 # include "psphotInternal.h" 2 2 3 bool psphotPetrosian (pmSource *source, psMetadata *recipe, ps MaskType maskVal) {3 bool psphotPetrosian (pmSource *source, psMetadata *recipe, psImageMaskType maskVal) { 4 4 5 5 bool status; -
branches/eam_branch_20081230/psphot/src/psphotRadialPlot.c
r15017 r21087 60 60 for (int iy = 0; iy < source->pixels->numRows; iy++) { 61 61 for (int ix = 0; ix < source->pixels->numCols; ix++) { 62 if (source->maskObj->data. U8[iy][ix]) {62 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix]) { 63 63 rb->data.F32[nb] = hypot (ix - Xo, iy - Yo) ; 64 64 fb->data.F32[nb] = log10(source->pixels->data.F32[iy][ix]); -
branches/eam_branch_20081230/psphot/src/psphotRadialProfile.c
r17396 r21087 17 17 } 18 18 19 bool psphotRadialProfile (pmSource *source, psMetadata *recipe, ps MaskType maskVal) {19 bool psphotRadialProfile (pmSource *source, psMetadata *recipe, psImageMaskType maskVal) { 20 20 21 21 // allocate pmSourceExtendedParameters, if not already defined … … 54 54 for (int iy = 0; iy < source->pixels->numRows; iy++) { 55 55 for (int ix = 0; ix < source->pixels->numCols; ix++) { 56 if (source->maskObj->data. U8[iy][ix]) continue;56 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix]) continue; 57 57 radius->data.F32[n] = hypot (ix - Xo, iy - Yo) ; 58 58 flux->data.F32[n] = source->pixels->data.F32[iy][ix]; -
branches/eam_branch_20081230/psphot/src/psphotRadiusChecks.c
r21072 r21087 19 19 20 20 // call this function whenever you (re)-define the PSF model 21 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model, ps MaskType markVal)21 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model, psImageMaskType markVal) 22 22 { 23 23 psF32 *PAR = model->params->data.F32; … … 50 50 } 51 51 52 bool psphotCheckRadiusPSFBlend (pmReadout *readout, pmSource *source, pmModel *model, ps MaskType markVal, float dR) {52 bool psphotCheckRadiusPSFBlend (pmReadout *readout, pmSource *source, pmModel *model, psImageMaskType markVal, float dR) { 53 53 54 54 psF32 *PAR = model->params->data.F32; … … 86 86 87 87 // call this function whenever you (re)-define the EXT model 88 bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model, ps MaskType markVal) {88 bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model, psImageMaskType markVal) { 89 89 90 90 psF32 *PAR = model->params->data.F32; -
branches/eam_branch_20081230/psphot/src/psphotReplaceUnfit.c
r20453 r21087 2 2 3 3 // replace the flux for sources which failed 4 bool psphotReplaceUnfitSources (psArray *sources, ps MaskType maskVal) {4 bool psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal) { 5 5 6 6 pmSource *source; … … 31 31 32 32 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 33 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels33 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 34 34 assert (maskVal); 35 35 … … 55 55 56 56 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 57 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels57 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 58 58 assert (maskVal); 59 59 … … 72 72 73 73 // add source, if the source has been subtracted; do not modify state 74 bool psphotAddWithTest (pmSource *source, bool useState, ps MaskType maskVal) {74 bool psphotAddWithTest (pmSource *source, bool useState, psImageMaskType maskVal) { 75 75 76 76 // what is current state? (true : add; false : sub) … … 83 83 84 84 // sub source, if the source has been added; do not modify state 85 bool psphotSubWithTest (pmSource *source, bool useState, ps MaskType maskVal) {85 bool psphotSubWithTest (pmSource *source, bool useState, psImageMaskType maskVal) { 86 86 87 87 // what is current state? (true : sub; false : add) … … 94 94 95 95 // add or sub source to match recorded state: supply current state as true (add) or false (sub) 96 bool psphotSetState (pmSource *source, bool curState, ps MaskType maskVal) {96 bool psphotSetState (pmSource *source, bool curState, psImageMaskType maskVal) { 97 97 98 98 // what is desired state? (true : add; false : sub) -
branches/eam_branch_20081230/psphot/src/psphotRoughClass.c
r20453 r21087 57 57 58 58 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 59 ps MaskType maskSat = psMetadataLookupU8(&status, recipe, "MASK.SAT"); // Mask value for bad pixels59 psImageMaskType maskSat = psMetadataLookupImageMask(&status, recipe, "MASK.SAT"); // Mask value for bad pixels 60 60 assert (maskSat); 61 61 -
branches/eam_branch_20081230/psphot/src/psphotSetMaskBits.c
r21072 r21087 10 10 bool psphotSetMaskBits (pmConfig *config) { 11 11 12 ps MaskType maskValue;13 ps MaskType markValue;12 psImageMaskType maskValue; 13 psImageMaskType markValue; 14 14 15 15 if (!pmConfigMaskSetBits (&maskValue, &markValue, config)) { … … 26 26 27 27 // set maskValue and markValue in the psphot recipe 28 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "user-defined mask", markValue);29 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "user-defined mask", maskValue);28 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "user-defined mask", markValue); 29 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "user-defined mask", maskValue); 30 30 31 31 return true; -
branches/eam_branch_20081230/psphot/src/psphotSignificanceImage.c
r21072 r21087 4 4 // (S/N)^2. If FWMH_X,Y have been recorded, use them, otherwise use PEAKS_SMOOTH_SIGMA for the 5 5 // smoothing kernel. 6 psImage *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, const int pass, ps MaskType maskVal) {6 psImage *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, const int pass, psImageMaskType maskVal) { 7 7 8 8 float SIGMA_SMTH, NSIGMA_SMTH; … … 110 110 for (int i = 0; i < smooth_im->numCols; i++) { 111 111 float value = smooth_im->data.F32[j][i]; 112 if (value < 0 || smooth_wt->data.F32[j][i] <= 0 || (mask->data. U8[j][i] & maskVal)) {112 if (value < 0 || smooth_wt->data.F32[j][i] <= 0 || (mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & maskVal)) { 113 113 smooth_im->data.F32[j][i] = 0.0; 114 114 } else { -
branches/eam_branch_20081230/psphot/src/psphotSkyReplace.c
r20453 r21087 17 17 // select the corresponding images 18 18 psF32 **image = readout->image->data.F32; 19 ps U8 **mask = readout->mask->data.U8;19 psImageMaskType **mask = readout->mask->data.PS_TYPE_IMAGE_MASK_DATA; 20 20 psF32 **back = background->image->data.F32; 21 21 -
branches/eam_branch_20081230/psphot/src/psphotSourceFits.c
r19881 r21087 21 21 } 22 22 23 bool psphotFitBlend (pmReadout *readout, pmSource *source, pmPSF *psf, ps MaskType maskVal, psMaskType markVal) {23 bool psphotFitBlend (pmReadout *readout, pmSource *source, pmPSF *psf, psImageMaskType maskVal, psImageMaskType markVal) { 24 24 25 25 float x, y, dR; … … 146 146 } 147 147 148 bool psphotFitPSF (pmReadout *readout, pmSource *source, pmPSF *psf, ps MaskType maskVal, psMaskType markVal) {148 bool psphotFitPSF (pmReadout *readout, pmSource *source, pmPSF *psf, psImageMaskType maskVal, psImageMaskType markVal) { 149 149 150 150 double chiTrend; … … 207 207 } 208 208 209 bool psphotFitBlob (pmReadout *readout, pmSource *source, psArray *sources, pmPSF *psf, ps MaskType maskVal, psMaskType markVal) {209 bool psphotFitBlob (pmReadout *readout, pmSource *source, psArray *sources, pmPSF *psf, psImageMaskType maskVal, psImageMaskType markVal) { 210 210 211 211 bool okEXT, okDBL; … … 317 317 318 318 // fit a double PSF source to an extended blob 319 psArray *psphotFitDBL (pmReadout *readout, pmSource *source, ps MaskType maskVal, psMaskType markVal) {319 psArray *psphotFitDBL (pmReadout *readout, pmSource *source, psImageMaskType maskVal, psImageMaskType markVal) { 320 320 321 321 float dx, dy; … … 369 369 } 370 370 371 pmModel *psphotFitEXT (pmReadout *readout, pmSource *source, pmModelType modelType, ps MaskType maskVal, psMaskType markVal) {371 pmModel *psphotFitEXT (pmReadout *readout, pmSource *source, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal) { 372 372 373 373 NfitEXT ++; -
branches/eam_branch_20081230/psphot/src/psphotSourcePlots.c
r19869 r21087 7 7 8 8 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 9 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels9 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 10 10 assert (maskVal); 11 11 -
branches/eam_branch_20081230/psphot/src/psphotSourceSize.c
r20938 r21087 3 3 4 4 static float psphotModelContour(const psImage *image, const psImage *weight, const psImage *mask, 5 ps MaskType maskVal, const pmModel *model, float Ro);6 7 bool psphotMaskCosmicRay_Old (pmSource *source, ps MaskType maskVal, psMaskType crMask);8 bool psphotMaskCosmicRay_New (psImage *mask, pmSource *source, ps MaskType maskVal, psMaskType crMask);5 psImageMaskType maskVal, const pmModel *model, float Ro); 6 7 bool psphotMaskCosmicRay_Old (pmSource *source, psImageMaskType maskVal, psImageMaskType crMask); 8 bool psphotMaskCosmicRay_New (psImage *mask, pmSource *source, psImageMaskType maskVal, psImageMaskType crMask); 9 9 10 10 // we need to call this function after sources have been fitted to the PSF model and … … 21 21 22 22 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 23 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels23 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 24 24 assert (maskVal); 25 25 26 26 // bit to mask the cosmic-ray pixels 27 ps MaskType crMask = pmConfigMaskGet("CR", config); // Mask value for cosmic rays27 psImageMaskType crMask = pmConfigMaskGet("CR", config); // Mask value for cosmic rays 28 28 29 29 float CR_NSIGMA_LIMIT = psMetadataLookupF32 (&status, recipe, "PSPHOT.CR.NSIGMA.LIMIT"); … … 63 63 psF32 **resid = source->pixels->data.F32; 64 64 psF32 **weight = source->weight->data.F32; 65 ps U8 **mask = source->maskObj->data.U8;65 psImageMaskType **mask = source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA; 66 66 67 67 // check for extendedness: measure the delta flux significance at the 1 sigma contour … … 191 191 // deviations? 192 192 static float psphotModelContour(const psImage *image, const psImage *weight, const psImage *mask, 193 ps MaskType maskVal, const pmModel *model, float Ro)193 psImageMaskType maskVal, const pmModel *model, float Ro) 194 194 { 195 195 psF32 *PAR = model->params->data.F32; // Model parameters … … 260 260 } 261 261 262 bool psphotMaskCosmicRay_New (psImage *mask, pmSource *source, ps MaskType maskVal, psMaskType crMask) {262 bool psphotMaskCosmicRay_New (psImage *mask, pmSource *source, psImageMaskType maskVal, psImageMaskType crMask) { 263 263 264 264 // replace the source flux … … 294 294 295 295 for (int ix = xs; ix < xe; ix++) { 296 mask->data. U8[iy][ix] |= crMask;296 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= crMask; 297 297 } 298 298 } … … 300 300 } 301 301 302 bool psphotMaskCosmicRay_Old (pmSource *source, ps MaskType maskVal, psMaskType crMask) {302 bool psphotMaskCosmicRay_Old (pmSource *source, psImageMaskType maskVal, psImageMaskType crMask) { 303 303 304 304 source->mode |= PM_SOURCE_MODE_CR_LIMIT; … … 320 320 float SN = pixels->data.F32[yo][ix] / sqrt(weight->data.F32[yo][ix]); 321 321 if (SN > SN_LIMIT) { 322 mask->data. U8[yo][ix] |= crMask;322 mask->data.PS_TYPE_IMAGE_MASK_DATA[yo][ix] |= crMask; 323 323 } 324 324 } … … 326 326 float SN = pixels->data.F32[yo][ix] / sqrt(weight->data.F32[yo][ix]); 327 327 if (SN > SN_LIMIT) { 328 mask->data. U8[yo][ix] |= crMask;328 mask->data.PS_TYPE_IMAGE_MASK_DATA[yo][ix] |= crMask; 329 329 } 330 330 } … … 339 339 340 340 bool valid = false; 341 valid |= (mask->data. U8[iy+1][ix] & crMask);342 valid |= (ix > 0) ? (mask->data. U8[iy+1][ix-1] & crMask) : 0;343 valid |= (ix <= mask->numCols) ? (mask->data. U8[iy+1][ix+1] & crMask) : 0;341 valid |= (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+1][ix] & crMask); 342 valid |= (ix > 0) ? (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+1][ix-1] & crMask) : 0; 343 valid |= (ix <= mask->numCols) ? (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy+1][ix+1] & crMask) : 0; 344 344 345 345 if (!valid) continue; 346 mask->data. U8[iy][ix] |= crMask;346 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= crMask; 347 347 } 348 348 } … … 355 355 356 356 bool valid = false; 357 valid |= (mask->data. U8[iy-1][ix] & crMask);358 valid |= (ix > 0) ? (mask->data. U8[iy-1][ix-1] & crMask) : 0;359 valid |= (ix <= mask->numCols) ? (mask->data. U8[iy-1][ix+1] & crMask) : 0;357 valid |= (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy-1][ix] & crMask); 358 valid |= (ix > 0) ? (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy-1][ix-1] & crMask) : 0; 359 valid |= (ix <= mask->numCols) ? (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy-1][ix+1] & crMask) : 0; 360 360 361 361 if (!valid) continue; 362 mask->data. U8[iy][ix] |= crMask;362 mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= crMask; 363 363 } 364 364 } -
branches/eam_branch_20081230/psphot/src/psphotSourceStats.c
r20453 r21087 10 10 11 11 // bit-masks to test for good/bad pixels 12 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");12 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); 13 13 assert (maskVal); 14 14 15 15 // bit-mask to mark pixels not used in analysis 16 ps MaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");16 psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); 17 17 assert (markVal); 18 18 -
branches/eam_branch_20081230/psphot/src/psphotSubtractBackground.c
r20453 r21087 28 28 29 29 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 30 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels30 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 31 31 assert (maskVal); 32 32 -
branches/eam_branch_20081230/psphot/src/psphotTestPSF.c
r21072 r21087 111 111 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", markVal); 112 112 status = pmSourceFitModel (source, model, PM_SOURCE_FIT_EXT); 113 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", PS_NOT_ U8(markVal));113 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", PS_NOT_IMAGE_MASK(markVal)); 114 114 115 115 // write fitted parameters to file -
branches/eam_branch_20081230/psphot/src/psphotTestSourceOutput.c
r14655 r21087 80 80 float oy = yBin*(iy + 0.5 + image->row0 - yCenter) + yResidCenter; 81 81 82 ps U8mflux = 0;82 psImageMaskType mflux = 0; 83 83 double Fo = 0.0; 84 84 double Fx = 0.0; -
branches/eam_branch_20081230/psphot/src/psphotVisual.c
r20938 r21087 51 51 ALLOCATE (image.data2d[iy], float, image.Nx); 52 52 for (int ix = 0; ix < image.Nx; ix++) { 53 image.data2d[iy][ix] = inImage->data. U8[iy][ix];53 image.data2d[iy][ix] = inImage->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix]; 54 54 } 55 55 } … … 813 813 814 814 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 815 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels815 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 816 816 assert (maskVal); 817 817 … … 973 973 974 974 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 975 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels975 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 976 976 assert (maskVal); 977 977 … … 1097 1097 } 1098 1098 1099 bool psphotVisualPlotRadialProfile (int myKapa, pmSource *source, ps MaskType maskVal) {1099 bool psphotVisualPlotRadialProfile (int myKapa, pmSource *source, psImageMaskType maskVal) { 1100 1100 1101 1101 Graphdata graphdata; … … 1118 1118 for (int iy = 0; iy < source->pixels->numRows; iy++) { 1119 1119 for (int ix = 0; ix < source->pixels->numCols; ix++) { 1120 if (source->maskObj->data. U8[iy][ix]) {1120 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix]) { 1121 1121 // rb->data.F32[nb] = hypot (ix + 0.5 - Xo, iy + 0.5 - Yo) ; 1122 1122 rb->data.F32[nb] = hypot (ix - Xo, iy - Yo) ; … … 1227 1227 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 1228 1228 bool status; 1229 ps MaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels1229 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 1230 1230 assert (maskVal); 1231 1231
Note:
See TracChangeset
for help on using the changeset viewer.
