IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 2, 2009, 12:04:51 PM (16 years ago)
Author:
Paul Price
Message:

Merging Gene's work on adding a window function to the stamps. I'd been thinking about something like this for a while, so glad someone's done it. It's got visualisation turned on though.

Location:
branches/pap/psModules/src/imcombine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/psModules/src/imcombine

  • branches/pap/psModules/src/imcombine/pmSubtractionKernels.c

    r26156 r26321  
    111111
    112112pmSubtractionKernels *p_pmSubtractionKernelsRawISIS(int size, int spatialOrder,
    113                                                     const psVector *fwhms, const psVector *orders,
     113                                                    const psVector *fwhmsIN, const psVector *ordersIN,
    114114                                                    float penalty, pmSubtractionMode mode)
    115115{
    116     PS_ASSERT_VECTOR_NON_NULL(fwhms, NULL);
    117     PS_ASSERT_VECTOR_TYPE(fwhms, PS_TYPE_F32, NULL);
    118     PS_ASSERT_VECTOR_NON_NULL(orders, NULL);
    119     PS_ASSERT_VECTOR_TYPE(orders, PS_TYPE_S32, NULL);
    120     PS_ASSERT_VECTORS_SIZE_EQUAL(fwhms, orders, NULL);
     116    PS_ASSERT_VECTOR_NON_NULL(fwhmsIN, NULL);
     117    PS_ASSERT_VECTOR_TYPE(fwhmsIN, PS_TYPE_F32, NULL);
     118    PS_ASSERT_VECTOR_NON_NULL(ordersIN, NULL);
     119    PS_ASSERT_VECTOR_TYPE(ordersIN, PS_TYPE_S32, NULL);
     120    PS_ASSERT_VECTORS_SIZE_EQUAL(fwhmsIN, ordersIN, NULL);
    121121    PS_ASSERT_INT_POSITIVE(size, NULL);
    122122    PS_ASSERT_INT_NONNEGATIVE(spatialOrder, NULL);
     123
     124    // check the requested fwhm values: any values <= 0.0 should be dropped
     125    psVector *fwhms  = psVectorAllocEmpty (fwhmsIN->n, PS_TYPE_F32);
     126    psVector *orders = psVectorAllocEmpty (ordersIN->n, PS_TYPE_S32);
     127    for (int i = 0; i < fwhmsIN->n; i++) {
     128        if (fwhmsIN->data.F32[i] <= FLT_EPSILON) continue;
     129        psVectorAppend(fwhms, fwhmsIN->data.F32[i]);
     130        psVectorAppend(orders, ordersIN->data.S32[i]);
     131    }
    123132
    124133    int numGaussians = fwhms->n;       // Number of Gaussians
Note: See TracChangeset for help on using the changeset viewer.