Changeset 1684 for branches/alma


Ignore:
Timestamp:
02/04/10 20:42:12 (14 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1810

Ready to Release: Yes

Interface Changes: Yes

What Interface Changed: Added 'antenna' parameter to scantable constructor

Test Programs: List test programs

Put in Release Notes: Yes

Module(s): atnf

Description: Describe your changes here...

I have added 'antenna' parameter to scantable constructor to be able to
select specific antenna from MS data with multiple antenna data.
Currently, only single antenna selection is working. For multiple antenna
selection, only first selection is used.


Location:
branches/alma
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/python/scantable.py

    r1681 r1684  
    1212    """
    1313
    14     def __init__(self, filename, average=None, unit=None, getpt=None):
     14    def __init__(self, filename, average=None, unit=None, getpt=None, antenna=None):
    1515        """
    1616        Create a scantable from a saved one or make a reference
     
    3939        if getpt is None:
    4040            getpt = True
     41        if antenna is None:
     42            antenna = ''
     43        elif type(antenna) == int:
     44            antenna = '%s'%antenna
     45        elif type(antenna) == list:
     46            tmpstr = ''
     47            for i in range( len(antenna) ):
     48                if type(antenna[i]) == int:
     49                    tmpstr = tmpstr + ('%s,'%(antenna[i]))
     50                elif type(antenna[i]) == str:
     51                    tmpstr=tmpstr+antenna[i]+','
     52                else:
     53                    asaplog.push('Bad antenna selection.')
     54                    print_log('ERROR')
     55                    return
     56            antenna = tmpstr.rstrip(',')
    4157        varlist = vars()
    4258        from asap._asap import stmath
     
    8096                            raise IOError(msg)
    8197                else:
    82                     self._fill([filename], unit, average, getpt)
     98                    self._fill([filename], unit, average, getpt, antenna)
    8399            elif (isinstance(filename, list) or isinstance(filename, tuple)) \
    84100                  and isinstance(filename[-1], str):
    85                 self._fill(filename, unit, average, getpt)
     101                self._fill(filename, unit, average, getpt, antenna)
    86102        self._add_history("scantable", varlist)
    87103        print_log()
     
    21642180        return (sum(nchans)/len(nchans) == nchans[0])
    21652181
    2166     def _fill(self, names, unit, average, getpt):
     2182    def _fill(self, names, unit, average, getpt, antenna):
    21672183        import os
    21682184        from asap._asap import stfiller
     
    21922208            asaplog.push(msg, False)
    21932209            print_log()
    2194             r._open(name, -1, -1, getpt)
     2210            r._open(name, antenna, -1, -1, getpt)
    21952211            r._read()
    21962212            if average:
  • branches/alma/src/STFiller.cpp

    r1683 r1684  
    7575  nreader_(0)
    7676{
    77   open(filename, whichIF, whichBeam);
     77  open(filename, "", whichIF, whichBeam);
    7878}
    7979
     
    8282  close();
    8383}
    84 
    85 void STFiller::open( const std::string& filename, int whichIF, int whichBeam, casa::Bool getPt )
     84 
     85void STFiller::open( const std::string& filename, const std::string& antenna, int whichIF, int whichBeam, casa::Bool getPt )
    8686{
    8787  if (table_.null())  {
     
    122122  //
    123123
    124   if ( (reader_ = getPKSreader(inName, 0, 0, format, beams, ifs,
     124  if ( (reader_ = getPKSreader(inName, antenna, 0, 0, format, beams, ifs,
    125125                              nchans, npols, haveXPol_,haveBase, haveSpectra
    126126                              )) == 0 )  {
  • branches/alma/src/STFiller.h

    r1603 r1684  
    7676   * @exception AipsError Creation of PKSreader failed
    7777   */
    78   void open( const std::string& filename, int whichIF=-1, int whichBeam=-1, casa::Bool getPt=casa::False );
     78  void open( const std::string& filename, const std::string& antenna, int whichIF=-1, int whichBeam=-1, casa::Bool getPt=casa::False );
    7979
    8080  /**
Note: See TracChangeset for help on using the changeset viewer.