Changeset 2714


Ignore:
Timestamp:
01/07/13 17:26:45 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No (a minor fix)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: unit tests of sdplot

Put in Release Notes: No

Module(s): asapplotter and sdplot

Description: more resetting when new scantable is set to plot.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r2704 r2714  
    112112        self._plotter.legend(self._legendloc)
    113113
     114    ### TODO: it's probably better to define following two methods in
     115    ###       backend dependent class.
    114116    def _new_custombar(self):
    115117        backend=matplotlib.get_backend()
     
    130132            return True
    131133        return False
     134    ### end of TODO
    132135
    133136    def _assert_plotter(self,action="status",errmsg=None):
     
    276279
    277280
    278     ### Forwards to matplotlib axes ###
     281    ### Forwards to methods in matplotlib axes ###
    279282    def text(self, *args, **kwargs):
    280283        self._assert_plotter(action="reload")
     
    415418                del self._data
    416419                msg = "A new scantable is set to the plotter. "\
    417                       "The masks and data selections are reset."
    418                 asaplog.push( msg )
     420                      "The masks, data selections, and labels are reset."
     421                asaplog.push(msg)
    419422            self._data = scan
    420423            # reset
     
    905908            msg = "Can only set mask after a first call to plot()"
    906909            raise RuntimeError(msg)
    907         if len(mask):
     910        if (mask is not None) and len(mask):
    908911            if isinstance(mask, list) or isinstance(mask, tuple):
    909912                self._usermask = array(mask)
     
    926929    ### Reset methods ###
    927930    def _reset(self):
    928         self._usermask = []
    929         self._usermaskspectra = None
     931        """Reset method called when new data is set"""
     932        # reset selections and masks
     933        self.set_selection(None, False)
     934        self.set_mask(None, None, False)
     935        # reset offset
    930936        self._offset = None
    931         self.set_selection(None, False)
     937        # reset header
    932938        self._reset_header()
     939        # reset labels
     940        self._lmap = None # related to stack
     941        self.set_title(None, None, False)
     942        self.set_ordinate(None, None, False)
     943        self.set_abcissa(None, None, False)
    933944
    934945    def _reset_header(self):
Note: See TracChangeset for help on using the changeset viewer.