Changeset 26173 for trunk/psastro/src/psastroMaskUpdates.c
- Timestamp:
- Nov 17, 2009, 2:19:04 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMaskUpdates.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMaskUpdates.c
r24701 r26173 34 34 psImageMaskType spikeMaskValue = pmConfigMaskGet("SPIKE", config); // Mask value for ghost pixels 35 35 psImageMaskType starMaskValue = pmConfigMaskGet("STARCORE", config); // Mask value for ghost pixels 36 36 psImageMaskType crosstalkMaskValue = pmConfigMaskGet("GHOST", config); // Mask value for crosstalk ghosts 37 37 38 // psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels 38 39 … … 48 49 if (!REFSTAR_MASK) return true; 49 50 51 // convert star positions to crosstalk artifact positions and add to the readout->analysis data 52 bool CROSSTALK_MASK = psMetadataLookupBool (&status, recipe, "CROSSTALK_MASK"); 53 if (CROSSTALK_MASK && !psastroLoadCrosstalk (config)) { 54 psError(PSASTRO_ERR_CONFIG, false, "Error loading crosstalk data"); 55 return(false); 56 } 57 50 58 // convert star positions to ghost positions and add to the readout->analysis data 51 59 if (!psastroLoadGhosts (config)) { … … 76 84 double REFSTAR_MASK_BLEED_MAG_SLOPE = psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_BLEED_MAG_SLOPE"); 77 85 86 double REFSTAR_MASK_CROSSTALK_MAG_MAX = psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_CROSSTALK_MAG_MAX"); 87 double REFSTAR_MASK_CROSSTALK_MAG_SLOPE= psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_CROSSTALK_MAG_SLOPE"); 88 78 89 // select the input data sources 79 90 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); … … 201 212 202 213 if (ref->Mag > REFSTAR_MASK_MAX_MAG) continue; 214 203 215 204 216 // the reference magnitudes have been converted from the instrumental … … 282 294 } 283 295 296 // Select the crosstalk artifact regions for this readout, and mask a circular region 297 // corresponding to the source star 298 299 psArray *crosstalks = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.CROSSTALKS"); 300 if (crosstalks) { 301 for (int i = 0; i < crosstalks->n; i++) { 302 pmAstromObj *ref = crosstalks->data[i]; 303 float radius = REFSTAR_MASK_CROSSTALK_MAG_SLOPE * (REFSTAR_MASK_CROSSTALK_MAG_MAX - ref->Mag); 304 psTrace("psastro.crosstalk",2,"Masking star on Chip %s @ (%f,%f) Magnitude: %f Radius %f\n", 305 psMetadataLookupStr(&status,readout->parent->parent->concepts,"CHIP.NAME"), 306 ref->chip->x,ref->chip->y,ref->Mag,radius); 307 // XXX for now, assume cell binning is 1x1 relative to chip 308 psastroMaskCircle (readoutMask->mask, crosstalkMaskValue, ref->chip->x, ref->chip->y, radius, radius); 309 } 310 } 311 284 312 // this probably should move into a function of its own: 285 313 {
Note:
See TracChangeset
for help on using the changeset viewer.
