IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12627


Ignore:
Timestamp:
Mar 28, 2007, 9:03:59 AM (19 years ago)
Author:
eugene
Message:

adding source plots and radial plots

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

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/Makefile.am

    r12587 r12627  
    4949        psphotMergeSources.c     \
    5050        psphotReadoutCleanup.c   \
     51        psphotAddNoise.c         \
     52        psphotSourcePlots.c      \
     53        psphotRadialPlot.c       \
    5154        psphotCleanup.c         
    5255
  • trunk/psphot/src/psphot.h

    r12587 r12627  
    103103psExit psphotGetExitStatus ();
    104104bool psphotSetHeaderNstars (psMetadata *recipe, psArray *sources);
     105bool psphotAddNoise (pmReadout *readout, psArray *sources, psMetadata *recipe, bool add);
     106bool psphotRadialPlot (const char *filename, pmSource *source);
     107bool psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe);
  • trunk/psphot/src/psphotSourcePlots.c

    r12626 r12627  
    1010    PS_ASSERT (status);
    1111
    12     int NX = 10*(2*OUTER+1);
    13     int NY = 0;
    14 
    1512    // examine PSF sources in S/N order (brightest first)
    1613    sources = psArraySort (sources, psphotSortBySN);
    1714
    18     bool newRow = true;
     15    // counters to track the size of the image and area used in a row
     16    int dX = 0;                         // starting corner of next box
     17    int dY = 0;                         // height of row so far
     18    int NX = 10*(2*OUTER+1);            // full width of output image
     19    int NY = 0;                         // total height of output image
    1920
    2021    // first, examine the PSF and SAT stars:
     
    3031        if (!keep) continue;
    3132
    32         if (newRow) {
    33             dX = 0;
    34             dY = 0;
    35             newRow = false;
     33        // how does this subimage get placed into the output image?
     34        if (dX + source->pixels->numCols >= NX) {
     35            // too wide for the rest of this row
     36            if (dX == 0) {
     37                // alone on this row
     38                NY += source->pixels->numRows;
     39                dX = 0;
     40                dY = 0;
     41            } else {
     42                // start the next row
     43                NY += dY;
     44                dX = source->pixels->numCols;
     45                dY = source->pixels->numRows;
     46            }
     47        } else {
     48            // extend this row
     49            dX += source->pixels->numCols;
     50            dY = PS_MAX (dY, source->pixels->numRows);
    3651        }
    37 
    38         if (dX + source->pixels->numCols > NX) {
    39             // go to the next row
    40             // but, if we have only this one entry, we will truncate it.
    41         }
    42         dX += source->pixels->numCols;
    43         dY = PS_MAX (dY, source->pixels->numRows);
    44 
    45         // for a new row:
    46         NY += dY;
    47 
    48         RadialPlot (source);
     52        psphotRadialPlot ("radial.plots.ps", source);
    4953    }
    5054
    5155    // allocate output image
    52     psImage *output = psImageAlloc (NX, NY, PS_TYPE_F32);
     56    psImage *outpos = psImageAlloc (NX, NY, PS_TYPE_F32);
     57    psImage *outsub = psImageAlloc (NX, NY, PS_TYPE_F32);
     58
     59    int Xo = 0;                         // starting corner of next box
     60    int Yo = 0;                         // starting corner of next box
     61    int dY = 0;                         // height of row so far
    5362
    5463    // first, examine the PSF and SAT stars:
     
    6473        if (!keep) continue;
    6574
    66         // add to image
     75        // how does this subimage get placed into the output image?
     76        if (Xo + source->pixels->numCols >= NX) {
     77            // too wide for the rest of this row
     78            if (Xo == 0) {
     79                // alone on this row
     80                PlaceImage (source, Xo, Yo);
     81                Yo += source->pixels->numRows;
     82                Xo = 0;
     83                dY = 0;
     84            } else {
     85                // start the next row
     86                Yo += dY;
     87                Xo = 0;
     88                PlaceImage (source, Xo, Yo);
     89                Xo = source->pixels->numCols;
     90                dY = source->pixels->numRows;
     91            }
     92        } else {
     93            // extend this row
     94            PlaceImage (source, Xo, Yo);
     95            Xo += source->pixels->numCols;
     96            dY = PS_MAX (dY, source->pixels->numRows);
     97        }
    6798    }
    6899
    69100    psLogMsg ("psphot", PS_LOG_INFO, "%ld sources, %d moments, %d failed: %f sec\n", sources->n, Nmoments, Nfail, psTimerMark ("psphot"));
    70 
    71101    return (sources);
    72102}
    73103
    74 // XXX EAM : filter out bad peaks (eg, no valid pixels available for sky)
  • trunk/psphot/src/psphotSummaryPlots.c

    r10828 r12627  
    3333        return false;
    3434    }
    35 
    3635
    3736    KapaResize (kapa, 500, 500);
Note: See TracChangeset for help on using the changeset viewer.