IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2007, 12:42:02 PM (19 years ago)
Author:
Paul Price
Message:

Reworking image interpolation to work on mask and variance image
simultaneously with the proper image. Working in the idea of having
"good", "bad" and "poor" output mask pixels (taken from Andy Becker),
where "poor" pixels have at least one bad input pixel contributing to
the flux, but the contribution is small (where 'small' is defined by a
user option). To handle all the options, created a
psImageInterpolateOptions structure, which contains all the things
which are constant while looping over an image (including the input
image, variance and mask). Changed function name, and split code out
of psImage.[ch] into its own file. Function returns boolean error
status; output values for image, variance and mask come from pointers
to double. Added interpolation types (GAUSS, LANCZOS2, LANCZOS3,
LANCZOS4). Using a fairly general framework so that additional
interpolation methods might be easily added. Updated tests and other
dependent code. Tests pass (but only test BILINEAR and BICUBE), and
pswarp works (but currently only uses BILINEAR).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageConvolve.c

    r12187 r12741  
    77/// @author Eugene Magnier, IfA
    88///
    9 /// @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
    10 /// @date $Date: 2007-03-02 22:19:21 $
     9/// @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
     10/// @date $Date: 2007-04-04 22:42:02 $
    1111///
    1212/// Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    102102                           const psVector *xShifts,
    103103                           const psVector *yShifts,
    104                            bool tRelative,
     104                           float totalTime,
    105105                           bool xyRelative)
    106106{
     
    113113    PS_ASSERT_VECTOR_TYPE(xShifts, PS_TYPE_S32, NULL);
    114114    PS_ASSERT_VECTOR_TYPE(yShifts, PS_TYPE_S32, NULL);
     115
     116    if (isnan(totalTime)) {
     117        // It's more expensive to check for NAN than 0.0
     118        totalTime = 0.0;
     119    }
    115120
    116121    // If there are no shifts, the kernel is just a 1 at 0,0
     
    153158        }
    154159
    155         if (tRelative) {
     160        if (totalTime <= 0) {
    156161            tSum += tShifts->data.F32[i];
    157162        }
     
    160165    psTrace("psLib.imageops", 5, "Kernel range: %d:%d,%d:%d\n", xMin, xMax, yMin, yMax);
    161166
    162     if (!tRelative) {
     167    if (totalTime > 0) {
    163168        // Then the total time is simply the final value
    164169        // NB: We assume the counter starts at zero!
    165         tSum = tShifts->data.F32[tShifts->n - 1];
     170        tSum = totalTime;
    166171    }
    167172
     
    181186        }
    182187        float t = tShifts->data.F32[i];
    183         if (!tRelative) {
     188        if (totalTime > 0) {
    184189            t -= tLast;
    185190            tLast = tShifts->data.F32[i];
Note: See TracChangeset for help on using the changeset viewer.