IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 30, 2012, 6:10:52 AM (14 years ago)
Author:
eugene
Message:

some generalization of visualization code; add radial profile fits to deblend satstars (still testing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120805/psphot/src/psphotVisual.c

    r34360 r34368  
    12731273}
    12741274
    1275 static void plotline (int myKapa, Graphdata *graphdata, float x0, float y0, float x1, float y1)
     1275void plotline (int myKapa, Graphdata *graphdata, float x0, float y0, float x1, float y1)
    12761276{
    12771277    float x[2], y[2];
     
    12851285}
    12861286
    1287 bool psphotVisualPlotRadialProfile (int myKapa, pmSource *source, psImageMaskType maskVal) {
     1287bool psphotVisualPlotRadialProfile (int myKapa, pmSource *source, psImageMaskType maskVal, pmSourceMode showmode) {
    12881288
    12891289    Graphdata graphdata;
     1290
     1291    float Rmax = (showmode & PM_SOURCE_MODE_SATSTAR) ? 100.0 : 30.0;
    12901292
    12911293    bool subtracted = (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED);
     
    13101312        Yo = source->modelPSF->params->data.F32[PM_PAR_YPOS] - source->pixels->row0;
    13111313    } else {
    1312         Xo = source->moments->Mx;
    1313         Yo = source->moments->My;
     1314        Xo = source->moments->Mx - source->pixels->col0;
     1315        Yo = source->moments->My - source->pixels->row0;
    13141316    }
    13151317
    13161318    for (int iy = 0; iy < source->pixels->numRows; iy++) {
    13171319        for (int ix = 0; ix < source->pixels->numCols; ix++) {
    1318             if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix]) {
     1320            if ((source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal)) {
    13191321                rb->data.F32[nb] = hypot (ix + 0.5 - Xo, iy + 0.5 - Yo) ;
    13201322                // rb->data.F32[nb] = hypot (ix - Xo, iy - Yo) ;
     
    13391341    // examine sources to set data range
    13401342    graphdata.xmin =  -0.05;
    1341     graphdata.xmax = +30.05;
     1343    graphdata.xmax = Rmax + 0.05;
    13421344    graphdata.ymin = -0.05;
    13431345    graphdata.ymax = +8.05;
     
    13701372    // examine sources to set data range
    13711373    graphdata.xmin = -1.51;
    1372     graphdata.xmax = +1.51;
     1374    graphdata.xmax = log10(Rmax) + 0.02;
    13731375    graphdata.ymin = -0.05;
    13741376    graphdata.ymax = +8.05;
     
    14221424        params->data.F32[PM_PAR_YPOS] = 0.0;
    14231425
    1424         psVector *rmod = psVectorAlloc(300, PS_TYPE_F32);
    1425         psVector *fmaj = psVectorAlloc(300, PS_TYPE_F32);
    1426         psVector *fmin = psVectorAlloc(300, PS_TYPE_F32);
     1426        psVector *rmod = psVectorAlloc(Rmax*10, PS_TYPE_F32);
     1427        psVector *fmaj = psVectorAlloc(Rmax*10, PS_TYPE_F32);
     1428        psVector *fmin = psVectorAlloc(Rmax*10, PS_TYPE_F32);
    14271429
    14281430        psVector *coord = psVectorAlloc(2, PS_TYPE_F32);
     
    15691571        if (!(source->mode & showmode)) continue;
    15701572
    1571         psphotVisualPlotRadialProfile (myKapa, source, maskVal);
     1573        psphotVisualPlotRadialProfile (myKapa, source, maskVal, showmode);
     1574
     1575        if (pmVisualTestLevel("psphot.image", 1)) {
     1576          int display = psphotKapaChannel (1);
     1577          KiiCenter (display, source->peak->xf, source->peak->yf, 1);
     1578          KiiOverlay overlay;
     1579          overlay.x = source->peak->xf;
     1580          overlay.y = source->peak->yf;
     1581          overlay.dx = 5;
     1582          overlay.dy = 5;
     1583          overlay.angle = 0.0;
     1584          overlay.type = KiiOverlayTypeByName ("circle");
     1585          KiiLoadOverlay (display, &overlay, 1, "red");
     1586          overlay.x = source->moments->Mx;
     1587          overlay.y = source->moments->My;
     1588          overlay.dx = 8;
     1589          overlay.dy = 8;
     1590          overlay.angle = 0.0;
     1591          overlay.type = KiiOverlayTypeByName ("circle");
     1592          KiiLoadOverlay (display, &overlay, 1, "blue");
     1593        }
    15721594
    15731595        // pause and wait for user input:
Note: See TracChangeset for help on using the changeset viewer.