Changeset 41382 for trunk/ppImage/src
- Timestamp:
- Jun 23, 2020, 3:29:09 PM (6 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 3 edited
-
ppImage.h (modified) (1 diff)
-
ppImageOptions.c (modified) (3 diffs)
-
ppImageReplaceBackground.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImage.h
r40453 r41382 28 28 bool doVarianceBuild; // Build internal variance map 29 29 bool doApplyBurntool; // apply burntool correction 30 bool doApplyPixelZero; // put to zero pixels underneath mask 30 31 bool doMaskBurntool; // mask potential burntool trails 31 32 bool doMaskSat; // mask saturated pixels -
trunk/ppImage/src/ppImageOptions.c
r38233 r41382 53 53 options->useVideoDark = false; // Use video dark if we can? 54 54 options->useVideoMask = false; // Use video mask if we can? 55 options->doApplyPixelZero = true; // option for zero'ing pixels under masks 56 55 57 // output files requested 56 58 options->BaseFITS = false; // create output image … … 234 236 options->doMaskBurntool = psMetadataLookupBool(NULL, recipe, "MASK.BURNTOOL"); 235 237 options->doApplyBurntool = psMetadataLookupBool(NULL, recipe, "APPLY.BURNTOOL"); 238 //TdB: read in switch for zero'ing pixels under masks 239 options->doApplyPixelZero = psMetadataLookupBool(NULL, recipe, "APPLY.PIXELZERO"); 236 240 options->doVarianceBuild = psMetadataLookupBool(NULL, recipe, "VARIANCE.BUILD"); 237 241 options->doAuxMask = psMetadataLookupBool(NULL, recipe, "MASK.AUXMASK"); … … 245 249 } 246 250 } 251 247 252 248 253 // Mask recipe options (note that mask bit values are set in ppImageSetMaskBits.c) -
trunk/ppImage/src/ppImageReplaceBackground.c
r26895 r41382 144 144 for (int y = 0; y < numRows; y++) { 145 145 for (int x = 0; x < numCols; x++) { 146 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) { 147 image->data.F32[y][x] = 0.0; 146 if(options->doApplyPixelZero) { 147 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) { 148 image->data.F32[y][x] = 0.0; 149 } else { 150 float value = backData[y][x]; 151 if (!isfinite(value)) { 152 image->data.F32[y][x] = NAN; 153 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask; 154 } else { 155 image->data.F32[y][x] -= value; 156 } 157 } 148 158 } else { 149 159 float value = backData[y][x]; … … 154 164 image->data.F32[y][x] -= value; 155 165 } 156 }166 } 157 167 } 158 168 } … … 162 172 for (int y = 0; y < numRows; y++) { 163 173 for (int x = 0; x < numCols; x++) { 164 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) { 165 image->data.F32[y][x] = 0.0; 174 if(options->doApplyPixelZero) { 175 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) { 176 image->data.F32[y][x] = 0.0; 177 } else { 178 float value = psImageUnbinPixel(x + 0.5, y + 0.5, modelRO->image, binning); // Background value 179 if (!isfinite(value)) { 180 image->data.F32[y][x] = NAN; 181 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask; 182 } else { 183 image->data.F32[y][x] -= value; 184 } 185 } 166 186 } else { 167 187 float value = psImageUnbinPixel(x + 0.5, y + 0.5, modelRO->image, binning); // Background value
Note:
See TracChangeset
for help on using the changeset viewer.
