IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4398


Ignore:
Timestamp:
Jun 25, 2005, 9:23:18 AM (21 years ago)
Author:
eugene
Message:

further cleanup, adding output functions

Location:
trunk/psphot/src
Files:
2 added
4 edited

Legend:

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

    r4375 r4398  
    77    bool        status;
    88    char       *modelName;
    9     char        key[64];
     9    char        key[64], filename[64];
    1010    pmPSF_Test *test  = NULL;
    1111    psArray    *stars = NULL;
     
    3535        tests->data[i] = pmPSF_TestModel (stars, modelName, RADIUS);
    3636
    37         // dump psf test data to file:
    38         {
    39           sprintf (key, "metric.%d.dat", i);
    40           FILE *f = fopen (key, "w");
    41           test = tests->data[i];
    42 
    43 
    44           for (int j = 0; j < test->sources->n; j++) {
    45             psSource *source = test->sources->data[j];
    46             psModel  *model  = test->modelPSF->data[j];     
    47             float sky = 0;
    48 
    49             if (model != NULL) sky = model->params->data.F32[0];
    50 
    51             fprintf (f, "%3d %6.1f %6.1f  %7.4f %7.4f  %8.4f\n",
    52                      j, source->moments->x, source->moments->y,
    53                      test->metric->data.F64[j], test->fitMag->data.F64[j], sky);
    54           }
    55           fclose (f);
    56         }
     37        sprintf (filename, "metric.%d.dat", i);
     38        DumpPSFTestData (tests->data[i], filename);
    5739    }
    5840
  • trunk/psphot/src/psphot-utils.c

    r4375 r4398  
    5252    fclose (f);
    5353    return true;
     54}
     55
     56bool DumpPSFTestData (pmPSF_Test *test, char *filename)
     57{
     58
     59  FILE *f = fopen (key, "w");
     60
     61  for (int j = 0; j < test->sources->n; j++) {
     62
     63    psSource *source = test->sources->data[j];
     64    psModel  *model  = test->modelPSF->data[j];     
     65
     66    float sky = 0;
     67    if (model != NULL) sky = model->params->data.F32[0];
     68
     69    fprintf (f, "%3d %6.1f %6.1f  %7.4f %7.4f  %8.4f\n",
     70             j, source->moments->x, source->moments->y,
     71             test->metric->data.F64[j], test->fitMag->data.F64[j], sky);
     72  }
     73  fclose (f);
    5474}
    5575
  • trunk/psphot/src/psphot.c

    r4375 r4398  
    2424    // construct sources and measure basic stats
    2525    sources = source_moments (imdata, config, peaks);
     26
     27    basic_classes (sources, config);
    2628
    2729    // source analysis is done in S/N order (brightest first)
  • trunk/psphot/src/source_moments.c

    r4375 r4398  
    3535    }
    3636
    37     // group into STAR, COSMIC, GALAXY, SATURATED
    38     psfClump = pmSourcePSFClump (sources, config);
    39     pmSourceRoughClass (sources, config, psfClump);
    40 
    41     // make this optional
    42     // DumpMoments (sources, "moments.dat");
    43 
    4437    psLogMsg ("psphot", 3, "moments: %f sec\n", psTimerMark ("psphot"));
    4538    psLogMsg ("psphot", 3, "%d sources\n", sources->n);
Note: See TracChangeset for help on using the changeset viewer.