IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2006, 12:55:05 PM (20 years ago)
Author:
Paul Price
Message:

Following today's meeting, we agreed that psVectorAlloc (and therefore
psArrayAlloc also) shall set the number of elements in use to equal the
number of elements allocated. We introduce new functions,
psVectorAllocEmpty and psArrayAllocEmpty, that allocate a vector and set
the length to zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmShutterCorrection.c

    r9618 r9730  
    104104    psVector *tmpX = psVectorAlloc(2, PS_TYPE_F32);
    105105    psVector *tmpY = psVectorAlloc(2, PS_TYPE_F32);
    106     tmpX->n = tmpY->n = 2;
    107106
    108107    long index;
     
    210209    psVector *x = psVectorAlloc(exptime->n, PS_TYPE_F32);
    211210    psVector *y = psVectorAlloc(exptime->n, PS_TYPE_F32);
    212     x->n = y->n = exptime->n;
    213211
    214212    for (long i = 0; i < exptime->n; i++) {
     
    301299    params->data.F32[1] = guess->offset;
    302300    params->data.F32[2] = guess->offref;
    303     params->n = 3;
    304301
    305302    // XXX for the moment, don't set any constraints
     
    317314    // construct the coordinate and value entries (y is counts)
    318315    psArray *x = psArrayAlloc(exptime->n); // Coordinates
    319     x->n = exptime->n;
    320316
    321317    for (long i = 0; i < exptime->n; i++) {
    322318        psVector *coord = psVectorAlloc(1, PS_TYPE_F32);
    323         coord->n = 1;
    324319        coord->data.F32[0] = exptime->data.F32[i];
    325320        x->data[i] = coord;
     
    371366    psRegion refRegion;                 // Reference region
    372367    psVector *refs = psVectorAlloc(num, PS_TYPE_F32); // Reference measurements
    373     refs->n = num;
    374368    psVectorInit(refs, 0);
    375369    psArray *regions = psArrayAlloc(MEASURE_SAMPLES); // Array of sample regions, made on each image
    376     regions->n = MEASURE_SAMPLES;
    377370    psImage *samplesMean = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Measurements for each file
    378371    psImage *samplesStdev = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Errors for each file
     
    505498    psImage *pattern = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Illumination pattern
    506499    psVector *mask = psVectorAlloc(num, PS_TYPE_U8); // Mask for each image
    507     mask->n = num;
    508500    psVectorInit(mask, 0);
    509501    psTrace("psModules.detrend", 2, "Performing linear fit on individual pixels...\n");
Note: See TracChangeset for help on using the changeset viewer.