Changeset 192
- Timestamp:
- 01/14/05 11:06:15 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDWriter.cc
r125 r192 1 //#---------------------------------------------------------------------------1 //#--------------------------------------------------------------------------- 2 2 //# SDWriter.cc: ASAP class to write out single dish spectra. 3 3 //#--------------------------------------------------------------------------- … … 43 43 #include "SDMemTable.h" 44 44 #include "SDWriter.h" 45 #include "SDFITSImageWriter.h" 45 46 46 47 using namespace casa; … … 54 55 { 55 56 cFormat = format; 56 57 // 57 58 if (cFormat == "MS2") { 58 59 cWriter = new PKSMS2writer(); 59 } else {60 } else if (cFormat == "SDFITS") { 60 61 cWriter = new PKSSDwriter(); 62 } else if (cFormat == "FITS") { 63 cWriter = 0; 61 64 } 62 65 } … … 68 71 SDWriter::~SDWriter() 69 72 { 70 // Nothing. 73 if (cWriter) { 74 delete cWriter; 75 } 71 76 } 72 77 … … 75 80 // Reset the output format. 76 81 77 Int SDWriter::setFormat( 78 const std::string &format) 82 Int SDWriter::setFormat(const std::string &format) 79 83 { 80 84 if (format != cFormat) { 81 delete cWriter;82 85 if (cWriter) delete cWriter; 86 // 83 87 cFormat = format; 84 88 if (cFormat == "MS2") { 85 89 cWriter = new PKSMS2writer(); 86 } else {90 } else if (cFormat == "SDFITS") { 87 91 cWriter = new PKSSDwriter(); 92 } else if (cFormat == "FITS") { 93 cWriter = 0; 88 94 } 89 95 } 90 91 96 return 0; 92 97 } … … 97 102 // finished. 98 103 99 Int SDWriter::write( 100 const CountedPtr<SDMemTable> table, 101 const std::string &filename) 102 { 104 Int SDWriter::write(const CountedPtr<SDMemTable> table, 105 const std::string &filename) 106 { 107 108 // Image FITS 109 110 if (cFormat=="FITS") { 111 Bool verbose = True; 112 SDFITSImageWriter iw; 113 if (iw.write(*table, filename, verbose)) { 114 return 0; 115 } else { 116 return 1; 117 } 118 } 119 120 // MS or SDFITS 121 103 122 // Extract the header from the table. 104 123 SDHeader hdr = table->getSDHeader(); -
trunk/src/SDWriter.h
r125 r192 49 49 ~SDWriter(); 50 50 51 // Format can be "SDIFTS", "FITS", or "MS2" 51 52 casa::Int setFormat(const string &format = "SDFITS"); 52 53 casa::Int write(const casa::CountedPtr<SDMemTable> table,
Note:
See TracChangeset
for help on using the changeset viewer.