IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2008, 12:47:04 PM (18 years ago)
Author:
Paul Price
Message:

Statistics are only required when fitting a trend. If we load a trend (e.g., pmPSFmodelRead) then we don't need the statistics. Similar to psImageMap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmTrend2D.h

    r15842 r19961  
    55 * @author EAM, IfA
    66 *
    7  * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-12-15 01:23:18 $
     7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2008-10-07 22:47:04 $
    99 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1010 */
     
    3333} pmTrend2D;
    3434
     35// Assertion for pmTrend2D
     36#define PM_ASSERT_TREND2D_NON_NULL(TREND, RVAL) \
     37if (!(TREND)) { \
     38    psError(PS_ERR_UNEXPECTED_NULL, true, "Trend %s is NULL", #TREND); \
     39    return RVAL; \
     40} \
     41if ((TREND)->mode == PM_TREND_MAP) { \
     42    PS_ASSERT_IMAGE_MAP_NON_NULL((TREND)->map, RVAL); \
     43} else if ((TREND)->mode == PM_TREND_POLY_ORD || (TREND)->mode == PM_TREND_POLY_CHEB) { \
     44    PS_ASSERT_POLY_NON_NULL((TREND)->poly, RVAL); \
     45} else if ((TREND)->mode != PM_TREND_NONE) { \
     46    psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unknown trend mode for %s: %x", #TREND, (TREND)->mode); \
     47    return RVAL; \
     48}
     49
     50#define PM_ASSERT_TREND2D_STATS(TREND, RVAL) \
     51if (!(TREND)->stats) { \
     52    psError(PS_ERR_UNEXPECTED_NULL, true, "Trend %s statistics is NULL", #TREND); \
     53    return RVAL; \
     54}
     55
     56
    3557// allocate a pmTrend2D structure tied to an image dimensions.  nXtrend,nYtrend is the order for the polynomials, max number of grid cells for
    3658// psImageMap
    37 pmTrend2D *pmTrend2DAlloc (pmTrend2DMode mode, psImage *image, int nXtrend, int nYtrend, psStats *stats);
     59pmTrend2D *pmTrend2DAlloc(pmTrend2DMode mode,
     60                          psImage *image,
     61                          int nXtrend, int nYtrend,
     62                          psStats *stats
     63);
    3864
    39 bool psMemCheckTrend2D(psPtr ptr);
     65bool psMemCheckTrend2D(psPtr ptr
     66    );
    4067
    41 pmTrend2D *pmTrend2DNoImageAlloc (pmTrend2DMode mode, psImageBinning *binning, psStats *stats);
     68pmTrend2D *pmTrend2DNoImageAlloc(pmTrend2DMode mode,
     69                                 psImageBinning *binning,
     70                                 psStats *stats
     71    );
    4272
    4373// allocate a pmTrend2D tied to an abstract field with size nXfield,nYfield
    44 pmTrend2D *pmTrend2DFieldAlloc (pmTrend2DMode mode, int nXfield, int nYfield, int nXtrend, int nYtrend, psStats *stats);
     74pmTrend2D *pmTrend2DFieldAlloc(pmTrend2DMode mode,
     75                               int nXfield, int nYfield,
     76                               int nXtrend, int nYtrend,
     77                               psStats *stats
     78    );
    4579
    46 bool pmTrend2DFit (pmTrend2D *trend, psVector *mask, psMaskType maskVal, psVector *x, psVector *y, psVector *f, psVector *df);
     80bool pmTrend2DFit(pmTrend2D *trend,
     81                  psVector *mask,       // Warning: mask is modified!
     82                  psMaskType maskVal,
     83                  const psVector *x,
     84                  const psVector *y,
     85                  const psVector *f,
     86                  const psVector *df
     87    );
    4788
    48 double pmTrend2DEval (pmTrend2D *trend, float x, float y);
    49 psVector *pmTrend2DEvalVector (pmTrend2D *trend, psVector *x, psVector *y);
     89double pmTrend2DEval(const pmTrend2D *trend,
     90                     float x, float y
     91    );
     92psVector *pmTrend2DEvalVector(const pmTrend2D *trend,
     93                              const psVector *x, const psVector *y
     94    );
    5095
    51 psString pmTrend2DModeToString (pmTrend2DMode mode);
    52 pmTrend2DMode pmTrend2DModeFromString (psString name);
     96psString pmTrend2DModeToString(pmTrend2DMode mode);
     97pmTrend2DMode pmTrend2DModeFromString(psString name);
    5398
    5499/// @}
Note: See TracChangeset for help on using the changeset viewer.