IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23665


Ignore:
Timestamp:
Apr 1, 2009, 4:46:14 PM (17 years ago)
Author:
eugene
Message:

fix eqns so recipe value width is full width; add REFSTAR_MASK_BLEED bool option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMaskUpdates.c

    r21409 r23665  
    5858
    5959    bool REFSTAR_MASK_REGIONS              = psMetadataLookupBool (&status, recipe, "REFSTAR_MASK_REGIONS");
     60    bool REFSTAR_MASK_BLEED                = psMetadataLookupBool (&status, recipe, "REFSTAR_MASK_BLEED");
    6061
    6162    double REFSTAR_MASK_MAX_MAG            = psMetadataLookupF32 (&status, recipe, "REFSTAR_MASK_MAX_MAG");
     
    191192                // 2) diffraction spikes in direction ROT - ROTo
    192193                // 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
    195196                for (int i = 0; i < refstars->n; i++) {
    196197                    pmAstromObj *ref = refstars->data[i];
    197198                    if (ref->Mag > REFSTAR_MASK_MAX_MAG) continue;
    198199
    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)
    200202
    201203                    // CIRCLE around the stars (scaled by magnitude)
     
    213215                    // LINE for boundaries of the saturation spikes (scaled by magnitude)
    214216                    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;
    216218
    217219                    for (float theta = 0.0; theta < 2*M_PI; theta += M_PI / 2.0) {
     
    246248                    }
    247249
    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                    }
    271276                }
    272277            }
Note: See TracChangeset for help on using the changeset viewer.