IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4191


Ignore:
Timestamp:
Jun 9, 2005, 9:40:51 AM (21 years ago)
Author:
desonia
Message:

removed extname from psFitsWrite* functions (Bug #412).

Location:
trunk/psLib
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/pslib.kdevses

    r4157 r4191  
    22<!DOCTYPE KDevPrjSession>
    33<KDevPrjSession>
    4  <DocsAndViews NumberOfDocuments="0" />
     4 <DocsAndViews NumberOfDocuments="1" >
     5  <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/dataIO/psFits.h" >
     6   <View0 line="242" Type="Source" />
     7  </Doc0>
     8 </DocsAndViews>
    59 <pluginList>
    610  <kdevdebugger>
  • trunk/psLib/src/dataIO/psFits.c

    r4158 r4191  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-08 21:07:59 $
     9 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-09 19:40:51 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    797797                      const psMetadata* header,
    798798                      const psImage* input,
    799                       int numZPlanes,
    800                       char* extname)
     799                      int numZPlanes)
    801800{
    802801
     
    837836
    838837    fits_create_img(fits->p_fd, bitPix, naxis, naxes, &status);
    839 
    840     if (extname != NULL) {
    841         fits_update_key_str(fits->p_fd, "EXTNAME", (char*)extname, NULL, &status);
    842     }
    843838
    844839    if (bZero != 0) {        // set the bscale/bzero
     
    14531448bool psFitsWriteTable(const psFits* fits,
    14541449                      psMetadata* header,
    1455                       psArray* table,
    1456                       char* extname)
     1450                      psArray* table)
    14571451{
    14581452    int status = 0;
     
    15241518        }
    15251519        columnTypes->data[n] = fitsType;
     1520    }
     1521
     1522    psBool mStatus = false;
     1523    char* extname = psMetadataLookupPtr(&mStatus, header, "EXTNAME");
     1524    if ( ! mStatus) {
     1525        extname = psMetadataLookupPtr(&mStatus, header, "HDUNAME");
     1526        if (! mStatus) {
     1527            extname = NULL;
     1528        }
    15261529    }
    15271530
  • trunk/psLib/src/dataIO/psFits.h

    r4190 r4191  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-09 19:26:48 $
     9 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-09 19:40:51 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    178178    const psMetadata* header,          ///< header items for the new HDU.  Can be NULL.
    179179    const psImage* input,              ///< the image to output
    180     int depth,                         ///< the number of z-planes of the FITS image data cube
    181     char* extname                      ///< extension name
     180    int depth                          ///< the number of z-planes of the FITS image data cube
    182181);
    183182
     
    248247    const psFits* fits,                ///< the psFits object
    249248    psMetadata* header,                ///< header items for the new HDU.  Can be NULL.
    250     psArray* table,
     249    psArray* table
    251250    ///< Array of psMetadata items, which contains the output data items of each row.
    252     char* extname                      ///< extension name
    253251);
    254252
  • trunk/psLib/src/fits/psFits.c

    r4158 r4191  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-08 21:07:59 $
     9 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-09 19:40:51 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    797797                      const psMetadata* header,
    798798                      const psImage* input,
    799                       int numZPlanes,
    800                       char* extname)
     799                      int numZPlanes)
    801800{
    802801
     
    837836
    838837    fits_create_img(fits->p_fd, bitPix, naxis, naxes, &status);
    839 
    840     if (extname != NULL) {
    841         fits_update_key_str(fits->p_fd, "EXTNAME", (char*)extname, NULL, &status);
    842     }
    843838
    844839    if (bZero != 0) {        // set the bscale/bzero
     
    14531448bool psFitsWriteTable(const psFits* fits,
    14541449                      psMetadata* header,
    1455                       psArray* table,
    1456                       char* extname)
     1450                      psArray* table)
    14571451{
    14581452    int status = 0;
     
    15241518        }
    15251519        columnTypes->data[n] = fitsType;
     1520    }
     1521
     1522    psBool mStatus = false;
     1523    char* extname = psMetadataLookupPtr(&mStatus, header, "EXTNAME");
     1524    if ( ! mStatus) {
     1525        extname = psMetadataLookupPtr(&mStatus, header, "HDUNAME");
     1526        if (! mStatus) {
     1527            extname = NULL;
     1528        }
    15261529    }
    15271530
  • trunk/psLib/src/fits/psFits.h

    r4190 r4191  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-06-09 19:26:48 $
     9 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-06-09 19:40:51 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    178178    const psMetadata* header,          ///< header items for the new HDU.  Can be NULL.
    179179    const psImage* input,              ///< the image to output
    180     int depth,                         ///< the number of z-planes of the FITS image data cube
    181     char* extname                      ///< extension name
     180    int depth                          ///< the number of z-planes of the FITS image data cube
    182181);
    183182
     
    248247    const psFits* fits,                ///< the psFits object
    249248    psMetadata* header,                ///< header items for the new HDU.  Can be NULL.
    250     psArray* table,
     249    psArray* table
    251250    ///< Array of psMetadata items, which contains the output data items of each row.
    252     char* extname                      ///< extension name
    253251);
    254252
  • trunk/psLib/test/dataIO/tst_psFits.c

    r4158 r4191  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-06-08 21:07:59 $
     8*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-06-09 19:40:51 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    122122                      extname);
    123123
     124        psMetadataAdd(header,PS_LIST_TAIL, "MYSTR",
     125                      PS_META_STR,
     126                      "Extension Name",
     127                      extname);
     128
    124129        // set the pixels in the image
    125130        psBinaryOp(image,image,"=",psScalarAlloc(lcv,PS_TYPE_F32));
    126         if (! psFitsWriteImage(fitsFile,header,image,1, extname) ) {
     131        if (! psFitsWriteImage(fitsFile,header,image,1) ) {
    127132            psError(PS_ERR_UNKNOWN, false,
    128133                    "Could not write image.");
     
    155160    psImage* image = psImageAlloc(16,16,PS_TYPE_F32);
    156161
    157     if (! psFitsWriteImage(fitsFile,NULL,image,1,"primary") ) {
     162    if (! psFitsWriteImage(fitsFile,NULL,image,1) ) {
    158163        psError(PS_ERR_UNKNOWN, false,
    159164                "Could not write PHU image.");
     
    192197    }
    193198
    194     psFitsWriteTable(fitsFile, NULL, table, "table-1");
     199    psFitsWriteTable(fitsFile, NULL, table);
    195200
    196201    psFree(table);
     
    12751280        psFits* fits = psFitsAlloc(filename); \
    12761281        psRegion region = {0,0,0,0}; \
    1277         if (! psFitsWriteImage(fits, NULL, img, 2, "primary")) { \
     1282        if (! psFitsWriteImage(fits, NULL, img, 2)) { \
    12781283            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
    12791284            return 1; \
     
    12831288            return 2; \
    12841289        } \
    1285         if (! psFitsWriteImage(fits,NULL, img3, 2, "extension")) { \
     1290        if (! psFitsWriteImage(fits,NULL, img3, 2)) { \
    12861291            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
    12871292            return 3; \
     
    14411446    psFits* fits = psFitsAlloc("tmpImages/writeTest.fits");
    14421447
    1443     if (! psFitsWriteImage(fits, NULL, img,1,NULL)) {
     1448    if (! psFitsWriteImage(fits, NULL, img,1)) {
    14441449        psError(PS_ERR_UNKNOWN, true,"Couldn't write writeTest.fits.");
    14451450        return 14;
     
    14781483    */
    14791484    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message because input image is null.");
    1480     if ( psFitsWriteImage(fits,NULL,NULL, 1, NULL) ) {
     1485    if ( psFitsWriteImage(fits,NULL,NULL, 1) ) {
    14811486        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false when input image is NULL.");
    14821487        return 20;
  • trunk/psLib/test/image/tst_psImageGeomManip.c

    r4128 r4191  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-07 02:29:44 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-06-09 19:40:51 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    559559    }
    560560
    561     char hduName[80];
    562561    psRegion regionAll = psRegionSet(0,0,0,0);
    563562    for (psS32 rot=-180;rot<=180;rot+=45) {
    564563        psImage* oldOut = fOut;
    565564        psImage* oldBiOut = fBiOut;
    566         snprintf(hduName, 80, "%+d", rot);
    567565        if (rot == 90) {
    568566            radianRot = M_PI_2;
     
    590588        sBiOut = psImageRotate(sBiOut,sImg,radianRot,-1.0,PS_INTERPOLATE_BILINEAR);
    591589
    592         if (! psFitsWriteImage(fOutFile, NULL, fOut, 1, hduName) ) {
     590        if (! psFitsWriteImage(fOutFile, NULL, fOut, 1) ) {
    593591            psError(PS_ERR_UNKNOWN, true,"Can not write fOut.");
    594592            return 20;
    595593        }
    596         if (! psFitsWriteImage(sOutFile, NULL, sOut, 1, hduName) ) {
     594        if (! psFitsWriteImage(sOutFile, NULL, sOut, 1) ) {
    597595            psError(PS_ERR_UNKNOWN, true,"Can not write sOut.");
    598596            return 21;
    599597        }
    600         if (! psFitsWriteImage(fBiOutFile, NULL, fBiOut, 1, hduName) ) {
     598        if (! psFitsWriteImage(fBiOutFile, NULL, fBiOut, 1) ) {
    601599            psError(PS_ERR_UNKNOWN, true,"Can not write fBiOut.fits.");
    602600            return 40;
    603601        }
    604         if (! psFitsWriteImage(sBiOutFile, NULL, sBiOut, 1, hduName) ) {
     602        if (! psFitsWriteImage(sBiOutFile, NULL, sBiOut, 1) ) {
    605603            psError(PS_ERR_UNKNOWN, true,"Can not write sBiOut.fits.");
    606604            return 41;
Note: See TracChangeset for help on using the changeset viewer.