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/stacCombine.c

    r5745 r6887  
    103103    psVector *deltas = psVectorAlloc(nImages, PS_TYPE_F32); // Will hold the errors in the statistics step
    104104    psVector *mask = psVectorAlloc(nImages, PS_TYPE_U8); // Will hold the mask in the statistics step
     105    pixels->n = nImages;
     106    deltas->n = nImages;
     107    mask->n = nImages;
    105108
    106109    // Set up rejection masks
     
    109112            // Allocate the rejection masks, if required
    110113            *rejected = psArrayAlloc(nImages);
     114            (*rejected)->n = nImages;
    111115        } else {
    112116            assert((*rejected)->n != nImages);
     
    202206    char chiName[MAXCHAR];              // Filename of chi^2 image
    203207    sprintf(chiName,"chi2_%d.fits",iteration);
    204     psFits *chiFile = psFitsAlloc(chiName);
    205     if (!psFitsWriteImage(chiFile, NULL, chi2 , 0)) {
     208    psFits *chiFile = psFitsOpen(chiName, "w");
     209    if (!psFitsWriteImage(chiFile, NULL, chi2 , 0, NULL)) {
    206210        psErrorStackPrint(stderr, "Unable to write image: %s\n", chiName);
    207211    }
    208212    psTrace("stac.combine", 1, "Chi^2 image written to %s\n", chiName);
    209     psFree(chiFile);
     213    psFitsClose(chiFile);
    210214    psFree(chi2);
    211215#endif
Note: See TracChangeset for help on using the changeset viewer.