IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4425


Ignore:
Timestamp:
Jun 28, 2005, 3:39:10 PM (21 years ago)
Author:
gusciora
Message:

psTrace message modifications.

Location:
trunk/psModules/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmImageCombine.c

    r4290 r4425  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-06-16 23:11:41 $
     10 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-06-29 01:39:10 $
    1212 *
    1313 *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
     
    4747                        )
    4848{
     49
    4950    PS_ASSERT_PTR_NON_NULL(images, combine);
    5051    psU32 numImages = images->n;
     52    psTrace("ImageCombine.pmCombineImages", 3, "Calling pmCombineImages(%d)\n", images->n);
    5153
    5254    if (errors != NULL) {
     
    299301    psFree(qpPtr);
    300302
     303    psTrace("ImageCombine.pmCombineImages", 3, "Exiting pmCombineImages(%d)\n", images->n);
    301304    return(combine);
    302305}
     
    311314                          psS32 y)
    312315{
     316    psTrace("ImageCombine.CalcGradient", 4, "Calling CalcGradient(%d, %d)\n", x, y);
    313317    int num = 0;
    314318    psVector *pixels = psVectorAlloc(8, PS_TYPE_F32); // Array of pixels
     
    339343    psFree(pixels);
    340344    psFree(mask);
    341     return median / image->data.F32[y][x];
     345
     346    psTrace("ImageCombine.CalcGradient", 4, "Exiting CalcGradient(%d, %d)\n", x, y);
     347    return(median / image->data.F32[y][x]);
    342348}
    343349
     
    355361                                psPlaneTransform *myOutToIn)
    356362{
     363    psTrace("ImageCombine.DetermineRegion", 4, "Calling DetermineRegion()\n");
    357364    psRegion myRegion;
    358365    myRegion.x0 = PS_MAX_F32;
     
    429436    }
    430437
     438    psTrace("ImageCombine.DetermineRegion", 4, "Exiting DetermineRegion()\n");
    431439    return(myRegion);
    432440}
     
    437445static psImage *ImageConvertF32(psImage *image)
    438446{
     447    psTrace("ImageCombine.ImageConvertF32", 4, "Calling ImageConvertF32()\n");
    439448    psImage *imgF32 = psImageAlloc(image->numCols, image->numRows, PS_TYPE_F32);
    440449
     
    445454    }
    446455
     456    psTrace("ImageCombine.ImageConvertF32", 4, "Exiting ImageConvertF32()\n");
    447457    return(imgF32);
    448458}
     
    472482                       )
    473483{
     484    psTrace("ImageCombine.pmRejectPixels", 3, "Calling pmRejectPixels()\n");
    474485    PS_ASSERT_PTR_NON_NULL(images, NULL);
    475486    PS_ASSERT_PTR_NON_NULL(errors, NULL);
     
    609620    psFree(inCoords);
    610621    psFree(outCoords);
     622    psTrace("ImageCombine.pmRejectPixels", 3, "Exiting pmRejectPixels()\n");
    611623    return(rejects);
    612624}
  • trunk/psModules/src/pmReadoutCombine.c

    r4168 r4425  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-06-09 00:59:54 $
     7 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-06-29 01:39:10 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1818
    1919/******************************************************************************
    20 p_psDetermineNumBits(data): This routine takes an enum psStatsOptions as an
     20DetermineNumBits(data): This routine takes an enum psStatsOptions as an
    2121argument and returns the number of non-zero bits.
    2222 *****************************************************************************/
    23 psStatsOptions DetermineNumBits(psStatsOptions data)
     23static psS32 DetermineNumBits(psStatsOptions data)
    2424{
    2525    psS32 i;
     
    2727    psS32 numBits = 0;
    2828
    29     for (i=0;i<8 * sizeof(psStatsOptions);i++) {
     29    for (i=0;i<(8 * sizeof(psStatsOptions));i++) {
    3030        if (0x0001 & tmpData) {
    3131            numBits++;
     
    3737
    3838/******************************************************************************
    39 p_psDetermineNumBits(data): This routine takes an enum psStatsOptions as an
    40 argument and returns the number of non-zero bits.
    41  
    4239XXX: Must add support for S16 and S32 types.  F32 currently supported.
    4340 *****************************************************************************/
  • trunk/psModules/src/pmSubtractSky.c

    r4030 r4425  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-05-25 20:28:32 $
     8 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-06-29 01:39:10 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    12 xd *
     12 *
     13 *     
     14 *
    1315 */
    1416
     
    2022
    2123/******************************************************************************
    22 p_psDetermineNumBits(data): This routine takes an enum psStatsOptions as an
     24DetermineNumBits(data): This routine takes an enum psStatsOptions as an
    2325argument and returns the number of non-zero bits.
     26 
     27XXX: This code is duplicated in the ReadoutCombine file.
    2428 *****************************************************************************/
    25 psStatsOptions p_psDetermineNumBits(psStatsOptions data)
     29static psS32 DetermineNumBits(psStatsOptions data)
    2630{
     31    psTrace("SubtractSky.DetermineNumBits", 4, "Calling DetermineNumBits(0x%x)\n", data);
     32
    2733    psS32 i;
    2834    psU64 tmpData = data;
    2935    psS32 numBits = 0;
    3036
    31     for (i=0;i<8 * sizeof(psStatsOptions);i++) {
     37    for (i=0;i<(8 * sizeof(psStatsOptions));i++) {
    3238        if (0x0001 & tmpData) {
    3339            numBits++;
     
    3541        tmpData = tmpData >> 1;
    3642    }
     43
     44    psTrace("SubtractSky.DetermineNumBits", 4,
     45            "Calling DetermineNumBits(0x%x) -> %d\n", data, numBits);
    3746    return(numBits);
    3847}
     
    4352option set according to the precedence set in the SDRS.
    4453 *****************************************************************************/
    45 psU64 getHighestPriorityStatOption(psU64 statOptions)
     54static psU64 getHighestPriorityStatOption(psU64 statOptions)
    4655{
     56    psTrace("SubtractSky.getHighestPriorityStatOption", 4,
     57            "Calling getHighestPriorityStatOption(0x%x)\n", statOptions);
     58
    4759    if (statOptions & PS_STAT_SAMPLE_MEAN) {
    4860        return(PS_STAT_SAMPLE_MEAN);
     
    7284requirements change and we might need a custom reBin function.
    7385 *****************************************************************************/
    74 psImage *binImage(psImage *origImage,
    75                   int binFactor,
    76                   psStatsOptions statOptions)
     86/*
     87static psImage *binImage(psImage *origImage,
     88                         int binFactor,
     89                         psStatsOptions statOptions)
    7790{
     91    psTrace("SubtractSky.binImage", 4, "Calling binImage(%d)\n", binFactor);
     92 
    7893    if (binFactor <= 0) {
    7994        psLogMsg(__func__, PS_LOG_WARN,
     
    8499        return(origImage);
    85100    }
    86 
     101 
    87102    psVector *binVector = psVectorAlloc(binFactor * binFactor, PS_TYPE_F32);
    88103    psVector *binMask = psVectorAlloc(binFactor * binFactor, PS_TYPE_U8);
    89104    psStats *myStats = psStatsAlloc(statOptions);
    90 
     105 
    91106    for (psS32 row = 0; row < origImage->numRows ; row+=binFactor) {
    92107        for (psS32 col = 0; col < origImage->numCols ; col+=binFactor) {
     
    113128            psF64 statValue;
    114129            psBool rc = p_psGetStatValue(rc1, &statValue);
    115 
     130 
    116131            if (rc == true) {
    117132                origImage->data.F32[row][col] = (psF32) statValue;
     
    126141    psFree(binMask);
    127142    psFree(myStats);
    128 
     143 
     144    psTrace("SubtractSky.binImage", 4, "Exiting binImage(%d)\n", binFactor);
    129145    return(origImage);
    130146}
     147*/
    131148
    132149/******************************************************************************
    133150CalculatePolyTerms(xOrder, yOrder): this routine will calculate the number of
    134151coefficients (or terms) in a 2-D polynomial of order (xOrder, yOrder).
     152 
     153XXX: Use your brain and figure out the analytical expression.
    135154 *****************************************************************************/
    136 psS32 CalculatePolyTerms(psS32 xOrder, psS32 yOrder)
     155static psS32 CalculatePolyTerms(psS32 xOrder, psS32 yOrder)
    137156{
     157    psTrace("SubtractSky.CalculatePolyTerms", 4,
     158            "Calling CalculatePolyTerms(%d, %d)\n", xOrder, yOrder);
     159
    138160    psS32 maxOrder = PS_MAX(xOrder, yOrder);
    139161    psS32 localPolyTerms = 0;
     
    148170        }
    149171    }
     172
     173    psTrace("SubtractSky.CalculatePolyTerms", 4,
     174            "Exiting CalculatePolyTerms(%d, %d) -> %d\n", xOrder, yOrder, localPolyTerms);
    150175    return(localPolyTerms);
    151176}
     
    162187    poly-order sky background polynomial.
    163188 *****************************************************************************/
    164 psS32 **buildPolyTerms(psS32 xOrder, psS32 yOrder)
     189static psS32 **buildPolyTerms(psS32 xOrder, psS32 yOrder)
    165190{
     191    psTrace("SubtractSky.buildPolyTerms", 4,
     192            "Calling buildPolyTerms(%d, %d)\n", xOrder, yOrder);
     193
    166194    psS32 i=0;
    167195    psS32 order = 0;
     
    196224    }
    197225
     226    psTrace("SubtractSky.buildPolyTerms", 4,
     227            "Exiting buildPolyTerms(%d, %d)\n", xOrder, yOrder);
    198228    return(polyTerms);
    199229}
     
    206236 
    207237XXX: Use a psImage for the p_psPolySums data structure?
     238XXX: p_psPolySums: should this be a global?  Did you get the storage classifier
     239     and name correct?
    208240XXX: Use variable size arrays for p_psPolySums[][].
    209241XXX: Must initialize p_psPolySums[][]?
    210242 *****************************************************************************/
    211243#define PS_MAX_POLYNOMIAL_ORDER 20
     244
    212245psF64 p_psPolySums[PS_MAX_POLYNOMIAL_ORDER+1][PS_MAX_POLYNOMIAL_ORDER+1];
    213 void buildSums(psF64 x,
    214                psF64 y,
    215                psS32 xOrder,
    216                psS32 yOrder)
     246static void buildSums(psF64 x,
     247                      psF64 y,
     248                      psS32 xOrder,
     249                      psS32 yOrder)
    217250{
     251    psTrace("SubtractSky.buildPolyTerms", 4,
     252            "Calling buildPolyTerms(%d, %d)\n", xOrder, yOrder);
     253
    218254    psS32 i = 0;
    219255    psS32 j = 0;
     
    231267        xSum*= x;
    232268    }
     269    psTrace("SubtractSky.buildPolyTerms", 4,
     270            "Exiting buildPolyTerms(%d, %d)\n", xOrder, yOrder);
    233271}
    234272
     
    242280used in this routine is based on that of the pilot project ADD, but is not
    243281documented anywhere.
     282 
     283XXX: Different trace message facilities in use here.
    244284 *****************************************************************************/
    245 psPolynomial2D *ImageFitPolynomial(psPolynomial2D *myPoly,
    246                                    psImage *dataImage,
    247                                    psImage *maskImage)
     285static psPolynomial2D *ImageFitPolynomial(psPolynomial2D *myPoly,
     286        psImage *dataImage,
     287        psImage *maskImage)
    248288{
    249     psTrace(".psModule.pmSubtractSky.ImageFitPolynomial", 4,
    250             "---- ImageFitPolynomial() begin ----\n");
     289    psTrace("SubtractSky.ImageFitPolynomial", 4,
     290            "Calling ImageFitPolynomial()\n");
    251291    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    252292    PS_ASSERT_POLY_TYPE(myPoly, PS_POLYNOMIAL_ORD, NULL);
     
    404444    }
    405445
    406     psTrace(".psModule.pmSubtractSky.ImageFitPolynomial", 4,
    407             "---- ImageFitPolynomial() end successfully ----\n");
     446    psTrace("SubtractSky.ImageFitPolynomial", 4,
     447            "Exiting ImageFitPolynomial()\n");
     448    //    psTrace(".psModule.pmSubtractSky.ImageFitPolynomial", 4,
     449    //            "---- ImageFitPolynomial() end successfully ----\n");
    408450    return(myPoly);
    409451}
     
    416458 
    417459XXX: The SDR is silent about types.  PS_TYPE_F32 is implemented here.
     460 
     461XXX: Sync the psTrace message facilities.
    418462 *****************************************************************************/
    419463psReadout *pmSubtractSky(psReadout *in,
     
    459503    if (stats != NULL) {
    460504        statOptions = stats->options;
    461         if (1 < p_psDetermineNumBits(statOptions)) {
     505        if (1 < DetermineNumBits(statOptions)) {
    462506            psLogMsg(__func__, PS_LOG_WARN, "WARNING: Multiple statistical options have been requested.\n");
    463507            statOptions = getHighestPriorityStatOption(statOptions);
     
    470514            stats->options = statOptions;
    471515        }
    472         if (0 == p_psDetermineNumBits(statOptions)) {
     516        if (0 == DetermineNumBits(statOptions)) {
    473517            psLogMsg(__func__, PS_LOG_WARN,
    474518                     "WARNING: pmSubtractSky(): no stats->options was requested\n");
     
    492536    // Create a new binned image mask.
    493537    //
    494     if ((binFactor <= 1) || (stats == NULL) || (0 == p_psDetermineNumBits(statOptions))) {
     538    if ((binFactor <= 1) || (stats == NULL) || (0 == DetermineNumBits(statOptions))) {
    495539        // No binning is required here.  Simply create a copy of the image
    496540        // and a mask.
Note: See TracChangeset for help on using the changeset viewer.