Changeset 2704 for trunk


Ignore:
Timestamp:
12/20/12 14:38:59 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No (a bug fix)

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

invoke asapplotter.plotazel (sdplot with plottype="azel") and
asapplotter.plotpointing (sdplot with plottype="pointing")
before invoking asapplotter.plot (sdplot with plottype="spectra") or
asapplotter.plottp (sdplot with plottype="totalpower") after loading
casapy/asap.

Put in Release Notes: No

Module(s): asapplotter and sdplot

Description:

Fixed a bug which caused azel and pointing plot fail when the plot
commands are invoked before running spectral or totalpower plot at
least once after loading casapy/asap.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r2700 r2704  
    6060        self._legendloc = None
    6161        ### scantable plot settings
     62        self._plotmode = "spectra"
    6263        self._panelling = None
    6364        self._stacking = None
     
    961962            are consistent e.g. all 'channel' or all 'velocity' etc.
    962963        """
     964        self._plotmode = "spectra"
    963965        if not self._data and not scan:
    964966            msg = "Input is not a scantable"
     
    13041306        plot azimuth and elevation versus time of a scantable
    13051307        """
     1308        self._plotmode = "azel"
    13061309        visible = rcParams['plotter.gui']
    13071310        from matplotlib import pylab as PL
     
    13111314        from matplotlib.ticker import MultipleLocator
    13121315        from numpy import array, pi
    1313         if PL.gcf() == self._plotter.figure:
     1316        if self._plotter and (PL.gcf() == self._plotter.figure):
    13141317            # the current figure is ASAP plotter. Use mpl plotter
    13151318            figids = PL.get_fignums()
    1316             if figids[-1] > 0:
    1317                 PL.figure(figids[-1])
    1318             else:
    1319                 PL.figure(1)
     1319            PL.figure(max(figids[-1],1))
     1320
    13201321        if not visible or not self._visible:
    13211322            PL.ioff()
     
    14231424                         ''(no projection [deg])|'coord'(not implemented)
    14241425        """
     1426        self._plotmode = "pointing"
    14251427        from numpy import array, pi
    14261428        from asap import scantable
     
    15441546        from matplotlib import pylab as PL
    15451547        from numpy import array, pi
    1546         if PL.gcf() == self._plotter.figure:
     1548        if self._plotter and (PL.gcf() == self._plotter.figure):
    15471549            # the current figure is ASAP plotter. Use mpl plotter
    15481550            figids = PL.get_fignums()
    1549             if figids[-1] > 0:
    1550                 PL.figure(figids[-1])
    1551             else:
    1552                 PL.figure(1)
     1551            PL.figure(max(figids[-1],1))
     1552
    15531553        if not visible or not self._visible:
    15541554            PL.ioff()
     
    15881588    @asaplog_post_dec
    15891589    def plottp(self, scan=None):
     1590        self._plotmode = "totalpower"
    15901591        from asap import scantable
    15911592        if not self._data and not scan:
     
    17751776        spectra which belong to a grid.
    17761777        """
     1778        self._plotmode = "grid"
    17771779        from asap import scantable
    17781780        from numpy import array, ma, cos
Note: See TracChangeset for help on using the changeset viewer.