IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34072


Ignore:
Timestamp:
Jun 25, 2012, 5:15:13 PM (14 years ago)
Author:
eugene
Message:

some tests to check working analysis; add some additional stats to psphotFitSourcesLinear

Location:
branches/eam_branches/ipp-20120601/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120601/psphot/src/psphotReadout.c

    r33915 r34072  
    99}
    1010
     11# if (0)
     12// TEST CODE, can be removed
     13bool psphotDumpFlux (pmConfig *config, const pmFPAview *view, const char *filerule) {
     14
     15    bool status = false;
     16
     17    // find the currently selected readout
     18    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest
     19    psAssert (file, "missing file?");
     20
     21    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     22    psAssert (readout, "missing readout?");
     23
     24    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     25    psAssert (detections, "missing detections?");
     26
     27    psArray *sources = detections->allSources;
     28    psAssert (sources, "missing sources?");
     29
     30    static int npass;
     31    char filename[64];
     32    snprintf (filename, 64, "mags.%d.dat", npass);
     33    FILE *ftest = fopen (filename, "w");
     34    for (int j = 0; j < sources->n; j++) {
     35        pmSource *source = sources->data[j];
     36
     37        float psfMag;
     38        status = pmSourcePhotometryModel (&psfMag, NULL, source->modelPSF);
     39
     40        float psfMagNorm;
     41        float Io = source->modelPSF->params->data.F32[PM_PAR_I0];
     42        source->modelPSF->params->data.F32[PM_PAR_I0] = 1.0;
     43        status = pmSourcePhotometryModel (&psfMagNorm, NULL, source->modelPSF);
     44        source->modelPSF->params->data.F32[PM_PAR_I0] = Io;
     45
     46        // double apTrend = pmTrend2DEval (psf->ApTrend, (float)source->peak->x, (float)source->peak->y);
     47        fprintf (ftest, "%d %d %d  %f %f %f %f  %f %f\n", j, source->peak->x, source->peak->y, source->modelPSF->params->data.F32[PM_PAR_I0], source->modelPSF->params->data.F32[PM_PAR_SXX], source->modelPSF->params->data.F32[PM_PAR_SYY], source->modelPSF->params->data.F32[PM_PAR_SXY], psfMag, psfMagNorm);
     48    }
     49    fclose (ftest);
     50    npass++;
     51
     52    return true;
     53}
     54# endif
     55
    1156bool psphotReadout(pmConfig *config, const pmFPAview *view, const char *filerule) {
    1257
  • branches/eam_branches/ipp-20120601/psphot/test/tap_psphot_varmodel.pro

    r34056 r34072  
    8989        sprintf name "test/test.%02d.%02d.%s" $sky {10*$fwhm} $psf_in
    9090        # mkexp $name $sky $fwhm $psf_in
     91        data $name.dat
     92        read fluxIn 3 MagPredIn 5
     93        set MagRealIn = -2.5*log(fluxIn)
     94        set dMagIn = MagRealIn - MagPredIn
    9195       
    9296        foreach psf_out GAUSS PS1_V1
     
    270274  section a1 0.0 0.50 1.0 0.25
    271275  lim rv -0.025 0.075; label -fn courier 14; box;
    272   plot -c black -pt 0 -sz 0.3 MagPredIn dMagIn
     276  # plot -c black -pt 0 -sz 0.3 MagPredIn dMagIn
    273277  plot -c red   -pt 7 -sz 2.0 imag_V dmag_V
    274278  plot -c darkgreen -pt 3 -sz 2.0 imag_V Dmag_V
     
    279283  sprintf line "OFFSET: %6.3f" $offset
    280284  textline -frac 0.1 0.8 -fn courier 24 "$line"
     285
     286  subset dmsub = delta if (rv < -13) && (rv > -16)
     287  vstat -q dmsub
     288  sprintf line "STDEV: %6.3f" $SIGMA
     289  textline -frac 0.1 0.7 -fn courier 24 "$line"
    281290
    282291
Note: See TracChangeset for help on using the changeset viewer.