Changeset 988
- Timestamp:
- 04/05/06 14:31:47 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Makefile
r962 r988 93 93 STFrequencies.o \ 94 94 STHistory.o \ 95 STWriter.o \96 95 STSelector.o \ 97 96 STLineFinder.o \ … … 102 101 STPolLinear.o \ 103 102 STPolStokes.o \ 103 STWriter.o \ 104 STAsciiWriter.o \ 104 105 Scantable.o \ 105 106 Templates.o … … 112 113 python_STLineFinder.o \ 113 114 python_STFitEntry.o \ 115 python_STWriter.o \ 114 116 python_asap.o 115 117 … … 142 144 STPol.h \ 143 145 STPolStokes.h \ 144 STPolLinear.h 146 STPolLinear.h \ 147 STWriter.h \ 148 STAsciiWriter.h 145 149 146 150 STATICCCLIB := libasap.a -
trunk/src/STAsciiWriter.cpp
r823 r988 1 1 //#--------------------------------------------------------------------------- 2 //# S DAsciiWriter.cc: ASAP class to write out single dish spectra as FITS images2 //# STAsciiWriter.cc: ASAP class to write out single dish spectra as FITS images 3 3 //#--------------------------------------------------------------------------- 4 4 //# Copyright (C) 2004 … … 32 32 #include <casa/aips.h> 33 33 #include <casa/Arrays/Array.h> 34 #include <casa/Arrays/Matrix.h> 34 35 #include <casa/Arrays/Vector.h> 35 36 #include <casa/Arrays/VectorIter.h> … … 39 40 #include <casa/Utilities/Assert.h> 40 41 41 #include <casa/iostream.h>42 42 #include <casa/fstream.h> 43 43 #include <casa/sstream.h> 44 45 #include <coordinates/Coordinates/CoordinateUtil.h> 46 #include <coordinates/Coordinates/SpectralCoordinate.h> 47 #include <coordinates/Coordinates/DirectionCoordinate.h> 48 #include <coordinates/Coordinates/StokesCoordinate.h> 44 #include <casa/iomanip.h> 49 45 50 46 #include <measures/Measures/MEpoch.h> 51 47 52 48 #include <tables/Tables/Table.h> 49 #include <tables/Tables/TableIter.h> 50 #include <tables/Tables/TableRecord.h> 51 #include <casa/Containers/RecordField.h> 52 #include <tables/Tables/TableRow.h> 53 53 #include <tables/Tables/ScalarColumn.h> 54 54 #include <tables/Tables/ArrayColumn.h> 55 55 56 #include "S DDefs.h"57 #include "S DContainer.h"58 #include "S DMemTable.h"59 #include "S DAsciiWriter.h"56 #include "STDefs.h" 57 #include "STHeader.h" 58 #include "Scantable.h" 59 #include "STAsciiWriter.h" 60 60 61 61 using namespace casa; … … 63 63 64 64 65 S DAsciiWriter::SDAsciiWriter()65 STAsciiWriter::STAsciiWriter() 66 66 {;} 67 67 68 S DAsciiWriter::~SDAsciiWriter()68 STAsciiWriter::~STAsciiWriter() 69 69 {;} 70 70 71 71 72 Bool S DAsciiWriter::write(const SDMemTable& sdTable, const String& fileName, Bool toStokes)72 Bool STAsciiWriter::write(const Scantable& stable, const String& fileName) 73 73 { 74 74 75 75 // Get global Header from Table 76 76 77 SDHeader header = sdTable.getSDHeader(); 78 MEpoch::Ref timeRef(MEpoch::UTC); // Should be in header 79 MDirection::Types dirRef(MDirection::J2000); // Should be in header 77 STHeader hdr = stable.getHeader(); 80 78 81 79 // Column keywords 82 80 83 Table tab = sdTable.table(); 84 ROArrayColumn<Double> dir(tab, String("DIRECTION")); 85 ROScalarColumn<Double> time(tab, "TIME"); 86 ROArrayColumn<uInt> freqid(tab, "FREQID"); 87 ROScalarColumn<String> src(tab, "SRCNAME"); 81 Table tab = stable.table(); 88 82 89 83 // Temps 90 84 91 Vector<Int> whichStokes(1,1);92 Array<Double> whichDir;93 Vector<Double> lonLat(2);94 IPosition posDir(2,0);95 85 const Unit RAD(String("rad")); 96 86 … … 99 89 String rootName(fileName); 100 90 if (rootName.length()==0) rootName = String("ascii"); 101 {102 String fName = String(rootName) + String("_header.txt");103 pushLog("Writing header to "+fName);104 ofstream of(fName.chars(), ios::trunc);105 std::string summary = sdTable.summary(true);106 of << summary;107 of.close();108 }109 91 110 // Open data file 92 Block<String> cols(4); 93 cols[0] = String("SCANNO"); 94 cols[1] = String("CYCLENO"); 95 cols[2] = String("BEAMNO"); 96 cols[3] = String("IFNO"); 97 TableIterator iter(tab, cols); 98 // Open data file 99 while ( !iter.pastEnd() ) { 100 Table t = iter.table(); 101 ROTableRow row(t); 102 const TableRecord& rec = row.get(0); 103 String dirtype = stable.getDirectionRefString(); 104 ostringstream onstr; 105 onstr << "SCAN" << rec.asuInt("SCANNO") 106 << "_CYCLE" << rec.asuInt("CYCLENO") 107 << "_BEAM" << rec.asuInt("BEAMNO") 108 << "_IF" << rec.asuInt("IFNO"); 109 String fName = rootName + String(onstr) + String(".txt"); 110 ofstream of(fName.chars(), ios::trunc); 111 int row0 = t.rowNumbers()[0]; 112 MDirection mdir = stable.getDirection(row0); 113 of << setfill('#') << setw(70) << "" << setfill(' ') << endl; 114 addLine(of, "Name", rec.asString("SRCNAME")); 115 addLine(of, "Position", String(dirtype+ " "+formatDirection(mdir))); 116 addLine(of, "Time", stable.getTime(row0,true)); 117 addLine(of, "Flux Unit", hdr.fluxunit); 118 addLine(of, "Pol Type", stable.getPolType()); 119 addLine(of, "Abcissa", stable.getAbcissaLabel(row0)); 120 addLine(of, "Beam No", rec.asuInt("BEAMNO")); 121 addLine(of, "IF No", rec.asuInt("IFNO")); 122 of << setfill('#') << setw(70) << "" << setfill(' ') << endl; 111 123 112 String fName = rootName + String(".txt"); 113 ofstream of(fName.chars(), ios::trunc); 114 115 // Write header 116 117 of << "row beam IF pol source longitude latitude time nchan spectrum mask" 118 << endl; 119 120 // Loop over rows 121 122 const uInt nRows = sdTable.nRow(); 123 for (uInt iRow=0; iRow<nRows; iRow++) { 124 125 // Get data 126 127 const MaskedArray<Float>& dataIn(sdTable.rowAsMaskedArray(iRow,toStokes)); 128 const Array<Float>& values = dataIn.getArray(); 129 const Array<Bool>& mask = dataIn.getMask(); 130 131 // Get abcissa 132 133 std::vector<double> abcissa = sdTable.getAbcissa(Int(iRow)); 134 const uInt n = abcissa.size(); 135 136 // Iterate through data in this row by spectra 137 138 ReadOnlyVectorIterator<Float> itData(values, asap::ChanAxis); 139 ReadOnlyVectorIterator<Bool> itMask(mask, asap::ChanAxis); 140 while (!itData.pastEnd()) { 141 const IPosition& pos = itData.pos(); 142 AlwaysAssert(itData.vector().nelements()==n,AipsError); 143 144 // FreqID 145 146 Vector<uInt> iTmp; 147 freqid.get(iRow, iTmp); 148 149 // Direction 150 151 dir.get(iRow, whichDir); 152 posDir(0) = pos(asap::BeamAxis); 153 posDir(1) = 0; 154 lonLat[0] = whichDir(posDir); 155 // 156 posDir(0) = pos(asap::BeamAxis); 157 posDir(1) = 1; 158 lonLat[1] = whichDir(posDir); 159 160 // Write preamble 161 162 of << iRow << " " << pos(asap::BeamAxis) << " " << pos(asap::IFAxis) << " " << 163 pos(asap::PolAxis) << " " << 164 src(iRow) << " " << formatDirection(lonLat) << " " << 165 sdTable.getTime(iRow,True) << " " << n << " "; 166 167 // Write abcissa 168 169 of.setf(ios::fixed, ios::floatfield); 170 of.precision(4); 171 for (uInt i=0; i<n; i++) { 172 of << abcissa[i] << " "; 173 } 174 175 // Write data 176 177 const Vector<Float>& data = itData.vector(); 178 const Vector<Bool>& mask = itMask.vector(); 179 for (uInt i=0; i<n; i++) { 180 of << data[i] << " "; 181 } 182 // Write mask 183 184 for (uInt i=0; i<n; i++) { 185 of << mask[i] << " "; 186 } 187 of << endl; 188 189 // Next spectrum 190 191 itData.next(); 192 itMask.next(); 124 of << std::left << setw(16) << "x"; 125 for ( int i=0; i<t.nrow(); ++i ) { 126 String y = "y"+ String(i); 127 String ym = "yflag"+ String(i); 128 of << setw(16) << y; 129 of << setw(7) << ym; 130 } 131 of << endl; 132 std::vector<double> abc = stable.getAbcissa(row0); 133 ROArrayColumn<Float> specCol(t,"SPECTRA"); 134 ROArrayColumn<uChar> flagCol(t,"FLAGTRA"); 135 Matrix<Float> specs = specCol.getColumn(); 136 Matrix<uChar> flags = flagCol.getColumn(); 137 for ( int i=0; i<specs.nrow(); ++i ) { 138 of << setw(16) << setprecision(8) << abc[i] ; 139 for ( int j=0; j<specs.ncolumn(); ++j ) { 140 of << setw(16) << setprecision(8) << specs(i,j) ; 141 of << setw(7) << Int(flags(i,j)); 193 142 } 194 } 195 196 of.close(); 197 ostringstream oss; 198 oss << "Wrote " << nRows << " rows into file " << fileName; 199 pushLog(String(oss)); 200 return True; 143 of << endl; 144 } 145 of.close(); 146 ostringstream oss; 147 oss << "Wrote " << fName; 148 pushLog(String(oss)); 149 ++iter; 150 } 151 return True; 201 152 } 202 153 203 154 155 String STAsciiWriter::formatDirection(const MDirection& md) const 156 { 157 Vector<Double> t = md.getAngle(Unit(String("rad"))).getValue(); 158 Int prec = 7; 204 159 205 String SDAsciiWriter::formatDirection(const Vector<Double>& lonLat) 206 { 207 MVAngle x1(lonLat(0));208 String s1 = x1.string(MVAngle::TIME, 12);209 210 MVAngle x2(lonLat(1));211 String s2 = x2.string(MVAngle::ANGLE, 12);212 213 String ss = s1 + String(" ") + s2;214 return ss;160 MVAngle mvLon(t[0]); 161 String sLon = mvLon.string(MVAngle::TIME,prec); 162 uInt tp = md.getRef().getType(); 163 if (tp == MDirection::GALACTIC || 164 tp == MDirection::SUPERGAL ) { 165 sLon = mvLon(0.0).string(MVAngle::ANGLE_CLEAN,prec); 166 } 167 MVAngle mvLat(t[1]); 168 String sLat = mvLat.string(MVAngle::ANGLE+MVAngle::DIG2,prec); 169 return sLon + String(" ") + sLat; 215 170 } 216 171 172 template <class T> 173 void STAsciiWriter::addLine(ostream& of, const String& lbl, const T& value) 174 { 175 String label = lbl+String(": "); 176 of << std::right << "# " << setw(15) << label << std::left 177 << setw(52) << value << setw(0) << "#"<< endl; 178 } -
trunk/src/STAsciiWriter.h
r823 r988 1 1 //#--------------------------------------------------------------------------- 2 //# S DAsciiWriter.h: ASAP class to write out single dish spectra as image FITS2 //# STAsciiWriter.h: ASAP class to write out single dish spectra as image FITS 3 3 //#--------------------------------------------------------------------------- 4 4 //# Copyright (C) 2004 … … 29 29 //# $Id$ 30 30 //#--------------------------------------------------------------------------- 31 #ifndef S DASCIIWRITER_H32 #define S DASCIIWRITER_H31 #ifndef STASCIIWRITER_H 32 #define STASCIIWRITER_H 33 33 34 34 #include <casa/aips.h> 35 35 #include <casa/BasicSL/String.h> 36 #include < SDMemTable.h>36 #include <casa/ostream.h> 37 37 38 #include "SDLog.h" 38 #include "Scantable.h" 39 #include "Logger.h" 39 40 40 41 template<class T> class casa::Vector; 41 42 class casa::MDirection; 42 43 43 44 namespace asap { 44 45 45 class S DAsciiWriter : public SDLog{46 class STAsciiWriter : public Logger { 46 47 public: 47 48 // Constructor 48 S DAsciiWriter();49 STAsciiWriter(); 49 50 50 51 // Destructor 51 ~S DAsciiWriter();52 ~STAsciiWriter(); 52 53 53 54 // Write out ascii table 54 casa::Bool write(const S DMemTable& table, const casa::String& name, casa::Bool toStokes);55 casa::Bool write(const Scantable& table, const casa::String& name); 55 56 56 57 private: 57 casa::Int convertStokes(casa::Int val); 58 casa::String formatDirection(const casa::Vector<casa::Double>& lonLat); 58 casa::String formatDirection(const casa::MDirection& md) const; 59 template <class T> 60 void addLine(std::ostream& of, const casa::String& lbl, 61 const T& value); 59 62 }; 60 63 -
trunk/src/STWriter.cpp
r901 r988 48 48 49 49 //#include "SDFITSImageWriter.h" 50 //#include "STAsciiWriter.h"50 #include "STAsciiWriter.h" 51 51 #include "STHeader.h" 52 52 … … 58 58 STWriter::STWriter(const std::string &format) 59 59 { 60 cFormat= format;61 String t( cFormat);60 format_ = format; 61 String t(format_); 62 62 t.upcase(); 63 63 if (t== "MS2") { 64 cWriter= new PKSMS2writer();64 writer_ = new PKSMS2writer(); 65 65 } else if (t== "SDFITS") { 66 cWriter= new PKSSDwriter();66 writer_ = new PKSSDwriter(); 67 67 } else if (t== "FITS") { 68 cWriter= 0;68 writer_ = 0; 69 69 } else if (t== "ASCII") { 70 cWriter = 0; 70 writer_ = 0; 71 } else { 72 throw (AipsError("Unrecognized export format")); 73 } 74 } 75 76 STWriter::~STWriter() 77 { 78 if (writer_) { 79 delete writer_; 80 } 81 } 82 83 Int STWriter::setFormat(const std::string &format) 84 { 85 if (format != format_) { 86 if (writer_) delete writer_; 87 } 88 89 format_ = format; 90 String t(format_); 91 t.upcase(); 92 if (t== "MS2") { 93 writer_ = new PKSMS2writer(); 94 } else if (t== "SDFITS") { 95 writer_ = new PKSSDwriter(); 96 } else if (t== "FITS") { 97 writer_ = 0; 98 } else if (t== "ASCII") { 99 writer_ = 0; 71 100 } else { 72 101 throw (AipsError("Unrecognized Format")); 73 102 } 74 }75 76 STWriter::~STWriter()77 {78 if (cWriter) {79 delete cWriter;80 }81 }82 83 Int STWriter::setFormat(const std::string &format)84 {85 if (format != cFormat) {86 if (cWriter) delete cWriter;87 }88 89 cFormat = format;90 String t(cFormat);91 t.upcase();92 if (t== "MS2") {93 cWriter = new PKSMS2writer();94 } else if (t== "SDFITS") {95 cWriter = new PKSSDwriter();96 } else if (t== "FITS") {97 cWriter = 0;98 } else if (t== "ASCII") {99 cWriter = 0;100 } else {101 throw (AipsError("Unrecognized Format"));102 }103 103 return 0; 104 104 } … … 110 110 // Image FITS 111 111 112 if ( cFormat=="FITS") {112 if (format_=="FITS") { 113 113 // Bool verbose = True; 114 114 // SDFITSImageWriter iw; … … 118 118 // return 1; 119 119 // } 120 } else if ( cFormat=="ASCII") {121 /*SDAsciiWriter iw;120 } else if (format_=="ASCII") { 121 STAsciiWriter iw; 122 122 if (iw.write(*in, filename)) { 123 123 return 0; 124 124 } else { 125 125 return 1; 126 } */126 } 127 127 } 128 128 … … 140 140 // Create the output file and write static data. 141 141 Int status; 142 if (status = cWriter->create(filename, hdr.observer, hdr.project, 142 Bool havexpol = Bool(in->npol() > 2); 143 if (status = writer_->create(filename, hdr.observer, hdr.project, 143 144 hdr.antennaname, hdr.antennaposition, 144 145 hdr.obstype, hdr.equinox, hdr.freqref, 145 nChan, nPol, False, False)) {146 nChan, nPol, False, havexpol)) { 146 147 throw(AipsError("Failed to create output file")); 147 148 } … … 161 162 while (!scanit.pastEnd() ) { 162 163 Table stable = scanit.table(); 163 TableIterator beamit( table, "BEAMNO");164 TableIterator beamit(stable, "BEAMNO"); 164 165 Int beamno = 1; 165 166 while (!beamit.pastEnd() ) { … … 168 169 MDirection::ScalarColumn dirCol(btable, "DIRECTION"); 169 170 Vector<Double> direction = dirCol(0).getAngle("rad").getValue(); 170 TableIterator ifit(btable, "IFNO");171 Int ifno = 1;172 while (! ifit.pastEnd() ) {173 Table itable = ifit.table();174 TableIterator cycit(itable, "CYCLENO");175 Int cycno = 1;176 while (! cycit.pastEnd() ) {177 Table ctable = cycit.table();178 TableRow row( ctable);171 TableIterator cycit(btable, "CYCLENO"); 172 Int cycno = 1; 173 while (!cycit.pastEnd() ) { 174 Table ctable = cycit.table(); 175 TableIterator ifit(ctable, "IFNO"); 176 Int ifno = 1; 177 while (!ifit.pastEnd() ) { 178 Table itable = ifit.table(); 179 TableRow row(itable); 179 180 // use the first row to fill in all the "metadata" 180 181 const TableRecord& rec = row.get(0); 181 ROArrayColumn<Float> specCol( ctable, "SPECTRA");182 ROArrayColumn<Float> specCol(itable, "SPECTRA"); 182 183 uInt nchan = specCol(0).nelements(); 183 184 Double cdelt,crval,crpix, restfreq; 184 185 Float focusAxi, focusTan, focusRot, 185 186 temperature, pressure, humidity, windSpeed, windAz; 187 Float tmp0,tmp1,tmp2,tmp3,tmp4; 186 188 Vector<Float> tcalval; 187 String tmp,tmp2, tcalt;189 String stmp0,stmp1, tcalt; 188 190 in->frequencies().getEntry(crpix,crval,cdelt, rec.asuInt("FREQ_ID")); 189 in->molecules().getEntry(restfreq,tmp,tmp2,rec.asuInt("RESTFREQ_ID")); 191 in->focus().getEntry(focusAxi, focusTan, focusRot, 192 tmp0,tmp1,tmp2,tmp3,tmp4, 193 rec.asuInt("FOCUS_ID")); 194 in->molecules().getEntry(restfreq,stmp0,stmp1,rec.asuInt("MOLECULE_ID")); 190 195 in->tcal().getEntry(tcalt,tcalval,rec.asuInt("TCAL_ID")); 191 196 in->weather().getEntry(temperature, pressure, humidity, … … 198 203 Matrix<uChar> flags; 199 204 Vector<Complex> xpol; 200 polConversion(specs, flags, xpol, ctable);201 Vector<Float> tsys = tsysFromTable( ctable);205 polConversion(specs, flags, xpol, itable); 206 Vector<Float> tsys = tsysFromTable(itable); 202 207 // dummy data 203 208 uInt npol = specs.ncolumn(); 209 204 210 Matrix<Float> baseLin(npol,2, 0.0f); 205 211 Matrix<Float> baseSub(npol,9, 0.0f); … … 208 214 Vector<Float> sigma(npol, 0.0f); 209 215 Vector<Float> calFctr(npol, 0.0f); 210 211 212 if (status = cWriter->write(scanno, cycno, rec.asDouble("TIME"), 216 if (status = writer_->write(scanno, cycno, rec.asDouble("TIME"), 213 217 rec.asDouble("INTERVAL"), 214 218 rec.asString("FIELDNAME"), … … 224 228 rec.asFloat("ELEVATION"), 225 229 rec.asFloat("PARANGLE"), 226 focusAxi, focusTan, focusRot, //230 focusAxi, focusTan, focusRot, 227 231 temperature, 228 232 pressure, humidity, windSpeed, windAz, 229 rec.asInt("REFBEAM "), beamno,233 rec.asInt("REFBEAMNO")+1, beamno, 230 234 direction, 231 235 scanRate,// not in scantable … … 237 241 xpol) 238 242 ) { 239 cerr << "Error writing output file." << endl;240 return 1;243 writer_->close(); 244 throw(AipsError("STWriter: Failed to export Scantable.")); 241 245 } 242 246 243 ++ cycno;244 ++ cycit;247 ++ifno; 248 ++ifit; 245 249 } 246 ++ ifno;247 ++ ifit;250 ++cycno; 251 ++cycit; 248 252 } 249 253 ++beamno; … … 256 260 oss << "STWriter: wrote " << count << " rows to " << filename << endl; 257 261 pushLog(String(oss)); 258 cWriter->close();262 writer_->close(); 259 263 260 264 return 0; … … 267 271 Vector<Float> tmp; 268 272 for (uInt i=0; i<tab.nrow(); ++i) { 273 tmp.resize(); 269 274 tmp = tsysCol(i); 270 275 out[i] = tmp[0]; 271 276 } 277 return out; 272 278 } 273 279 … … 277 283 TableRow row(tab); 278 284 String poltype = tab.keywordSet().asString("POLTYPE"); 279 if ( poltype != "linear") 285 if ( poltype != "linear") { 280 286 String msg = "poltype = " + poltype + " not yet supported in output."; 281 throw(AipsError("msg")); 287 throw(AipsError(msg)); 288 } 282 289 // use the first row to fill in all the "metadata" 283 290 const TableRecord& rec = row.get(0); … … 285 292 ROArrayColumn<uChar> flagCol(tab, "FLAGTRA"); 286 293 uInt nchan = specCol(0).nelements(); 287 uInt ncol s= (tab.nrow()==1 ? 1: 2 );288 specs.resize(nchan, ncol s);289 flags.resize(nchan, ncol s);294 uInt ncol = (tab.nrow()==1 ? 1: 2 ); 295 specs.resize(nchan, ncol); 296 flags.resize(nchan, ncol); 290 297 // the linears 291 for (uInt i=0; i<ncol s; ++i) {298 for (uInt i=0; i<ncol; ++i) { 292 299 specs.column(i) = specCol(i); 293 300 flags.column(i) = flagCol(i); -
trunk/src/STWriter.h
r894 r988 50 50 * @brief Export of ASAP data container into foreign formats 51 51 * @author Malte Marquarding 52 * @date $Date$52 * @date 2006-03-08 53 53 * @version 2.0a 54 54 */ … … 81 81 casa::Vector<casa::Complex>& xpol, 82 82 const casa::Table& tab); 83 std::string cFormat;84 PKSwriter *cWriter;83 std::string format_; 84 PKSwriter* writer_; 85 85 }; 86 86 -
trunk/src/STWriterWrapper.h
r982 r988 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id: 29 //# $Id:$ 30 30 //#--------------------------------------------------------------------------- 31 #ifndef S DWRITERWRAPPER_H32 #define S DWRITERWRAPPER_H31 #ifndef STWRITERWRAPPER_H 32 #define STWRITERWRAPPER_H 33 33 34 34 #include <vector> 35 35 #include <string> 36 37 #include "ScantableWrapper.h" 36 38 37 39 #include "STWriter.h" … … 39 41 namespace asap { 40 42 41 class SDMemTableWrapper;42 43 43 class STWriterWrapper : public STWriter { 44 44 public: 45 STWriterWrapper(const string &format = "SDFITS") : STWriter(format) {;}45 STWriterWrapper(const string& format = "SDFITS") : STWriter(format) {;} 46 46 47 casa::Int write(const S DMemTableWrapper &table, const string &filename, bool toStokes) {48 return STWriter::write(table.getCP(), filename , toStokes);47 casa::Int write(const ScantableWrapper& table, const string &filename) { 48 return STWriter::write(table.getCP(), filename); 49 49 } 50 50 }; -
trunk/src/python_STWriter.cpp
r892 r988 1 1 //#--------------------------------------------------------------------------- 2 //# python_S DWriter.cc: Python binding to C++ SDWriter class.2 //# python_STWriter.cc: Python binding to C++ SDWriter class. 3 3 //#--------------------------------------------------------------------------- 4 4 //# Copyright (C) 2004 … … 31 31 #include <boost/python.hpp> 32 32 33 #include "S DWriterWrapper.h"33 #include "STWriterWrapper.h" 34 34 35 35 using namespace boost::python; … … 38 38 namespace python { 39 39 40 void python_SDWriter() { 41 class_<SDWriterWrapper>("sdwriter") 42 .def(init <> ()) 43 .def(init <std::string> ()) 44 .def("setformat", &SDWriterWrapper::setFormat, 45 (boost::python::arg("format")="SDFITS")) 46 .def("write", &SDWriterWrapper::write); 47 ; 48 }; 49 40 void python_STWriter() { 41 class_<STWriterWrapper>("stwriter") 42 .def(init <> ()) 43 .def(init <std::string> ()) 44 .def("setformat", &STWriterWrapper::setFormat, 45 (boost::python::arg("format")="STFITS")) 46 .def("write", &STWriterWrapper::write); 47 ; 48 }; 50 49 } // namespace python 51 50 } // namespace asap -
trunk/src/python_asap.cpp
r960 r988 63 63 asap::python::python_STLineFinder(); 64 64 asap::python::python_STFitEntry(); 65 /* 66 asap::python::python_S DWriter();67 */ 65 66 asap::python::python_STWriter(); 67 68 68 asap::python::python_Logger(); 69 69 register_exception_translator<casa::AipsError>(&asap::python::translate_ex); -
trunk/src/python_asap.h
r960 r988 44 44 void python_STLineFinder(); 45 45 void python_STFitEntry(); 46 /* 47 void python_SDWriter(); 48 */ 46 47 void python_STWriter(); 49 48 void python_Logger(); 50 49
Note:
See TracChangeset
for help on using the changeset viewer.