IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) {
Note: See TracChangeset for help on using the changeset viewer.