IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13079


Ignore:
Timestamp:
Apr 27, 2007, 3:45:34 PM (19 years ago)
Author:
eugene
Message:

trace comparison detail for shape parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotChoosePSF.c

    r13035 r13079  
    229229    // XXX test dump of psf star data and psf-subtracted image
    230230    if (psTraceGetLevel("psphot.psfstars") > 5) {
     231        psphotSaveImage (NULL, readout->image,  "rawstars.fits");
     232
    231233        for (int i = 0; i < try->sources->n; i++) {
    232234            // masked for: bad model fit, outlier in parameters
     
    247249        }
    248250
     251        FILE *f = fopen ("shapes.dat", "w");
     252        for (int i = 0; i < try->sources->n; i++) {
     253            psF32 inPar[10];
     254
     255            // masked for: bad model fit, outlier in parameters
     256            if (try->mask->data.U8[i] & PSFTRY_MASK_ALL) continue;
     257
     258            pmSource *source = try->sources->data[i];
     259            psF32 *outPar = source->modelEXT->params->data.F32;
     260
     261            psEllipseShape shape;
     262
     263            shape.sx  = outPar[PM_PAR_SXX] / M_SQRT2;
     264            shape.sy  = outPar[PM_PAR_SYY] / M_SQRT2;
     265            shape.sxy = outPar[PM_PAR_SXY];
     266
     267            psEllipsePol pol = pmPSF_ModelToFit (outPar);
     268            inPar[PM_PAR_E0] = pol.e0;
     269            inPar[PM_PAR_E1] = pol.e1;
     270            inPar[PM_PAR_E2] = pol.e2;
     271            pmPSF_FitToModel (inPar, 0.1);
     272
     273            psEllipseAxes axes1 = psEllipseShapeToAxes (shape, 20.0);
     274            psEllipseAxes axes2 = psEllipsePolToAxes (pol, 0.1);
     275            psEllipsePol pol2 = psEllipseAxesToPol (axes1);
     276
     277            fprintf (f, "%3d  %7.2f %7.2f  %7.4f %7.4f %7.4f  --  %7.4f %7.4f %7.4f  :  %7.4f %7.4f %7.4f  --  %7.4f %7.4f %7.4f : %7.4f %7.4f %6.1f : %7.4f %7.4f %6.1f\n",
     278                     i, outPar[PM_PAR_XPOS], outPar[PM_PAR_YPOS],
     279                     outPar[PM_PAR_SXX], outPar[PM_PAR_SXY], outPar[PM_PAR_SYY],
     280                     pol.e0, pol.e1, pol.e2,
     281                     pol2.e0, pol2.e1, pol2.e2,
     282                     inPar[PM_PAR_SXX], inPar[PM_PAR_SXY], inPar[PM_PAR_SYY],
     283                     axes1.major, axes1.minor, axes1.theta*PM_DEG_RAD,
     284                     axes2.major, axes2.minor, axes2.theta*PM_DEG_RAD
     285                     );
     286        }
     287        fclose (f);
     288
    249289        psphotSaveImage (NULL, readout->image,  "psfstars.fits");
    250290        pmSourcesWritePSFs (try->sources, "psfstars.dat");
Note: See TracChangeset for help on using the changeset viewer.