IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2009, 11:43:02 AM (17 years ago)
Author:
bills
Message:

Fix compression by looking up the compression type in the input header
and setting it to the output. In the process of doing this competely localized
the setting of compression parameters in copyFitsOptions, so three times as
many lines are deleted by this delta as added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksio.c

    r24283 r24286  
    602602
    603603static void
    604 setFitsOptions(sFile *sfile, int bitpix, float bscale, float bzero)
     604setFitsOptions(sFile *sfile, int bitpix, float bscale, float bzero, psFitsCompressionType compType,
     605    psVector *tiles)
    605606{
    606607    if (!sfile) {
     
    615616    sfile->fits->options->bscale = bscale;
    616617    sfile->fits->options->bzero = bzero;
    617 }
    618 
    619 void
    620 copyFitsOptions(sFile *out, sFile *rec, sFile *in)
    621 {
     618
     619    psFitsSetCompression(sfile->fits, compType, tiles, 8, 0, 0);
     620}
     621
     622void
     623copyFitsOptions(sFile *out, sFile *rec, sFile *in, psVector *tiles)
     624{
     625    bool mdok;
     626    psString compTypeStr = psMetadataLookupStr(&mdok, in->header, "ZCMPTYPE");
     627    psFitsCompressionType compType = psFitsCompressionTypeFromString(compTypeStr);
     628    if (compType == PS_FITS_COMPRESS_NONE) {
     629        return;
     630    }
    622631    // Get current BITPIX, BSCALE, BZERO, EXTNAME
    623632    // Probably not necessary to look the numerical values up in this
     
    646655
    647656#ifdef STREAKS_COMPRESS_OUTPUT
    648     // Paul says that I should be able to leave this blank
    649     bitpix = 0;
    650     setFitsOptions(out, bitpix, bscale, bzero);
    651     setFitsOptions(rec, bitpix, bscale, bzero);
     657    // printf("%d %f %f\n", bitpix, bscale, bzero);
     658    setFitsOptions(out, bitpix, bscale, bzero, compType, tiles);
     659    setFitsOptions(rec, bitpix, bscale, bzero, compType, tiles);
    652660#endif
    653661}
Note: See TracChangeset for help on using the changeset viewer.