Changeset 24652 for trunk/psastro/src/psastroMaskUpdates.c
- Timestamp:
- Jul 2, 2009, 3:42:20 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMaskUpdates.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMaskUpdates.c
r23844 r24652 28 28 pmCell *cell = NULL; 29 29 pmReadout *readout = NULL; 30 float zeropt, exptime ;30 float zeropt, exptime, GHOST_MAX_MAG; 31 31 32 32 psImageMaskType ghostMaskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels 33 psImageMaskType glintMaskValue = pmConfigMaskGet("GHOST", config); // Mask value for glint pixels (overload ghost) 33 34 psImageMaskType spikeMaskValue = pmConfigMaskGet("SPIKE", config); // Mask value for ghost pixels 34 35 psImageMaskType starMaskValue = pmConfigMaskGet("STARCORE", config); // Mask value for ghost pixels … … 53 54 } 54 55 bool COUNT_GHOSTS = psMetadataLookupF32 (&status, recipe, "REFSTAR_COUNT_GHOSTS"); 55 double GHOST_MAX_MAG = psMetadataLookupF32 (&status, recipe, "GHOST_MAX_MAG");56 56 int nGhosts = 0; 57 58 // convert star positions to glint positions and add to the fpa->analysis data 59 if (!psastroLoadGlints (config)) { 60 psError(PSASTRO_ERR_CONFIG, false, "Error loading glints"); 61 return false; 62 } 57 63 58 64 psLogMsg ("psastro", PS_LOG_INFO, "generating a bright-star mask"); … … 79 85 80 86 // really error-out here? or just skip? 81 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, fpa, recipe)) {87 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, &GHOST_MAX_MAG, fpa, recipe)) { 82 88 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 83 89 return false; … … 221 227 } 222 228 229 // This masking option was needed for persistent charge trails in GPC1; it 230 // has since been replaced with 'burntool', which is applied upon readout 231 // by the camera software, and therefore is aware of the image sequence. 223 232 if (REFSTAR_MASK_BLEED) { 224 225 233 // convert x,y chip coordinates to cells in maskChip 226 234 pmCell *refCell = pmCellInChip (refChip, ref->chip->x, ref->chip->y); … … 245 253 } 246 254 247 // select the raw objects for this readout (loaded in psastroExtract.c) 255 // select the ghost object for this readout (loaded in psastroExtractGhosts.c). 256 // These differ from the reference stars since the star position is not 257 // contained by the readout; instead, the ghost position is predicted based on 258 // the ghost model, and the ghost positions associated with a given readout are 259 // supplied here. 248 260 psArray *ghosts = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.GHOSTS"); 249 if (ghosts == NULL) { continue; } 250 251 // identify the bright stars of interest 252 for (int i = 0; i < ghosts->n; i++) { 253 psastroGhost *ghost = ghosts->data[i]; 254 // XXX bright vs faint ghost bits? (OR with SUSPECT) 255 psastroMaskEllipticalAnnulus (readoutMask->mask, ghostMaskValue, ghost->chip->x, ghost->chip->y, ghost->inner, ghost->outer); 256 } 261 if (ghosts) { 262 // mask the ghosts on this readout 263 for (int i = 0; i < ghosts->n; i++) { 264 psastroGhost *ghost = ghosts->data[i]; 265 // XXX bright vs faint ghost bits? (OR with SUSPECT) 266 psastroMaskEllipticalAnnulus (readoutMask->mask, ghostMaskValue, ghost->chip->x, ghost->chip->y, ghost->inner, ghost->outer); 267 } 268 } 269 270 // Select the glint mask regions for this readout (loaded in 271 // psastroExtractGlints.c). These glint regions are defined as rectangular 272 // boxes and are generated for each chip based on the position of the bright 273 // stars beyond the edge of the focal plane. This masking is currently very 274 // GPC1-specific 275 psArray *glints = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.GLINTS"); 276 if (glints) { 277 // mask the glints on this readout 278 for (int i = 0; i < glints->n; i++) { 279 psRegion *glint = glints->data[i]; 280 psastroMaskRectangle (readoutMask->mask, glintMaskValue, glint->x0, glint->y0, glint->x1, glint->y1); 281 } 282 } 257 283 258 284 // select the raw objects for this readout, flag is they fall in a mask … … 260 286 if (rawstars == NULL) return false; 261 287 262 // XXX finish this: 263 for (int i = 0; i < rawstars->n; i++) { 288 // XXX finish this: raise a bit for stars that land on certain types of masks; 289 // others (eg, bright star core) should be ignored. 290 for (int i = 0; false && (i < rawstars->n); i++) { 264 291 pmAstromObj *raw = rawstars->data[i]; 265 292 psImageMaskType value = readoutMask->mask->data.PS_TYPE_IMAGE_MASK_DATA[(int)(raw->chip->x)][(int)(raw->chip->y)];
Note:
See TracChangeset
for help on using the changeset viewer.
