Changeset 442 for trunk


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

fix output reference pixel calculation
add stokes conversion

Location:
trunk/src
Files:
2 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//
  • trunk/src/SDWriter.h

    r199 r442  
    5050
    5151// Format can be "SDFITS", "FITS", "MS2" or "ASCII"
     52// Stokes conversion available for FITS and ASCII at present
    5253  casa::Int setFormat(const string &format = "SDFITS");
    5354  casa::Int write(const casa::CountedPtr<SDMemTable> table,
    54             const string &filename);
     55            const string &filename, casa::Bool toStokes);
    5556
    5657private:
Note: See TracChangeset for help on using the changeset viewer.