IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25614


Ignore:
Timestamp:
Sep 27, 2009, 11:11:05 AM (17 years ago)
Author:
eugene
Message:

add test dump stats function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src/psphotOutput.c

    r25598 r25614  
    3131    }
    3232    return background;
     33}
     34
     35// dump source stats for psf stars
     36bool psphotDumpStats (psArray *sources, char *stage) {
     37
     38    char filename[64];
     39    snprintf (filename, 64, "psf.%s.dat", stage);
     40    FILE *f = fopen (filename, "w");
     41    for (int i = 0; i < sources->n; i++) {
     42        pmSource *source = sources->data[i];
     43        if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue;
     44
     45        pmModel *model = source->modelPSF;
     46        if (!model) continue;
     47
     48        // int xc = source->peak->x - source->pixels->col0;
     49        // int yc = source->peak->y - source->pixels->row0;
     50        // float mcore = source->modelFlux ? source->modelFlux->data.F32[yc][xc] : NAN;
     51        // float mpeak = model ? model->params->data.F32[PM_PAR_I0] : NAN;
     52        // bool subtracted = source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED;
     53        // fprintf (stderr, "%d %d : %d : %f %f : %f %f\n", source->peak->x, source->peak->y, subtracted, source->peak->flux, source->pixels->data.F32[yc][xc], mcore, mpeak);
     54
     55        fprintf (f, "%6.1f %6.1f : %6.1f %6.1f : %8.3f %8.3f %8.3f : %f : %f %f %f : %f\n",
     56                 source->peak->xf, source->peak->yf,
     57                 model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS],
     58                 source->psfMag, source->apMag, source->errMag,
     59                 model->params->data.F32[PM_PAR_I0],
     60                 model->params->data.F32[PM_PAR_SXX], model->params->data.F32[PM_PAR_SXY], model->params->data.F32[PM_PAR_SYY],
     61                 model->params->data.F32[PM_PAR_7]);
     62    }
     63    fclose (f);
     64    return true;
    3365}
    3466
Note: See TracChangeset for help on using the changeset viewer.