Changeset 1143


Ignore:
Timestamp:
08/16/06 09:42:09 (18 years ago)
Author:
mar637
Message:

Implemented Ticket #45 as scantable.mx_quotient.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1141 r1143  
    791791            in channels only - align if necessary
    792792        Parameters:
    793             one scan or comma separated  scans
    794793            mask:     an optional mask (only used for 'var' and 'tsys'
    795794                      weighting)
     
    13321331        return s
    13331332
    1334     def mx_quotient(self, averageoff='median'):
    1335         """
     1333    def mx_quotient(self, mask = None, weight='median'):
     1334        """
     1335        Form a quotient using "off" beams when observing in "MX" mode.
     1336        Parameters:
     1337            weight:         How to average the off beams.  Default is 'median'.
    13361338        """
     1339        if mask is None: mask = ()
    13371340        varlist = vars()
    13381341        on = scantable(self._math._mx_extract(self, 'on'))
    1339         s._add_history("mx_quotient", varlist)
     1342        preoff = scantable(self._math._mx_extract(self, 'off'))
     1343        off = preoff.average_time(mask=mask, weight=weight, scanav=False)
    13401344        print_log()
    13411345        from asapmath  import quotient
    1342         return quotient(on, off)
     1346        q = quotient(on, off)
     1347        q._add_history("mx_quotient", varlist)
     1348        return q
    13431349
    13441350    def freq_switch(self, insitu=None):
  • trunk/src/STMath.cpp

    r1140 r1143  
    13281328}
    13291329
    1330 CountedPtr< Scantable > 
     1330CountedPtr< Scantable >
    13311331  asap::STMath::mxExtract( const CountedPtr< Scantable > & in,
    13321332                           const std::string & scantype )
     
    13441344  TableCopy::copyRows(tout, tab);
    13451345  if (scantype == "on") {
     1346    // re-index SCANNO to 0
    13461347    TableVector<uInt> vec(tout, "SCANNO");
    13471348    vec = 0;
  • trunk/src/STMath.h

    r1140 r1143  
    5454   */
    5555  bool insitu() const { return insitu_;};
    56  
     56
    5757  /**
    5858   * set the currnt @attr inistu state
     
    9696    * @param mask an optional mask if weight allows one
    9797    * @param weight weighting scheme
    98     * @return 
     98    * @return
    9999    */
    100100  casa::CountedPtr< Scantable >
     
    167167    convertPolarisation( const casa::CountedPtr<Scantable>& in,
    168168                         const std::string& newtype);
    169  
    170   casa::CountedPtr<Scantable>
    171       mxExtract( const casa::CountedPtr<Scantable>& in,
    172                  const std::string& scantype = "on" );
     169
     170  casa::CountedPtr<Scantable>
     171    mxExtract( const casa::CountedPtr<Scantable>& in,
     172               const std::string& srctype = "on");
    173173
    174174private:
Note: See TracChangeset for help on using the changeset viewer.