IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15629


Ignore:
Timestamp:
Nov 15, 2007, 3:00:13 PM (18 years ago)
Author:
Paul Price
Message:

Adding support for choosing desired BITPIX, and for custom floating-point schemes.

Location:
trunk/psModules/src/camera
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfile.c

    r15180 r15629  
    7575    file->compression = NULL;
    7676    file->bitpix = 0;
     77    file->floatType = PS_FITS_FLOAT_NONE;
    7778    file->names = psMetadataAlloc();
    7879
  • trunk/psModules/src/camera/pmFPAfile.h

    r15562 r15629  
    44 * @author EAM, IfA
    55 *
    6  * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-11-10 01:09:20 $
     6 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-11-16 01:00:13 $
    88 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    99 */
     
    6666    psFitsCompression *compression;     // Compression for FITS images
    6767    int bitpix;                         // Bits per pixel for output
     68    psFitsFloat floatType;              // Custom floating-point
    6869
    6970    bool wrote_phu;                     // have we written a PHU for this file?
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r15562 r15629  
    219219            goto COMPRESSION_DONE;
    220220        }
    221         const char *typeString = psMetadataLookupStr(NULL, scheme, "COMPRESSION"); // Compression type
     221        const char *typeString = psMetadataLookupStr(NULL, scheme, "COMP"); // Compression type
    222222        if (!typeString || strlen(typeString) == 0) {
    223             psWarning("Can't find COMPRESSION in FITS scheme %s --- compression disabled.", fitsType);
     223            psWarning("Can't find COMP in FITS scheme %s --- compression disabled.", fitsType);
    224224            goto COMPRESSION_DONE;
    225225        }
     
    228228        psString source = NULL;         // Source of options
    229229        psStringAppend(&source, "%s in FITS in camera %s", fitsType, cameraName);
     230        file->bitpix = parseOptionInt(scheme, "BITPIX", source, 0); // Bits per pixel
     231
     232        // Custom floating-point
     233        const char *floatName = psMetadataLookupStr(NULL, scheme, "FLOAT"); // Name of custom floating-point
     234        if (floatName) {
     235            psString fullName = NULL;   // Full name of custom floating-point
     236            psStringAppend(&fullName, "FLOAT_%s", floatName);
     237            file->floatType = psFitsFloatTypeFromString(fullName);
     238            psFree(fullName);
     239        }
     240
    230241        psVector *tile = psVectorAlloc(3, PS_TYPE_S32); // Tile sizes
    231         file->bitpix = parseOptionInt(scheme, "BITPIX", source, 0); // Bits per pixel
    232242        tile->data.S32[0] = parseOptionInt(scheme, "TILE.X", source, 0); // Tiling in x
    233243        tile->data.S32[1] = parseOptionInt(scheme, "TILE.Y", source, 1); // Tiling in y
     
    438448                return NULL;
    439449            }
    440             // EXTWORD (fits->extword) is not relevant to the PHU
     450            // EXTWORD (fits->extword) is not relevant to the PHU
    441451            fits = psFitsOpen (realName, "r");
    442452            if (!fits) {
     
    557567            return NULL;
    558568        }
    559         // EXTWORD (fits->extword) is not relevant to the PHU
     569        // EXTWORD (fits->extword) is not relevant to the PHU
    560570        fits = psFitsOpen (realName, "r");
    561571        if (!fits) {
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r15562 r15629  
    762762        }
    763763
     764        file->fits->floatType = file->floatType;
     765
    764766        // In some cases, we need to read the PHU after we've opened the file.  This happens for the images
    765767        // supplied by the detrend database, which are only identified here (pmConfigConvertFilename).
Note: See TracChangeset for help on using the changeset viewer.