Changeset 4191
- Timestamp:
- Jun 9, 2005, 9:40:51 AM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 8 edited
-
pslib.kdevelop.pcs (modified) ( previous)
-
pslib.kdevses (modified) (1 diff)
-
src/dataIO/psFits.c (modified) (5 diffs)
-
src/dataIO/psFits.h (modified) (3 diffs)
-
src/fits/psFits.c (modified) (5 diffs)
-
src/fits/psFits.h (modified) (3 diffs)
-
test/dataIO/tst_psFits.c (modified) (8 diffs)
-
test/image/tst_psImageGeomManip.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevses
r4157 r4191 2 2 <!DOCTYPE KDevPrjSession> 3 3 <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> 5 9 <pluginList> 6 10 <kdevdebugger> -
trunk/psLib/src/dataIO/psFits.c
r4158 r4191 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-06-0 8 21:07:59$9 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-09 19:40:51 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 797 797 const psMetadata* header, 798 798 const psImage* input, 799 int numZPlanes, 800 char* extname) 799 int numZPlanes) 801 800 { 802 801 … … 837 836 838 837 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 }843 838 844 839 if (bZero != 0) { // set the bscale/bzero … … 1453 1448 bool psFitsWriteTable(const psFits* fits, 1454 1449 psMetadata* header, 1455 psArray* table, 1456 char* extname) 1450 psArray* table) 1457 1451 { 1458 1452 int status = 0; … … 1524 1518 } 1525 1519 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 } 1526 1529 } 1527 1530 -
trunk/psLib/src/dataIO/psFits.h
r4190 r4191 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 3$ $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 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 178 178 const psMetadata* header, ///< header items for the new HDU. Can be NULL. 179 179 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 182 181 ); 183 182 … … 248 247 const psFits* fits, ///< the psFits object 249 248 psMetadata* header, ///< header items for the new HDU. Can be NULL. 250 psArray* table ,249 psArray* table 251 250 ///< Array of psMetadata items, which contains the output data items of each row. 252 char* extname ///< extension name253 251 ); 254 252 -
trunk/psLib/src/fits/psFits.c
r4158 r4191 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-06-0 8 21:07:59$9 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-09 19:40:51 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 797 797 const psMetadata* header, 798 798 const psImage* input, 799 int numZPlanes, 800 char* extname) 799 int numZPlanes) 801 800 { 802 801 … … 837 836 838 837 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 }843 838 844 839 if (bZero != 0) { // set the bscale/bzero … … 1453 1448 bool psFitsWriteTable(const psFits* fits, 1454 1449 psMetadata* header, 1455 psArray* table, 1456 char* extname) 1450 psArray* table) 1457 1451 { 1458 1452 int status = 0; … … 1524 1518 } 1525 1519 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 } 1526 1529 } 1527 1530 -
trunk/psLib/src/fits/psFits.h
r4190 r4191 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 3$ $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 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 178 178 const psMetadata* header, ///< header items for the new HDU. Can be NULL. 179 179 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 182 181 ); 183 182 … … 248 247 const psFits* fits, ///< the psFits object 249 248 psMetadata* header, ///< header items for the new HDU. Can be NULL. 250 psArray* table ,249 psArray* table 251 250 ///< Array of psMetadata items, which contains the output data items of each row. 252 char* extname ///< extension name253 251 ); 254 252 -
trunk/psLib/test/dataIO/tst_psFits.c
r4158 r4191 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06-0 8 21:07:59$8 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-09 19:40:51 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 122 122 extname); 123 123 124 psMetadataAdd(header,PS_LIST_TAIL, "MYSTR", 125 PS_META_STR, 126 "Extension Name", 127 extname); 128 124 129 // set the pixels in the image 125 130 psBinaryOp(image,image,"=",psScalarAlloc(lcv,PS_TYPE_F32)); 126 if (! psFitsWriteImage(fitsFile,header,image,1 , extname) ) {131 if (! psFitsWriteImage(fitsFile,header,image,1) ) { 127 132 psError(PS_ERR_UNKNOWN, false, 128 133 "Could not write image."); … … 155 160 psImage* image = psImageAlloc(16,16,PS_TYPE_F32); 156 161 157 if (! psFitsWriteImage(fitsFile,NULL,image,1 ,"primary") ) {162 if (! psFitsWriteImage(fitsFile,NULL,image,1) ) { 158 163 psError(PS_ERR_UNKNOWN, false, 159 164 "Could not write PHU image."); … … 192 197 } 193 198 194 psFitsWriteTable(fitsFile, NULL, table , "table-1");199 psFitsWriteTable(fitsFile, NULL, table); 195 200 196 201 psFree(table); … … 1275 1280 psFits* fits = psFitsAlloc(filename); \ 1276 1281 psRegion region = {0,0,0,0}; \ 1277 if (! psFitsWriteImage(fits, NULL, img, 2 , "primary")) { \1282 if (! psFitsWriteImage(fits, NULL, img, 2)) { \ 1278 1283 psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \ 1279 1284 return 1; \ … … 1283 1288 return 2; \ 1284 1289 } \ 1285 if (! psFitsWriteImage(fits,NULL, img3, 2 , "extension")) { \1290 if (! psFitsWriteImage(fits,NULL, img3, 2)) { \ 1286 1291 psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \ 1287 1292 return 3; \ … … 1441 1446 psFits* fits = psFitsAlloc("tmpImages/writeTest.fits"); 1442 1447 1443 if (! psFitsWriteImage(fits, NULL, img,1 ,NULL)) {1448 if (! psFitsWriteImage(fits, NULL, img,1)) { 1444 1449 psError(PS_ERR_UNKNOWN, true,"Couldn't write writeTest.fits."); 1445 1450 return 14; … … 1478 1483 */ 1479 1484 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) ) { 1481 1486 psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false when input image is NULL."); 1482 1487 return 20; -
trunk/psLib/test/image/tst_psImageGeomManip.c
r4128 r4191 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06-0 7 02:29:44$8 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-09 19:40:51 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 559 559 } 560 560 561 char hduName[80];562 561 psRegion regionAll = psRegionSet(0,0,0,0); 563 562 for (psS32 rot=-180;rot<=180;rot+=45) { 564 563 psImage* oldOut = fOut; 565 564 psImage* oldBiOut = fBiOut; 566 snprintf(hduName, 80, "%+d", rot);567 565 if (rot == 90) { 568 566 radianRot = M_PI_2; … … 590 588 sBiOut = psImageRotate(sBiOut,sImg,radianRot,-1.0,PS_INTERPOLATE_BILINEAR); 591 589 592 if (! psFitsWriteImage(fOutFile, NULL, fOut, 1 , hduName) ) {590 if (! psFitsWriteImage(fOutFile, NULL, fOut, 1) ) { 593 591 psError(PS_ERR_UNKNOWN, true,"Can not write fOut."); 594 592 return 20; 595 593 } 596 if (! psFitsWriteImage(sOutFile, NULL, sOut, 1 , hduName) ) {594 if (! psFitsWriteImage(sOutFile, NULL, sOut, 1) ) { 597 595 psError(PS_ERR_UNKNOWN, true,"Can not write sOut."); 598 596 return 21; 599 597 } 600 if (! psFitsWriteImage(fBiOutFile, NULL, fBiOut, 1 , hduName) ) {598 if (! psFitsWriteImage(fBiOutFile, NULL, fBiOut, 1) ) { 601 599 psError(PS_ERR_UNKNOWN, true,"Can not write fBiOut.fits."); 602 600 return 40; 603 601 } 604 if (! psFitsWriteImage(sBiOutFile, NULL, sBiOut, 1 , hduName) ) {602 if (! psFitsWriteImage(sBiOutFile, NULL, sBiOut, 1) ) { 605 603 psError(PS_ERR_UNKNOWN, true,"Can not write sBiOut.fits."); 606 604 return 41;
Note:
See TracChangeset
for help on using the changeset viewer.
