- Timestamp:
- 09/01/08 11:54:04 (16 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STWriter.cpp
r1410 r1443 47 47 #include <tables/Tables/ArrayColumn.h> 48 48 49 //#include "SDFITSImageWriter.h"49 #include "STFITSImageWriter.h" 50 50 #include "STAsciiWriter.h" 51 51 #include "STHeader.h" … … 58 58 STWriter::STWriter(const std::string &format) 59 59 { 60 format_ = format; 61 String t(format_); 62 t.upcase(); 63 if (t == "MS2") { 64 writer_ = new PKSMS2writer(); 65 } else if (t == "SDFITS") { 66 writer_ = new PKSSDwriter(); 67 } else if (t == "ASCII" || t == "FITS" || t == "CLASS") { 68 writer_ = 0; 69 } else { 70 throw (AipsError("Unrecognized export format")); 71 } 72 } 73 74 STWriter::~STWriter() 75 { 76 if (writer_) { 77 delete writer_; 78 } 79 } 80 81 Int STWriter::setFormat(const std::string &format) 82 { 83 if (format != format_) { 84 if (writer_) delete writer_; 85 } 86 60 87 format_ = format; 61 88 String t(format_); … … 65 92 } else if (t== "SDFITS") { 66 93 writer_ = new PKSSDwriter(); 67 } else if (t== "ASCII") { 68 writer_ = 0; 69 } else { 70 throw (AipsError("Unrecognized export format")); 71 } 72 } 73 74 STWriter::~STWriter() 75 { 76 if (writer_) { 77 delete writer_; 78 } 79 } 80 81 Int STWriter::setFormat(const std::string &format) 82 { 83 if (format != format_) { 84 if (writer_) delete writer_; 85 } 86 87 format_ = format; 88 String t(format_); 89 t.upcase(); 90 if (t== "MS2") { 91 writer_ = new PKSMS2writer(); 92 } else if (t== "SDFITS") { 93 writer_ = new PKSSDwriter(); 94 } else if (t== "ASCII") { 94 } else if (t == "ASCII" || t == "FITS" || t == "CLASS") { 95 95 writer_ = 0; 96 96 } else { … … 110 110 } else { 111 111 return 1; 112 } 113 } else if ( format_ == "FITS" || format_ == "CLASS") { 114 STFITSImageWriter iw; 115 if (format_ == "CLASS") { 116 iw.setClass(True); 117 } 118 if (iw.write(*in, filename)) { 119 return 0; 112 120 } 113 121 }
Note:
See TracChangeset
for help on using the changeset viewer.