Ignore:
Timestamp:
10/10/12 12:17:12 (12 years ago)
Author:
Malte Marquarding
Message:

Ticket #280: Use FITSSpectralUtil::specsysFromFrame to write correct FITS output frame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STWriter.cpp

    r2652 r2657  
    4040
    4141#include <atnf/PKSIO/PKSrecord.h>
    42 #ifndef NOPKSMS
    43 #include <atnf/PKSIO/PKSMS2writer.h>
    44 #endif
    4542#include <atnf/PKSIO/PKSSDwriter.h>
    4643#include <atnf/PKSIO/SrcType.h>
     
    5148#include <tables/Tables/ArrayColumn.h>
    5249
     50#include <fits/FITS/FITSSpectralUtil.h>
     51
    5352#include "STFITSImageWriter.h"
    5453#include "STAsciiWriter.h"
     
    6867  t.upcase();
    6968  if (t == "MS2") {
    70     #ifdef NOPKSMS
    7169    throw (AipsError("MS2 OUTPUT FORMAT IS NO LONGER SUPPORTED"));
    72     #else
    73     writer_ = new PKSMS2writer();
    74     #endif
    7570  } else if (t == "SDFITS") {
    7671    writer_ = new PKSSDwriter();
     
    9994  t.upcase();
    10095  if (t== "MS2") {
    101     #ifdef NOPKSMS
    10296    throw (AipsError("MS2 OUTPUT FORMAT IS NO LONGER SUPPORTED"));
    103     #else
    104     writer_ = new PKSMS2writer();
    105     #endif
    10697  } else if (t== "SDFITS") {
    10798    writer_ = new PKSSDwriter();
     
    121112  // in asap on-the-fly.
    122113
     114  String freqframe;
     115  FITSSpectralUtil::specsysFromFrame(freqframe,
     116                                     in->frequencies().getFrame(true));
    123117  CountedPtr<Scantable> inst = in;
    124118  if (in->frequencies().getFrame(true) != in->frequencies().getFrame(false)) {
     119    FITSSpectralUtil::specsysFromFrame(freqframe,
     120                                     in->frequencies().getFrame(false));
     121 
    125122    STMath stm(false);
    126123    inst = stm.frequencyAlign(in);
     
    151148  // before. Need to check with the Offline User Test data
    152149  STHeader hdr = inst->getHeader();
    153   //const Int nPol  = hdr.npol;
    154   //const Int nChan = hdr.nchan;
    155150  std::vector<uint> ifs = inst->getIFNos();
    156151  int nIF = inst->nif();//ifs.size();
     
    177172  // Create the output file and write static data.
    178173  Int status;
    179 //   status = writer_->create(String(filename), hdr.observer, hdr.project,
    180 //                            hdr.antennaname, hdr.antennaposition,
    181 //                            hdr.obstype, hdr.fluxunit,
    182 //                            hdr.equinox, hdr.freqref,
    183 //                            nChan, nPol, havexpol, False);
    184174  status = writer_->create(String(filename), hdr.observer, hdr.project,
    185175                           inst->getAntennaName(), hdr.antennaposition,
    186176                           hdr.obstype, hdr.fluxunit,
    187                            hdr.equinox, hdr.freqref,
     177                           hdr.equinox, freqframe,
    188178                           nChan, nPol, havexpol, False);
    189179  if ( status ) {
Note: See TracChangeset for help on using the changeset viewer.