Changeset 23665
- Timestamp:
- Apr 1, 2009, 4:46:14 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMaskUpdates.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMaskUpdates.c
r21409 r23665 58 58 59 59 bool REFSTAR_MASK_REGIONS = psMetadataLookupBool (&status, recipe, "REFSTAR_MASK_REGIONS"); 60 bool REFSTAR_MASK_BLEED = psMetadataLookupBool (&status, recipe, "REFSTAR_MASK_BLEED"); 60 61 61 62 double REFSTAR_MASK_MAX_MAG = psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_MAX_MAG"); … … 191 192 // 2) diffraction spikes in direction ROT - ROTo 192 193 // 3) bleed trail in the direction of the readout 193 194 // XXX for the moment, let's just generate mana region-file objects in chip pixel space 194 // update: with 'burntool' applied to the data, the bleed trail mask is not needed. 195 195 196 for (int i = 0; i < refstars->n; i++) { 196 197 pmAstromObj *ref = refstars->data[i]; 197 198 if (ref->Mag > REFSTAR_MASK_MAX_MAG) continue; 198 199 199 // XXX convert ref->Mag to instrumental mags 200 // the reference magnitudes have been converted from the instrumental 201 // values supplied in the recipe to apparent mags (above) 200 202 201 203 // CIRCLE around the stars (scaled by magnitude) … … 213 215 // LINE for boundaries of the saturation spikes (scaled by magnitude) 214 216 float spikeLength = REFSTAR_MASK_SATSPIKE_MAG_SLOPE * (REFSTAR_MASK_SATSPIKE_MAG_MAX - ref->Mag); 215 float spikeWidth = REFSTAR_MASK_SATSPIKE_WIDTH;217 float spikeWidth = 0.5*REFSTAR_MASK_SATSPIKE_WIDTH; 216 218 217 219 for (float theta = 0.0; theta < 2*M_PI; theta += M_PI / 2.0) { … … 246 248 } 247 249 248 // convert x,y chip coordinates to cells in maskChip 249 pmCell *refCell = pmCellInChip (refChip, ref->chip->x, ref->chip->y); 250 251 // LINE for boundaries of the bleed lines 252 if (REFSTAR_MASK_REGIONS) { 253 fprintf (f, "LINE %f %f %f %f\n", ref->chip->x, ref->chip->y, 0.0, -100.0); 254 } 255 256 if (readoutMask && refCell) { 257 float xCell = 0.0; 258 float yCell = 0.0; 259 float xEnd = 0.0; 260 float yEnd = 0.0; 261 // find coordinate of star on cell 262 pmCellCoordsForChip (&xCell, &yCell, refCell, ref->chip->x, ref->chip->y); 263 // find coordinate of end-point on chip 264 265 int ySize = psMetadataLookupS32(NULL, refCell->concepts, "CELL.YSIZE"); 266 pmChipCoordsForCell (&xEnd, &yEnd, refCell, xCell, ySize); 267 268 float width = REFSTAR_MASK_BLEED_MAG_SLOPE*(REFSTAR_MASK_BLEED_MAG_MAX - ref->Mag); 269 psastroMaskRectangle (readoutMask->mask, maskValue, (int) ref->chip->x-0.5*width, (int) ref->chip->y, (int) ref->chip->x+0.5*width+1, yEnd); 270 } 250 if (REFSTAR_MASK_BLEED) { 251 252 // convert x,y chip coordinates to cells in maskChip 253 pmCell *refCell = pmCellInChip (refChip, ref->chip->x, ref->chip->y); 254 255 // LINE for boundaries of the bleed lines 256 if (REFSTAR_MASK_REGIONS) { 257 fprintf (f, "LINE %f %f %f %f\n", ref->chip->x, ref->chip->y, 0.0, -100.0); 258 } 259 260 if (readoutMask && refCell) { 261 float xCell = 0.0; 262 float yCell = 0.0; 263 float xEnd = 0.0; 264 float yEnd = 0.0; 265 // find coordinate of star on cell 266 pmCellCoordsForChip (&xCell, &yCell, refCell, ref->chip->x, ref->chip->y); 267 // find coordinate of end-point on chip 268 269 int ySize = psMetadataLookupS32(NULL, refCell->concepts, "CELL.YSIZE"); 270 pmChipCoordsForCell (&xEnd, &yEnd, refCell, xCell, ySize); 271 272 float width = REFSTAR_MASK_BLEED_MAG_SLOPE*(REFSTAR_MASK_BLEED_MAG_MAX - ref->Mag); 273 psastroMaskRectangle (readoutMask->mask, maskValue, (int) ref->chip->x-0.5*width, (int) ref->chip->y, (int) ref->chip->x+0.5*width+1, yEnd); 274 } 275 } 271 276 } 272 277 }
Note:
See TracChangeset
for help on using the changeset viewer.
