IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 28, 2020, 1:26:07 PM (6 years ago)
Author:
tdeboer
Message:

gpc2 dynamic masking set up

File:
1 edited

Legend:

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

    r41338 r41348  
    152152            }
    153153
     154            //do a rudimentary check of whether the glint enters the pixel FPA
     155            if (!strcasecmp(glintType, "TOP")    && ((star->FP->y - glintLength) > 20000.))  continue;
     156            if (!strcasecmp(glintType, "BOTTOM") && ((star->FP->y + glintLength) < -20000.))  continue;
     157            if (!strcasecmp(glintType, "LEFT")   && ((star->FP->x + glintLength) < -20000.))  continue;
     158            if (!strcasecmp(glintType, "RIGHT")  && ((star->FP->x - glintLength) > 20000.))  continue;
    154159
    155160            psVector *x_glint = psVectorAlloc(2,PS_TYPE_F32);
     
    179184                        double yFPAs, yFPAe;
    180185                        psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip);
     186                        if (yFPAs > yFPAe) PS_SWAP (yFPAs, yFPAe);
    181187
    182188                        xFPA0 = star->FP->x;
     
    204210                        double yFPAs, yFPAe;
    205211                        psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip);
     212                        if (yFPAs > yFPAe) PS_SWAP (yFPAs, yFPAe);
    206213
    207214                        xFPA0 = star->FP->x;
     
    218225                x_glint->data.F32[1] = xFPA1;
    219226                y_glint->data.F32[1] = yFPA1;
     227
    220228
    221229                //we need to loop over each corner to select the chips that can have the glint on it
     
    243251                        if (yFPA0 > yFPAe) continue;
    244252                        if (yFPA1 < yFPAs) continue;
     253
    245254
    246255                        //find the y-coord positions for this chip
     
    322331
    323332                        // FPA coordinates of intersections with chip edges
    324                         double yFPAs, yFPAe;
    325                         psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip);
    326 
    327                         xFPA0 = yFPAe;
     333                        double xFPAs, xFPAe;
     334                        psastroFindChipXedges (&xFPAs, &xFPAe, fpa, nChip);
     335                        if (xFPAs > xFPAe) PS_SWAP (xFPAs, xFPAe);
     336
     337                        xFPA0 = xFPAe;
    328338                        yFPA0 = star->FP->y;
    329                         glintLength-= (star->FP->x-yFPAe);
     339                        glintLength-= (star->FP->x-xFPAe);
    330340                    }
    331341
     
    347357
    348358                        // FPA coordinates of intersections with chip edges
    349                         double yFPAs, yFPAe;
    350                         psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip);
    351 
    352                         xFPA0 = yFPAs;
     359                        double xFPAs, xFPAe;
     360                        psastroFindChipXedges (&xFPAs, &xFPAe, fpa, nChip);
     361                        if (xFPAs > xFPAe) PS_SWAP (xFPAs, xFPAe);
     362
     363                        xFPA0 = xFPAs;
    353364                        yFPA0 = star->FP->y;
    354                         glintLength-= (yFPAs-star->FP->x);
     365                        glintLength-= (xFPAs-star->FP->x);
    355366                    }
    356367
     
    431442                       
    432443                        fprintf (stderr, "glint %s : %d %f,%f to %f,%f (%f %f %f)\n", glintType, nChip, xChip0, yChip0, xChip1, yChip1, glint_length, glintWidth, chip_angle);
     444
    433445                        psVector *glint = psVectorAlloc(5,PS_TYPE_F32);
    434446                        glint->data.F32[0] = xChip0;
Note: See TracChangeset for help on using the changeset viewer.