Changeset 442 for trunk/src/SDWriter.cc


Ignore:
Timestamp:
02/15/05 11:57:48 (19 years ago)
Author:
kil064
Message:

fix output reference pixel calculation
add stokes conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDWriter.cc

    r324 r442  
    111111
    112112Int SDWriter::write(const CountedPtr<SDMemTable> in,
    113                     const std::string &filename)
     113                    const std::string &filename, Bool toStokes)
    114114{
    115115
     
    119119     Bool verbose = True;
    120120     SDFITSImageWriter iw;
    121      if (iw.write(*in, filename, verbose)) {
     121     if (iw.write(*in, filename, verbose, toStokes)) {
    122122        return 0;
    123123     } else {
     
    126126  } else if (cFormat=="ASCII") {
    127127     SDAsciiWriter iw;
    128      if (iw.write(*in, filename)) {
     128     if (iw.write(*in, filename, toStokes)) {
    129129        return 0;
    130130     } else {
     
    139139  const Int nPol  = hdr.npol;
    140140  const Int nChan = hdr.nchan;
     141  if (toStokes) {
     142     cerr << "Stokes conversion not yet available with SDFITS or MS" << endl;
     143  }
    141144
    142145// Get Freq table
     
    200203        Double          srcVel = 0.0;
    201204
    202 // The writer will assume refPix = nChan/2 + 1.  So recompute
     205// The writer will assume refPix = nChan/2 (0-rel).  So recompute
    203206// the frequency at this location.
    204207
     
    206209        Double          crval = sdft.referenceValue(freqID);
    207210        Double          crpix = sdft.referencePixel(freqID);
    208         Double          pixel = nChan/2 + 1;
     211        Double          pixel = nChan/2;
    209212        Double          refFreqNew = (pixel-crpix)*cdelt + crval;
    210213//
Note: See TracChangeset for help on using the changeset viewer.