Changeset 1443


Ignore:
Timestamp:
09/01/08 11:54:04 (16 years ago)
Author:
Malte Marquarding
Message:

Fix ticket #127; still have to add class header hack

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r1433 r1443  
    9898                                               "include", "casacore"))
    9999    if not conf.CheckLib("casa_casa", language='c++'): Exit(1)
    100     conf.env.PrependUnique(LIBS=["casa_ms", "casa_components",
     100    conf.env.PrependUnique(LIBS=["casa_images", "casa_ms", "casa_components",
    101101                                 "casa_coordinates", "casa_lattices",
    102102                                 "casa_fits", "casa_measures", "casa_scimath",
  • trunk/python/scantable.py

    r1435 r1443  
    9191                                       'MS2' (saves as an aips++
    9292                                              MeasurementSet V2)
     93                                       'FITS' (save as image FITS - not
     94                                               readable by class)
     95                                       'CLASS' (save as FITS readable by CLASS)
    9396            overwrite:   If the file should be overwritten if it exists.
    9497                         The default False is to return with warning
  • trunk/src/STWriter.cpp

    r1410 r1443  
    4747#include <tables/Tables/ArrayColumn.h>
    4848
    49 //#include "SDFITSImageWriter.h"
     49#include "STFITSImageWriter.h"
    5050#include "STAsciiWriter.h"
    5151#include "STHeader.h"
     
    5858STWriter::STWriter(const std::string &format)
    5959{
     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
     74STWriter::~STWriter()
     75{
     76   if (writer_) {
     77     delete writer_;
     78   }
     79}
     80
     81Int STWriter::setFormat(const std::string &format)
     82{
     83  if (format != format_) {
     84    if (writer_) delete writer_;
     85  }
     86
    6087  format_ = format;
    6188  String t(format_);
     
    6592  } else if (t== "SDFITS") {
    6693    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") {
    9595    writer_ = 0;
    9696  } else {
     
    110110    } else {
    111111      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;
    112120    }
    113121  }
Note: See TracChangeset for help on using the changeset viewer.