Changeset 1148


Ignore:
Timestamp:
08/16/06 13:14:25 (18 years ago)
Author:
mar637
Message:

use get*nos instead of n* (* can be scan, beam etc.). This showed a bug in c+ which was fixed.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1146 r1148  
    474474             'i': scan.getif, 'p': scan.getpol, 't': scan._gettime }
    475475
    476         polmodes = dict(zip(self._selection.get_pols(),self._selection.get_poltypes()))
    477         n,nstack = self._get_selected_n(scan)
     476        polmodes = dict(zip(self._selection.get_pols(),
     477                            self._selection.get_poltypes()))
     478        # this returns either a tuple of numbers or a length  (ncycles)
     479        # convert this into lengths
     480        n0,nstack0 = self._get_selected_n(scan)
     481        n = len(n0)
     482        if isinstance(n0, int): n = n0
     483        nstack = len(nstack0)
     484        if isinstance(nstack0, int): nstack = nstack0
    478485        maxpanel, maxstack = 16,8
    479486        if n > maxpanel or nstack > maxstack:
    480487            from asap import asaplog
     488            maxn = 0
     489            if nstack > maxstack: maxn = maxstack
     490            if n > maxpanel: maxn = maxpanel
    481491            msg ="Scan to be plotted contains more than %d selections.\n" \
    482                   "Selecting first %d selections..." % (maxpanel,maxpanel)
     492                  "Selecting first %d selections..." % (maxn, maxn)
    483493            asaplog.push(msg)
    484494            print_log()
    485495            n = min(n,maxpanel)
    486496            nstack = min(nstack,maxstack)
    487 
    488497        if n > 1:
    489498            ganged = rcParams['plotter.ganged']
     
    598607
    599608    def _get_selected_n(self, scan):
    600         d1 = {'b': scan.nbeam, 's': scan.nscan,
    601              'i': scan.nif, 'p': scan.npol, 't': scan.ncycle }
    602         d2 = { 'b': len(self._selection.get_beams()),
    603                's': len(self._selection.get_scans()),
    604                'i': len(self._selection.get_ifs()),
    605                'p': len(self._selection.get_pols()),
    606                't': len(self._selection.get_cycles()) }
     609        d1 = {'b': scan.getbeamnos, 's': scan.getscannos,
     610             'i': scan.getifnos, 'p': scan.getpolnos, 't': scan.ncycle }
     611        d2 = { 'b': self._selection.get_beams(),
     612               's': self._selection.get_scans(),
     613               'i': self._selection.get_ifs(),
     614               'p': self._selection.get_pols(),
     615               't': self._selection.get_cycles() }
    607616        n =  d2[self._panelling] or d1[self._panelling]()
    608617        nstack = d2[self._stacking] or d1[self._stacking]()
  • trunk/src/Scantable.cpp

    r1111 r1148  
    529529int Scantable::nscan() const {
    530530  Vector<uInt> scannos(scanCol_.getColumn());
    531   uInt nout = GenSort<uInt>::sort( scannos, Sort::Ascending,
     531  uInt nout = genSort( scannos, Sort::Ascending,
    532532                       Sort::QuickSort|Sort::NoDuplicates );
    533533  return int(nout);
     
    547547{
    548548  Vector<uInt> nos(col.getColumn());
    549   GenSort<uInt>::sort( nos, Sort::Ascending,
    550                        Sort::QuickSort|Sort::NoDuplicates );
     549  uInt n = genSort( nos, Sort::Ascending, Sort::QuickSort|Sort::NoDuplicates );
     550  nos.resize(n, True);
    551551  std::vector<uint> stlout;
    552552  nos.tovector(stlout);
Note: See TracChangeset for help on using the changeset viewer.