Ignore:
Timestamp:
08/02/10 19:40:09 (14 years ago)
Author:
Malte Marquarding
Message:

Refactoring of init.py. Moved functionality into separate modules. Some minor fixes to make unit test work under 'standard asap'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1819 r1824  
    1 from asap import rcParams, print_log, print_log_dec
    2 from asap import selector, scantable
    3 from asap import asaplog
     1from asap.parameters import rcParams
     2from asap.selector import selector
     3from asap.scantable import scantable
     4from asap.logging import asaplog, print_log, print_log_dec
    45import matplotlib.axes
    56from matplotlib.font_manager import FontProperties
     
    276277    def set_data(self, scan, refresh=True):
    277278        """
    278         Set a scantable to plot. 
     279        Set a scantable to plot.
    279280        Parameters:
    280281            scan:      a scantable
    281282            refresh:   True (default) or False. If True, the plot is
    282                        replotted based on the new parameter setting(s). 
     283                       replotted based on the new parameter setting(s).
    283284                       Otherwise,the parameter(s) are set without replotting.
    284285        Note:
    285286           The user specified masks and data selections will be reset
    286287           if a new scantable is set. This method should be called before
    287            setting data selections (set_selection) and/or masks (set_mask). 
     288           setting data selections (set_selection) and/or masks (set_mask).
    288289        """
    289290        from asap import scantable
     
    316317            self._datamask = None
    317318        if refresh: self.plot()
    318        
     319
    319320
    320321    def set_mode(self, stacking=None, panelling=None, refresh=True):
     
    327328                          across multiple panels (default 'scan'
    328329            refresh:      True (default) or False. If True, the plot is
    329                           replotted based on the new parameter setting(s). 
     330                          replotted based on the new parameter setting(s).
    330331                          Otherwise,the parameter(s) are set without replotting.
    331332        Note:
     
    369370             cols:   The number of columns of plots
    370371             refresh:  True (default) or False. If True, the plot is
    371                        replotted based on the new parameter setting(s). 
     372                       replotted based on the new parameter setting(s).
    372373                       Otherwise,the parameter(s) are set without replotting.
    373374        Note:
     
    397398            [x,y]start,[x,y]end:  The start and end points of the 'zoom' window
    398399            refresh:  True (default) or False. If True, the plot is
    399                       replotted based on the new parameter setting(s). 
     400                      replotted based on the new parameter setting(s).
    400401                      Otherwise,the parameter(s) are set without replotting.
    401402        Note:
     
    440441                        10: center
    441442            refresh:    True (default) or False. If True, the plot is
    442                         replotted based on the new parameter setting(s). 
     443                        replotted based on the new parameter setting(s).
    443444                        Otherwise,the parameter(s) are set without replotting.
    444445
     
    465466        Parameters:
    466467            refresh:    True (default) or False. If True, the plot is
    467                         replotted based on the new parameter setting(s). 
     468                        replotted based on the new parameter setting(s).
    468469                        Otherwise,the parameter(s) are set without replotting.
    469470        Example:
     
    486487                         data determine the labels
    487488            refresh:     True (default) or False. If True, the plot is
    488                          replotted based on the new parameter setting(s). 
     489                         replotted based on the new parameter setting(s).
    489490                         Otherwise,the parameter(s) are set without replotting.
    490491        Example:
     
    508509                         data determine the labels
    509510            refresh:     True (default) or False. If True, the plot is
    510                          replotted based on the new parameter setting(s). 
     511                         replotted based on the new parameter setting(s).
    511512                         Otherwise,the parameter(s) are set without replotting.
    512513        Example:
     
    529530            colmap:     a list of colour names
    530531            refresh:    True (default) or False. If True, the plot is
    531                         replotted based on the new parameter setting(s). 
     532                        replotted based on the new parameter setting(s).
    532533                        Otherwise,the parameter(s) are set without replotting.
    533534        Example:
     
    553554                         plotter.histogram
    554555            refresh:     True (default) or False. If True, the plot is
    555                          replotted based on the new parameter setting(s). 
     556                         replotted based on the new parameter setting(s).
    556557                         Otherwise,the parameter(s) are set without replotting.
    557558        """
     
    573574                             possible
    574575            refresh:         True (default) or False. If True, the plot is
    575                              replotted based on the new parameter setting(s). 
     576                             replotted based on the new parameter setting(s).
    576577                             Otherwise,the parameter(s) are set without replotting.
    577578        Example:
     
    600601                       seperately
    601602            refresh:   True (default) or False. If True, the plot is
    602                        replotted based on the new parameter setting(s). 
     603                       replotted based on the new parameter setting(s).
    603604                       Otherwise,the parameter(s) are set without replotting.
    604605        """
     
    616617        Parameters:
    617618            layout:   a list of subplots layout in figure coordinate (0-1),
    618                       i.e., fraction of the figure width or height. 
     619                      i.e., fraction of the figure width or height.
    619620                      The order of elements should be:
    620621                      [left, bottom, right, top, horizontal space btw panels,
    621                       vertical space btw panels]. 
     622                      vertical space btw panels].
    622623            refresh:  True (default) or False. If True, the plot is
    623                       replotted based on the new parameter setting(s). 
     624                      replotted based on the new parameter setting(s).
    624625                      Otherwise,the parameter(s) are set without replotting.
    625626        Note
    626627        * When layout is not specified, the values are reset to the defaults
    627628          of matplotlib.
    628         * If any element is set to be None, the current value is adopted. 
     629        * If any element is set to be None, the current value is adopted.
    629630        """
    630631        if layout == []: self._panellayout=self._reset_panellayout()
    631         else: 
     632        else:
    632633            self._panellayout=[None]*6
    633634            self._panellayout[0:len(layout)]=layout
     
    744745             selection:      the spectra to apply the mask to.
    745746             refresh:        True (default) or False. If True, the plot is
    746                              replotted based on the new parameter setting(s). 
     747                             replotted based on the new parameter setting(s).
    747748                             Otherwise,the parameter(s) are set without replotting.
    748749        Example:
     
    961962        #reset the selector to the scantable's original
    962963        scan.set_selection(savesel)
    963        
     964
    964965        #temporary switch-off for older matplotlib
    965966        #if self._fp is not None:
     
    973974            selection:  a selector object (default unset the selection)
    974975            refresh:    True (default) or False. If True, the plot is
    975                         replotted based on the new parameter setting(s). 
     976                        replotted based on the new parameter setting(s).
    976977                        Otherwise,the parameter(s) are set without replotting.
    977978        """
     
    10491050        PL.gcf().subplots_adjust(left=lef,bottom=bot,right=rig,top=top,
    10501051                                 wspace=wsp,hspace=hsp)
    1051        
     1052
    10521053        tdel = max(t) - min(t)
    10531054        ax = PL.subplot(2,1,1)
     
    12711272        print data (scantable) header on the plot and/or logger.
    12721273        Parameters:
    1273             plot:      whether or not print header info on the plot. 
     1274            plot:      whether or not print header info on the plot.
    12741275            fontsize:  header font size (valid only plot=True)
    12751276            autoscale: whether or not autoscale the plot (valid only plot=True)
     
    12801281        if not plot and not logger: return
    12811282        if not self._data: raise RuntimeError("No scantable has been set yet.")
    1282         # Now header will be printed on plot and/or logger. 
    1283         # Get header information and format it. 
     1283        # Now header will be printed on plot and/or logger.
     1284        # Get header information and format it.
    12841285        ssum=self._data.__str__()
    12851286        # Print Observation header to the upper-left corner of plot
     
    12931294            headstr.append(ssel)
    12941295            nstcol=len(headstr)
    1295            
     1296
    12961297            self._plotter.hold()
    12971298            for i in range(nstcol):
     
    13141315            print_log()
    13151316        del ssum
    1316 
    1317 
Note: See TracChangeset for help on using the changeset viewer.