IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 18, 2006, 12:20:45 PM (20 years ago)
Author:
Paul Price
Message:

Updating to use psLib rel11. Main problem was that vector and array lengths ('n' element) are no longer set to equal the number of allocated values ('nalloc' element) when allocated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/stacScales.c

    r5745 r6887  
    1919    psVector *values = psVectorAlloc(numSamples + 1, PS_TYPE_F32); // Vector containing sub-sample
    2020    psVector *mask = psVectorAlloc(numSamples + 1, PS_TYPE_U8); // Mask for sample
     21    values->n = numSamples + 1;
     22    mask->n = numSamples + 1;
    2123
    2224    int offset = 0;                     // Offset from start of the row
     
    8486    } else {
    8587        scales = psVectorAlloc(images->n, PS_TYPE_F32);
     88        scales->n = images->n;
    8689        *scalesPtr = scales;
    8790    }
     
    9396    } else {
    9497        offsets = psVectorAlloc(images->n, PS_TYPE_F32);
     98        offsets->n = images->n;
    9599        *offsetsPtr = offsets;
    96100    }
     
    122126        // Transform the stellar positions to match the transformed reference frame
    123127        psArray *starCoordsTransformed = psArrayAlloc(starCoords->n); // Transformed positions
     128        starCoordsTransformed->n = starCoords->n;
    124129        // Fix up difference between map and output frame
    125130        starMap->x->coeff[0][0] -= xMapDiff;
     
    132137        psArray *stars = psArrayAlloc(images->n); // Array of stellar photometry vectors
    133138        psArray *masks = psArrayAlloc(images->n); // Array of masks for stars
     139        stars->n = images->n;
     140        masks->n = images->n;
    134141
    135142        // Set scales relative to the first image
     
    144151            psVector *photometry = psVectorAlloc(starCoords->n, PS_TYPE_F32); // Photometry of the stars
    145152            psVector *mask = psVectorAlloc(starCoords->n, PS_TYPE_U8); // Mask for the photometry
     153            photometry->n = starCoords->n;
     154            mask->n = starCoords->n;
    146155            for (int j = 0; j < starCoordsTransformed->n; j++) {
    147156                psPlane *coords = starCoordsTransformed->data[j]; // The coordinates of the star
Note: See TracChangeset for help on using the changeset viewer.