Changeset 626


Ignore:
Timestamp:
05/05/05 12:30:37 (19 years ago)
Author:
mar637
Message:

fix for asap0019 from Release-1

Location:
trunk/python
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapfitter.py

    r526 r626  
    132132            if len(ps) == 0:
    133133                self.fitter.estimate()
    134         self.fitter.fit()
     134        try:
     135            self.fitter.fit()
     136        except RuntimeError, msg:
     137            print msg           
    135138        self._fittedrow = row
    136139        self.fitted = True
     
    336339            xlab = self.data._getabcissalabel(self._fittedrow)
    337340            m = self.data._getmask(self._fittedrow)
    338             ylab = r'Flux'
    339 
    340         colours = ["grey60","grey80","red","orange","purple","yellow","magenta", "cyan"]
     341            ylab = self.data._get_ordinate_label()
     342
     343        colours = ["grey60","grey80","red","orange","purple","green","magenta", "cyan"]
    341344        self._p.palette(1,colours)
    342345        self._p.set_line(label='Spectrum')
  • trunk/python/asapplotter.py

    r607 r626  
    8080                self.set_cursor(refresh=False)
    8181        if self._panelling == 't':
    82             maxrows = 9
     82            maxrows = 25
    8383            if self._data[0].nrow() > maxrows:
    8484                if self._cursor["t"] is None or \
     
    148148                y = None
    149149                m = None
    150                 if not self._title:
     150                if self._title is None:
    151151                    tlab = scan._getsourcename(rowsel)                   
    152152                else:
    153                     if len(self._title) == n:
     153                    if len(self._title) >= n:
    154154                        tlab = self._title[rowsel]
    155155                    else:
     
    169169                    ylab = self._ordinate
    170170                else:
    171                     ylab = 'Flux ('+scan.get_fluxunit()+')'
     171                    ylab = scan._get_ordinate_label()
    172172                m = scan._getmask(rowsel)
    173173                if self._lmap and len(self._lmap) > 0:
     
    206206            if self._rows and self._cols:
    207207                n = min(n,self._rows*self._cols)
    208                 self._plotter.set_panel(rows=self._rows,cols=self._cols,
     208                self._plotter.set_panels(rows=self._rows,cols=self._cols,
    209209                                         nplots=n)
    210210            else:
    211                 self._plotter.set_panel(rows=n,cols=0,nplots=n)
     211                self._plotter.set_panels(rows=n,cols=0,nplots=n)
    212212        else:
    213213            self._plotter.set_panels()
     214
    214215        for scan in scans:
    215216            self._plotter.palette(1)
     
    255256                    ylab = self._ordinate
    256257                else:
    257                     ylab = 'Flux ('+scan.get_fluxunit()+')'
     258                    ylab = scan._get_ordinate_label()
    258259                m = scan._getmask(rowsel)
    259260                if self._lmap and len(self._lmap) > 0:
     
    354355                    ylab = self._ordinate
    355356                else:
    356                     ylab = 'Flux ('+scan.get_fluxunit()+')'
     357                    ylab = scan._get_ordinate_label()
    357358                m = scan._getmask(rowsel)
    358359                if colmode == 's' or colmode == 't':
  • trunk/python/scantable.py

    r596 r626  
    10661066        if mask is None:
    10671067            from numarray import ones
    1068             mask = list(ones(scan.nchan()))
     1068            mask = list(ones(self.nchan()))
    10691069        from asap.asapfitter import fitter
    10701070        f = fitter()
     
    14281428            i = j       
    14291429        return segments
     1430    def _get_ordinate_label(self):
     1431        fu = "("+self.get_fluxunit()+")"
     1432        import re
     1433        lbl = "Intensity"
     1434        if re.match(".K.",fu):
     1435            lbl = "Brightness Temperature "+ fu
     1436        elif re.match(".Jy.",fu):
     1437            lbl = "Flux density "+ fu
     1438        return lbl
     1439       
Note: See TracChangeset for help on using the changeset viewer.