IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6771


Ignore:
Timestamp:
Apr 4, 2006, 12:06:11 PM (20 years ago)
Author:
Paul Price
Message:

Synching changes to psFitsReadImage (removed first argument) and psFitsWriteImage (added argument extname to end)

Location:
trunk/stac/src
Files:
6 edited

Legend:

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

    r5743 r6771  
    1616
    1717    // We only read PHUs --- not mucking around with extensions for now
    18     psImage *image = psFitsReadImage(NULL, inFile, imageRegion, 0);
     18    psImage *image = psFitsReadImage(inFile, imageRegion, 0);
    1919    if (image == NULL) {
    2020        psErrorStackPrint(stderr,"Fatal error: Unable to read %s\n", inName);
     
    4646
    4747    psFits *outFile = psFitsOpen(outName, "w");
    48     if (!psFitsWriteImage(outFile, NULL, grad, 0)) {
     48    if (!psFitsWriteImage(outFile, NULL, grad, 0, NULL)) {
    4949        psErrorStackPrint(stderr, "Unable to write image: %s\n", outName);
    5050    }
  • trunk/stac/src/combine.c

    r6330 r6771  
    5858
    5959    psFits *outFile = psFitsOpen(config->outName, "w");
    60     if (!psFitsWriteImage(outFile, headers->data[0], combined, 0)) {
     60    if (!psFitsWriteImage(outFile, headers->data[0], combined, 0, NULL)) {
    6161        psErrorStackPrint(stderr, "Unable to write image: %s\n", config->outName);
    6262    }
  • trunk/stac/src/shift.c

    r5743 r6771  
    9090    psRegion imageRegion = {0, 0, 0, 0}; // Region of image to read
    9191    psMetadata *header = psFitsReadHeader(NULL, imageFile); // FITS header
    92     psImage *image = psFitsReadImage(NULL, imageFile, imageRegion, 0);
     92    psImage *image = psFitsReadImage(imageFile, imageRegion, 0);
    9393    if (image == NULL) {
    9494        psErrorStackPrint(stderr, "Fatal error: Unable to read %s\n", inName);
     
    155155        psTrace("stac", 3, "Clipping %d NaN pixels to zero.\n", numPix);
    156156    }
    157     if (!psFitsWriteImage(outFile, header, transformed->data[0], 0)) {
     157    if (!psFitsWriteImage(outFile, header, transformed->data[0], 0, NULL)) {
    158158        psErrorStackPrint(stderr, "Unable to write image: %s\n", outName);
    159159    }
  • trunk/stac/src/stac.c

    r5745 r6771  
    160160            image = psImageCopy(NULL, transformed->data[i], PS_TYPE_F32);
    161161            (void)psImageClipNaN(image, 0.0);
    162             if (!psFitsWriteImage(shiftFile, headers->data[i], image, 0)) {
     162            if (!psFitsWriteImage(shiftFile, headers->data[i], image, 0, NULL)) {
    163163                psErrorStackPrint(stderr, "Unable to write image: %s\n", shiftName);
    164164            }
     
    266266        psTrace("stac", 3, "Clipping %d NaN pixels to zero.\n", numPix);
    267267    }
    268     if (!psFitsWriteImage(outFile, headers->data[0], combined, 0)) {
     268    if (!psFitsWriteImage(outFile, headers->data[0], combined, 0, NULL)) {
    269269        psErrorStackPrint(stderr, "Unable to write image: %s\n", config->output);
    270270    }
  • trunk/stac/src/stacRead.c

    r6485 r6771  
    2424        psTrace("stac.read.images", 2, "Reading input image %s....\n",filenames->data[i]);
    2525        psFits *imageFile = psFitsOpen(filenames->data[i], "r");
     26        if (!imageFile) {
     27            psError(PS_ERR_IO, false, "Unable to open FITS file %s.\n", filenames->data[i]);
     28            exit(EXIT_FAILURE);
     29        }
    2630        // We only read PHUs --- not mucking around with extensions for now
    2731        if (headers) {
    2832            (*headers)->data[i] = psFitsReadHeader(NULL, imageFile);
    2933        }
    30         psImage *image = psFitsReadImage(NULL, imageFile, imageRegion, 0);
     34        psImage *image = psFitsReadImage(imageFile, imageRegion, 0);
    3135        if (image == NULL) {
    3236            psErrorStackPrint(stderr,"Fatal error: Unable to read %s\n",filenames->data[i]);
  • trunk/stac/src/sum.c

    r5745 r6771  
    2222        psFits *fits = psFitsOpen(inputNames->data[i], "r"); // FITS file
    2323        psRegion readRegion = {0, 0, 0, 0}; // Region to read
    24         psImage *image = psFitsReadImage(NULL, fits, readRegion, 0);
     24        psImage *image = psFitsReadImage(fits, readRegion, 0);
    2525        if (numCols == 0 && numRows == 0) {
    2626            // First run through --- set the size, initialise the output, read the header
     
    7575
    7676    psFits *fits = psFitsOpen(outputName, "w");
    77     (void)psFitsWriteImage(fits, header, output, 0);
     77    (void)psFitsWriteImage(fits, header, output, 0, NULL);
    7878    psFitsClose(fits);
    7979    psFree(output);
Note: See TracChangeset for help on using the changeset viewer.