IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.