IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25595


Ignore:
Timestamp:
Sep 27, 2009, 10:39:09 AM (17 years ago)
Author:
eugene
Message:

clean up some of the test code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psModules/src/objects/pmSourceVisual.c

    r25591 r25595  
    142142    psImageInit (resid, 0.0);
    143143
    144     FILE *f = fopen ("stats.dat", "w");
    145     for (int i = 0; i < sources->n; i++) {
     144    // FILE *f = fopen ("stats.dat", "w");
     145    // psAssert (f, "failed to open");
     146
     147    for (int i = sources->n - 1; i >= 0; i--) {
    146148        pmSource *source = sources->data[i];
    147149        if (!source) continue;
     
    159161        int Yo = 0.1*srcModel->params->data.F32[PM_PAR_YPOS];
    160162
    161         // insert source pixels in the image at 1/10th offset (XXX ignore centering for now)
    162         // XXX calculate the pixel scatter values, chisq
     163        // insert source pixels in the image at 1/10th offset
    163164        for (int iy = 0; iy < source->pixels->numRows; iy++) {
    164165            int jy = iy + Yo;
     
    174175            }
    175176        }
    176 
    177         fprintf (f, "%d, %d -> %f  %f  %f  %f\n", Xo, Yo, norm, source->psfMag, source->apMag, -2.5*log10(source->moments->Sum));
    178     }
    179     fclose (f);
     177        // fprintf (f, "%d, %d -> %f  %f  %f  %f\n", Xo, Yo, norm, source->psfMag, source->apMag, -2.5*log10(source->moments->Sum));
     178    }
     179    // fclose (f);
    180180
    181181    // KapaClearSections (kapa2);
     
    184184    pmVisualScaleImage (kapa2, resid, "resid", 2, true);
    185185
     186# ifdef DEBUG
    186187    {
    187188        psFits *fits = psFitsOpen ("image.fits", "w");
     
    195196        psFitsClose (fits);
    196197    }
     198# endif
    197199
    198200    psFree (image);
     
    264266    if (!pmVisualIsVisual() || !plotPSF) return true;
    265267
    266     // XXX skip for now
    267     // return true;
    268 
    269268    if (kapa1 == -1) {
    270269        kapa1 = KapaOpenNamedSocket ("kapa", "pmSource:plots");
     
    278277    KapaClearPlots (kapa1);
    279278    KapaInitGraph (&graphdata);
    280 
    281     // float min = +1e32;
    282     // float max = -1e32;
    283     // float Min = +1e32;
    284     // float Max = -1e32;
    285279
    286280    float Xmin = +1e32;
     
    316310    xm->n = ym->n = Fm->n = n;
    317311
    318     // psVector *xn = psVectorAlloc (x->n, PS_TYPE_F32);
    319     // psVector *yn = psVectorAlloc (x->n, PS_TYPE_F32);
    320     // psVector *zn = psVectorAlloc (x->n, PS_TYPE_F32);
    321     // psVector *Zn = psVectorAlloc (x->n, PS_TYPE_F32);
    322     // psVector *Fn = psVectorAlloc (x->n, PS_TYPE_F32);
    323     // for (int i = 0; i < x->n; i++) {
    324     //     xn->data.F32[i] = x->data.F32[i] / 5000.0;
    325     //     yn->data.F32[i] = y->data.F32[i] / 5000.0;
    326     //     zn->data.F32[i] = (resid->data.F32[i] - min) / (max - min);
    327     //     Zn->data.F32[i] = (param->data.F32[i] - Min) / (Max - Min);
    328     //     Fn->data.F32[i] = (model->data.F32[i] - Min) / (Max - Min);
    329     // }
    330 
    331312    // view 1 on resid
    332313    section.dx = 1.0;
     
    430411    KapaPlotVector (kapa1, y->n, model->data.F32, "y");
    431412
    432 # if (0)
    433     // view 3 on resid
    434     section.dx = 0.5;
    435     section.dy = 0.33;
    436     section.x = 0.0;
    437     section.y = 0.33;
    438     section.name = NULL;
    439     psStringAppend (&section.name, "a3");
    440     KapaSetSection (kapa1, &section);
    441     psFree (section.name);
    442     pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Zn, 30.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);
    443 
    444     // view 4 on resid
    445     section.dx = 0.5;
    446     section.dy = 0.33;
    447     section.x = 0.5;
    448     section.y = 0.33;
    449     section.name = NULL;
    450     psStringAppend (&section.name, "a4");
    451     KapaSetSection (kapa1, &section);
    452     psFree (section.name);
    453     pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Zn, -60.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);
    454 
    455     // view 5 on resid
    456     section.dx = 0.5;
    457     section.dy = 0.33;
    458     section.x = 0.0;
    459     section.y = 0.66;
    460     section.name = NULL;
    461     psStringAppend (&section.name, "a5");
    462     KapaSetSection (kapa1, &section);
    463     psFree (section.name);
    464     pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Fn, 30.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);
    465 
    466     // view 6 on resid
    467     section.dx = 0.5;
    468     section.dy = 0.33;
    469     section.x = 0.5;
    470     section.y = 0.66;
    471     section.name = NULL;
    472     psStringAppend (&section.name, "a6");
    473     KapaSetSection (kapa1, &section);
    474     psFree (section.name);
    475     pmSourcePlotPoints3D (kapa1, &graphdata, xn, yn, Fn, -60.0*PS_RAD_DEG, -15.0*PS_RAD_DEG);
    476 # endif
    477 
    478413    psFree (resid);
    479414    psFree (model);
     
    486421}
    487422
    488 // send in normalized points
     423// Somewhat broken 3D plotting function (was used by pmSourceVisualPSFModelResid, but not anymore)
    489424bool pmSourcePlotPoints3D (int myKapa, Graphdata *graphdata, psVector *xn, psVector *yn, psVector *zn, float theta, float phi) {
    490425
     
    521456    KapaSetLimits (myKapa, graphdata);
    522457
    523     // KapaSetFont (myKapa, "helvetica", 14);
    524     // KapaBox (myKapa, graphdata);
    525     // KapaSendLabel (myKapa, "&ss&h_x| (pixels)", KAPA_LABEL_XM);
    526     // KapaSendLabel (myKapa, "&ss&h_y| (pixels)", KAPA_LABEL_YM);
    527 
    528458    graphdata->color = KapaColorByName ("black");
    529459    graphdata->ptype = 100;
Note: See TracChangeset for help on using the changeset viewer.