IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 16, 2008, 12:36:18 PM (18 years ago)
Author:
eugene
Message:

replace NAXIS1,2 in header with IMNAXIS1,2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO.c

    r18601 r19087  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.63 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2008-07-17 22:38:15 $
     5 *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-08-16 22:36:18 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    424424                pmConfigConformHeader(hdu->header, file->format);
    425425
     426                // psFitsWriteBlank strips out the NAXISn keywords, forcing CFITSIO to take care of them
     427                // save NAXIS1,NAXIS2 as IMNAXIS1,IMNAXIS2
     428                int Nx = psMetadataLookupS32 (&status, hdu->header, "IMNAXIS1");
     429                if (!status) {
     430                    Nx = psMetadataLookupS32 (&status, hdu->header, "NAXIS1");
     431                    if (status) {
     432                        psMetadataAddS32 (hdu->header, PS_LIST_TAIL, "IMNAXIS1", PS_META_REPLACE, "original image size (x-dir)", Nx);
     433                    } else {
     434                        fprintf (stderr, "header is missing NAXIS1!");
     435                    }
     436                }
     437
     438                int Ny = psMetadataLookupS32 (&status, hdu->header, "IMNAXIS2");
     439                if (!status) {
     440                    Ny = psMetadataLookupS32 (&status, hdu->header, "NAXIS2");
     441                    if (status) {
     442                        psMetadataAddS32 (hdu->header, PS_LIST_TAIL, "IMNAXIS2", PS_META_REPLACE, "original image size (y-dir)", Ny);
     443                    } else {
     444                        fprintf (stderr, "header is missing NAXIS2!");
     445                    }
     446                }
     447
    426448                psFitsWriteBlank (file->fits, hdu->header, headname);
    427449                psTrace ("pmFPAfile", 5, "wrote ext head %s (type: %d)\n", file->filename, file->type);
Note: See TracChangeset for help on using the changeset viewer.