Changeset 41382
- Timestamp:
- Jun 23, 2020, 3:29:09 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
ippconfig/recipes/ppImage.config (modified) (1 diff)
-
ippconfig/recipes/ppSub.config (modified) (1 diff)
-
ippconfig/recipes/pswarp.config (modified) (1 diff)
-
ppImage/src/ppImage.h (modified) (1 diff)
-
ppImage/src/ppImageOptions.c (modified) (3 diffs)
-
ppImage/src/ppImageReplaceBackground.c (modified) (3 diffs)
-
ppSub/src/ppSub.h (modified) (1 diff)
-
ppSub/src/ppSubBackground.c (modified) (2 diffs)
-
ppSub/src/ppSubReadoutSubtract.c (modified) (2 diffs)
-
ppSub/src/ppSubSetMasks.c (modified) (2 diffs)
-
psModules/src/objects/pmSourceIO.h (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_Ghosts.c (modified) (20 diffs)
-
psModules/src/objects/pmSourceIO_Glints.c (modified) (5 diffs)
-
pswarp/src/pswarpTransformReadout.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/recipes/ppImage.config
r41372 r41382 20 20 AUX.VIDEO.MASK STR NULL # name of aditional masking for video cells 21 21 APPLY.BURNTOOL BOOL FALSE # apply burntool coorection 22 APPLY.PIXELZERO BOOL TRUE # apply zero'ing of pixels underneath masks 22 23 VARIANCE.BUILD BOOL FALSE # Build internal variance image 23 24 ADDNOISE BOOL FALSE # Add noise to degrade an MD image to a 3pi image? -
trunk/ippconfig/recipes/ppSub.config
r40603 r41382 17 17 NORM.FRAC F32 0.02 # Fraction of window for normalisation window 18 18 COVAR.FRAC F32 0.01 # Fraction of kernel to truncate before calculating covariance 19 APPLY.PIXELNAN BOOL TRUE # Apply NAN'ing of pixels underneath masks 19 20 20 21 MASK.VAL STR MASK.VALUE,CONV.BAD # Mask value for input -
trunk/ippconfig/recipes/pswarp.config
r40802 r41382 12 12 PSF BOOL TRUE # Measure PSF for warped image? 13 13 SOURCES BOOL TRUE # Write source list for warped image? 14 APPLY.PIXELNAN BOOL TRUE # Apply NAN'ing of pixels underneath masks 14 15 15 16 NO.COMPRESS BOOL FALSE # turn off image compression (if enabled) -
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 -
trunk/ppSub/src/ppSub.h
r31156 r41382 190 190 void ppSubSetThreads (void); 191 191 192 // ppSubMaskSetInMetadata examines named mask values and set the bits for maskValue and 193 // markValue. Ensures that the below-named mask values are set, and calculates the mask value 194 // to catch all of the mask values marked as 'bad'. Supplies the fallback name if the primary 195 // name is not found, or the default values if the fallback name is not found. 196 bool ppSubMaskSetInMetadata(psImageMaskType *outMaskValue, // Value of MASK.VALUE, returned 197 psImageMaskType *outMarkValue, // Value of MARK.VALUE, returned 198 psMetadata *source // Source of mask bits 199 ); 200 201 // lookup an image mask value by name from a psMetadata, without requiring the entry to 202 // be of type psImageMaskType, but verifying that it will fit in psImageMaskType 203 psImageMaskType psMetadataLookupImageMaskFromGeneric (bool *status, const psMetadata *md, const char *name); 204 192 205 ///@} 193 206 #endif -
trunk/ppSub/src/ppSubBackground.c
r29937 r41382 33 33 psAssert(psphotRecipe, "Need PSPHOT recipe for binning"); 34 34 35 bool doApplyMaskNaN = psMetadataLookupBool(&mdok, ppSubRecipe, "APPLY.PIXELNAN"); // NaN the pixels underneath masks 36 35 37 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask 36 38 … … 64 66 for (int x = 0; x < numCols; x++) { 65 67 // special case 1: NAN the masked pixels 66 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskBad) { 68 if(doApplyMaskNaN) { 69 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskBad) { 67 70 image->data.F32[y][x] = NAN; 68 71 continue; 69 } 70 // special case 1: NAN & mask pixels without a valid background model 72 } 73 } 74 // special case 2: NAN & mask pixels without a valid background model 71 75 float value = psImageUnbinPixel(x + 0.5, y + 0.5, modelImage, binning); // Background value 72 76 if (!isfinite(value)) { -
trunk/ppSub/src/ppSubReadoutSubtract.c
r31435 r41382 33 33 bool noConvolve = psMetadataLookupBool(&mdok, recipe, "NOCONVOLVE"); // Do not use convolved images. 34 34 bool addPair = psMetadataLookupBool(&mdok, recipe, "ADD.NOT.SUBTRACT"); // add instead of subtracting 35 bool doApplyMaskNaN = psMetadataLookupBool(&mdok, recipe, "APPLY.PIXELNAN"); // NaN the pixels underneath masks 35 36 36 37 pmFPAview *view = ppSubViewReadout(); // View to readout … … 73 74 // NAN the masked pixels in the diff image (pixels masked in A are not yet NAN'ed in B) 74 75 psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config) | pmConfigMaskGet("BLANK", config); // Bits to mask in inputs 75 for (int iy = 0; iy < outRO->image->numRows; iy++) { 76 if(doApplyMaskNaN) { 77 for (int iy = 0; iy < outRO->image->numRows; iy++) { 76 78 for (int ix = 0; ix < outRO->image->numCols; ix++) { 77 79 if ((outRO->mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal) == 0) continue; 78 80 outRO->image->data.F32[iy][ix] = NAN; 79 81 } 82 } 80 83 } 81 84 -
trunk/ppSub/src/ppSubSetMasks.c
r30619 r41382 22 22 #include "ppSub.h" 23 23 24 // Structure to hold the properties of a mask value 25 typedef struct { 26 char *badMaskName; // name for "bad" (i.e., mask me please) pixels 27 char *fallbackName; // Fallback name in case a bad mask name is not defined 28 psImageMaskType defaultMaskValue; // Default value in case a bad mask name and its fallback are not defined 29 bool isBad; // include this value as part of the MASK.VALUE entry (generically bad) 30 } pmConfigMaskInfo; 31 32 static pmConfigMaskInfo skycellmasks[] = { 33 // Features of the detector 34 { "DETECTOR", NULL, 0x01, false }, // Something is wrong with the detector 35 { "FLAT", "DETECTOR", 0x01, false }, // Pixel doesn't flat-field properly 36 { "DARK", "DETECTOR", 0x01, false }, // Pixel doesn't dark-subtract properly 37 { "BLANK", "DETECTOR", 0x01, true }, // Pixel doesn't contain valid data 38 { "CTE", "DETECTOR", 0x01, false }, // Pixel has poor CTE 39 { "BURNTOOL", NULL, 0x04, false }, // Pixel has been touched by burntool 40 // Invalid signal ranges 41 { "SAT", NULL, 0x02, true }, // Pixel is saturated or non-linear 42 { "LOW", "SAT", 0x02, true }, // Pixel is low 43 { "SUSPECT", NULL, 0x04, false }, // Pixel is suspected of being bad 44 // Non-astronomical structures 45 { "CR", NULL, 0x08, true }, // Pixel contains a cosmic ray 46 { "SPIKE", NULL, 0x08, false }, // Pixel contains a diffraction spike 47 { "GHOST", NULL, 0x08, false }, // Pixel contains an optical ghost 48 { "STREAK", NULL, 0x08, false }, // Pixel contains streak data 49 { "STARCORE", NULL, 0x08, false }, // Pixel contains a bright star core 50 // Effects of convolution and interpolation 51 { "CONV.BAD", NULL, 0x02, true }, // Pixel is bad after convolution with a bad pixel 52 { "CONV.POOR", NULL, 0x04, false }, // Pixel is poor after convolution with a bad pixel 53 }; 54 24 55 bool ppSubSetMasks(pmConfig *config) 25 56 { 26 57 psAssert(config, "Require configuration"); 27 58 28 psImageMaskType maskValue, markValue; // Mask values29 if (!pmConfigMaskSetBits(&maskValue, &markValue, config)) {30 psError(PPSUB_ERR_CONFIG, false, "Unable to determine mask value.");31 return false;32 }33 34 // Set the mask bits needed by psphot (in psphot recipe)35 psphotSetMaskRecipe(config, maskValue, markValue);36 37 59 // Look up recipe values 38 60 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim 39 61 psAssert(recipe, "We checked this earlier, so it should be here."); 62 bool doApplyMaskNaN = psMetadataLookupBool(NULL, recipe, "APPLY.PIXELNAN"); // NaN the pixels underneath masks 63 64 psImageMaskType maskValue, markValue; // Mask values 65 if(doApplyMaskNaN) { 66 if (!pmConfigMaskSetBits(&maskValue, &markValue, config)) { 67 psError(PPSUB_ERR_CONFIG, false, "Unable to determine mask value."); 68 return false; 69 } 70 } else { 71 psMetadata *maskrecipe = psMetadataLookupMetadata(NULL, config->recipes, "MASKS"); // The recipe 72 if (!maskrecipe) { 73 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find MASKS recipe."); 74 return false; 75 } 76 if (!ppSubMaskSetInMetadata(&maskValue, &markValue, maskrecipe)) { 77 psError(PPSUB_ERR_CONFIG, false, "Unable to determine mask value."); 78 return false; 79 } 80 } 81 82 // Set the mask bits needed by psphot (in psphot recipe) 83 psphotSetMaskRecipe(config, maskValue, markValue); 84 40 85 41 86 psImageMaskType satValue = pmConfigMaskGet("SAT", config); … … 121 166 return true; 122 167 } 168 169 bool ppSubMaskSetInMetadata(psImageMaskType *outMaskValue, // Value of MASK.VALUE, returned 170 psImageMaskType *outMarkValue, // Value of MARK.VALUE, returned 171 psMetadata *source // Source of mask bits 172 ) 173 { 174 PS_ASSERT_METADATA_NON_NULL(source, false); 175 176 // Ensure all the bad mask names exist, and set the value to catch all bad pixels 177 psImageMaskType maskValue = 0; // Value to mask to catch all the bad pixels 178 psImageMaskType allMasks = 0; // Value to mask to catch all masked bits (to set MARK) 179 180 int nMasks = sizeof (skycellmasks) / sizeof (pmConfigMaskInfo); 181 182 for (int i = 0; i < nMasks; i++) { 183 bool mdok; // Status of MD lookup 184 psImageMaskType value = psMetadataLookupImageMaskFromGeneric(&mdok, source, skycellmasks[i].badMaskName); // Value of mask 185 if (!mdok) { 186 psWarning ("problem with mask value %s\n", skycellmasks[i].badMaskName); 187 } 188 189 if (!value) { 190 if (skycellmasks[i].fallbackName) { 191 value = psMetadataLookupImageMaskFromGeneric(&mdok, source, skycellmasks[i].fallbackName); 192 } 193 if (!value) { 194 value = skycellmasks[i].defaultMaskValue; 195 } 196 psMetadataAddImageMask(source, PS_LIST_TAIL, skycellmasks[i].badMaskName, PS_META_REPLACE, NULL, value); 197 } 198 if (skycellmasks[i].isBad) { 199 maskValue |= value; 200 } 201 allMasks |= value; 202 } 203 204 // search for an unset bit to use for MARK: 205 psImageMaskType markValue = 0x00; 206 psImageMaskType markTrial = 0x01; 207 208 int nBits = sizeof(psImageMaskType) * 8; 209 for (int i = 0; !markValue && (i < nBits); i++) { 210 if (allMasks & markTrial) { 211 markTrial <<= 1; 212 } else { 213 markValue = markTrial; 214 } 215 } 216 if (!markValue) { 217 psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!"); 218 return false; 219 } 220 221 // update the list with the results 222 psMetadataAddImageMask(source, PS_LIST_TAIL, "MASK.VALUE", PS_META_REPLACE, NULL, maskValue); 223 psMetadataAddImageMask(source, PS_LIST_TAIL, "MARK.VALUE", PS_META_REPLACE, NULL, markValue); 224 225 if (outMaskValue) { 226 *outMaskValue = maskValue; 227 } 228 if (outMarkValue) { 229 *outMarkValue = markValue; 230 } 231 232 return true; 233 } 234 -
trunk/psModules/src/objects/pmSourceIO.h
r41367 r41382 91 91 bool pmSourceIO_ReadMatchedRefs (psFits *fits, pmFPA *fpa, const pmConfig *config); 92 92 93 bool p sastroZeroPointFromRecipeGlint (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe);93 bool pmSourceZeroPointFromRecipeGlint (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe); 94 94 bool pmSourceIO_WriteGlints (psFits *fits, pmFPA *fpa, pmConfig *config); 95 95 bool pmSourceIO_WriteGhosts (psFits *fits, pmFPA *fpa, pmConfig *config); -
trunk/psModules/src/objects/pmSourceIO_Ghosts.c
r41367 r41382 55 55 #include "pmAstrometryWCS.h" 56 56 57 # include "p sastroInternal.h"57 # include "pmSourceInternal.h" 58 58 static psVector *chipXmin = NULL; 59 59 static psVector *chipXmax = NULL; … … 68 68 md = psMetadataLookupMetadata (&status, ghostModel, NAME); \ 69 69 if (!md) { \ 70 psError(P SASTRO_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \70 psError(PM_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \ 71 71 goto escape; \ 72 72 } \ 73 73 OUT = psPolynomial2DfromMetadata(md); \ 74 74 if (!OUT) { \ 75 psError(P SASTRO_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \75 psError(PM_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \ 76 76 goto escape; \ 77 77 } … … 80 80 md = psMetadataLookupMetadata (&status, ghostModel, NAME); \ 81 81 if (!md) { \ 82 psError(P SASTRO_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \82 psError(PM_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \ 83 83 goto escape; \ 84 84 } \ 85 85 OUT = psPolynomial1DfromMetadata(md); \ 86 86 if (!OUT) { \ 87 psError(P SASTRO_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \87 psError(PM_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \ 88 88 goto escape; \ 89 89 } … … 116 116 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 117 117 if (!recipe) { 118 psError(P SASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");118 psError(PM_ERR_CONFIG, true, "Can't find PSASTRO recipe"); 119 119 return false; 120 120 } … … 129 129 130 130 if (!pmConfigFileRead (&ghostModel, ghostFile, "GHOST MODEL")) { 131 psError(P SASTRO_ERR_CONFIG, true, "Trouble loading ghost model");131 psError(PM_ERR_CONFIG, true, "Trouble loading ghost model"); 132 132 return false; 133 133 } … … 156 156 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 157 157 if (!astrom) { 158 psError(P SASTRO_ERR_CONFIG, true, "Can't find input data");158 psError(PM_ERR_CONFIG, true, "Can't find input data"); 159 159 goto escape; 160 160 } … … 162 162 163 163 // really error-out here? or just skip? 164 if (!p sastroZeroPointFromRecipeGlint (&zeropt, &exptime, &MAX_MAG,NULL, fpa_ast, recipe)) {164 if (!pmSourceZeroPointFromRecipeGlint (&zeropt, &exptime, &MAX_MAG,NULL, fpa_ast, recipe)) { 165 165 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 166 166 goto escape; … … 202 202 if (ref->Mag > MAX_MAG) continue; 203 203 204 p sastroGhost *ghost = psastroGhostAlloc ();204 pmSourceGhost *ghost = pmSourceGhostAlloc (); 205 205 ghost->srcFP->x = ref->FP->x; 206 206 ghost->srcFP->y = ref->FP->y; … … 239 239 // XXX this code yields a single chip: we need to provide results for any chips 240 240 // which encompass the full size of the ghost 241 pmChip *ghostChip = p sastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, -ghost->srcFP->x, -ghost->srcFP->y);242 ghostChip = p sastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y);241 pmChip *ghostChip = pmSourceFindChip (&ghost->chip->x, &ghost->chip->y, fpa, -ghost->srcFP->x, -ghost->srcFP->y); 242 ghostChip = pmSourceFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y); 243 243 244 244 //do a rudimentary check of whether the ghost is on the pixel FPA … … 331 331 } 332 332 333 static void p sastroGhostFree (psastroGhost *ghost) {333 static void pmSourceGhostFree (pmSourceGhost *ghost) { 334 334 335 335 if (ghost == NULL) return; … … 342 342 } 343 343 344 p sastroGhost *psastroGhostAlloc (void) {345 346 p sastroGhost *ghost = (psastroGhost *) psAlloc(sizeof(psastroGhost));347 psMemSetDeallocator(ghost, (psFreeFunc) p sastroGhostFree);344 pmSourceGhost *pmSourceGhostAlloc (void) { 345 346 pmSourceGhost *ghost = (pmSourceGhost *) psAlloc(sizeof(pmSourceGhost)); 347 psMemSetDeallocator(ghost, (psFreeFunc) pmSourceGhostFree); 348 348 349 349 ghost->srcFP = psPlaneAlloc(); … … 365 365 366 366 367 bool p sastroChipBounds (pmFPA *fpa) {367 bool pmSourceChipBounds (pmFPA *fpa) { 368 368 369 369 chipXmin = psVectorAlloc (fpa->chips->n, PS_TYPE_F32); … … 416 416 } 417 417 418 pmChip *p sastroFindChip (double *xChip, double *yChip, pmFPA *fpa, double xFPA, double yFPA) {418 pmChip *pmSourceFindChip (double *xChip, double *yChip, pmFPA *fpa, double xFPA, double yFPA) { 419 419 420 420 *xChip = NAN; … … 422 422 423 423 if (!chipXmin) { 424 p sastroChipBounds (fpa);424 pmSourceChipBounds (fpa); 425 425 } 426 426 … … 458 458 459 459 // identify chips which land on this column (FP coords) 460 bool p sastroFindChipInXrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) {460 bool pmSourceFindChipInXrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) { 461 461 462 462 if (!chipXmin || !chipXmax) { … … 470 470 471 471 // identify chips which land on this row (FP coords) 472 bool p sastroFindChipInYrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) {472 bool pmSourceFindChipInYrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) { 473 473 474 474 if (!chipYmin || !chipYmax) { … … 482 482 483 483 // return the FPA coordinates of the Y edges of the chip 484 bool p sastroFindChipYedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) {484 bool pmSourceFindChipYedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) { 485 485 486 486 *yFPAs = chipYmin->data.F32[nChip]; … … 490 490 491 491 // return the FPA coordinates of the X edges of the chip 492 bool p sastroFindChipXedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) {492 bool pmSourceFindChipXedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) { 493 493 494 494 *yFPAs = chipXmin->data.F32[nChip]; … … 498 498 499 499 // convert FPA to Chip coordinates 500 bool p sastroFPAtoChip (double *xChip, double *yChip, pmFPA *fpa, int nChip, double xFPA, double yFPA) {500 bool pmSourceFPAtoChip (double *xChip, double *yChip, pmFPA *fpa, int nChip, double xFPA, double yFPA) { 501 501 502 502 pmChip *chip = fpa->chips->data[nChip]; … … 512 512 } 513 513 514 bool p sastroExtractFreeChipBounds () {514 bool pmSourceExtractFreeChipBounds () { 515 515 516 516 psFree (chipXmin); -
trunk/psModules/src/objects/pmSourceIO_Glints.c
r41367 r41382 55 55 #include "pmAstrometryWCS.h" 56 56 57 # include "p sastroInternal.h"57 # include "pmSourceInternal.h" 58 58 59 59 # define ESCAPE(MSG) { \ … … 71 71 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 72 72 if (!recipe) { 73 psError(P SASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");73 psError(PM_ERR_CONFIG, true, "Can't find PSASTRO recipe"); 74 74 return false; 75 75 } … … 110 110 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 111 111 if (!astrom) { 112 psError(P SASTRO_ERR_CONFIG, true, "Can't find input data");112 psError(PM_ERR_CONFIG, true, "Can't find input data"); 113 113 return false; 114 114 } … … 117 117 // use the zero point and exposure time to convert to apparent mags: M_ap = M_inst + C_0 + 2.5*log(exptime) 118 118 pmFPA *fpa_ast = astrom->fpa; 119 if (!p sastroZeroPointFromRecipeGlint (&zeropt, &exptime, NULL,&GLINT_MAX_MAG, fpa_ast, recipe)) {119 if (!pmSourceZeroPointFromRecipeGlint (&zeropt, &exptime, NULL,&GLINT_MAX_MAG, fpa_ast, recipe)) { 120 120 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 121 121 return false; … … 237 237 } 238 238 239 bool p sastroZeroPointFromRecipeGlint (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe) {239 bool pmSourceZeroPointFromRecipeGlint (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe) { 240 240 241 241 bool status; -
trunk/pswarp/src/pswarpTransformReadout.c
r35563 r41382 27 27 int nGridX = psMetadataLookupS32(NULL, config->arguments, "GRID.NX"); ///< Number of grid points in x 28 28 int nGridY = psMetadataLookupS32(NULL, config->arguments, "GRID.NY"); ///< Number of grid points in y 29 bool doApplyMaskNaN = psMetadataLookupBool(NULL, config->arguments, "APPLY.PIXELNAN"); ///NaN the pixels underneath masks 30 29 31 psImageInterpolateMode interpolationMode = psMetadataLookupS32(NULL, config->arguments, 30 32 "INTERPOLATION.MODE"); ///< Mode for interp … … 37 39 38 40 // output mask bits 39 psImageMaskType maskIn = psMetadataLookupImageMask(&mdok, recipe, "MASK.INPUT"); 41 psImageMaskType maskIn = 0 ; 42 if(doApplyMaskNaN) { 43 maskIn = psMetadataLookupImageMask(&mdok, recipe, "MASK.INPUT"); 44 psAssert(mdok, "MASK.INPUT was not defined"); 45 } 40 46 psImageMaskType maskPoor = pmConfigMaskGet("CONV.POOR", config); 41 47 if (!maskPoor) { … … 46 52 maskBad = pmConfigMaskGet("BAD.WARP", config); 47 53 } 48 psAssert(mdok, "MASK.INPUT was not defined");49 54 50 55 if (!input->covariance) {
Note:
See TracChangeset
for help on using the changeset viewer.
