Changeset 2052 for branches


Ignore:
Timestamp:
03/17/11 18:46:12 (14 years ago)
Author:
Kana Sugimoto
Message:

merged a bug fix in trunk(r2051)

Location:
branches/casa-prerelease/pre-asap
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/casa-prerelease/pre-asap

    • Property svn:mergeinfo changed
      /trunkmerged: 2051
  • branches/casa-prerelease/pre-asap/Makefile

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/SConstruct

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/apps

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/external-alma

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/external-alma/atnf/pks/pks_maths.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/getsvnrev.sh

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/python

  • branches/casa-prerelease/pre-asap/python/asapplotter.py

    r2038 r2052  
    5555        self._ipanel = -1
    5656        self._panelrows = []
     57        self._headstring = None
     58        self._headsize = None
    5759
    5860    def _translate(self, instr):
     
    842844        self._offset = None
    843845        self.set_selection(None, False)
     846        self._reset_header()
     847
     848    def _reset_header(self):
     849        self._headsize = None
     850        self._headstring = None
    844851
    845852    def _plot(self, scan):
     
    13771384    # printing header information
    13781385    @asaplog_post_dec
    1379     def print_header(self, plot=True, fontsize=9, logger=False, selstr='', extrastr=''):
     1386    def print_header(self, plot=True, fontsize=None, logger=False, selstr='', extrastr=''):
    13801387        """
    13811388        print data (scantable) header on the plot and/or logger.
    13821389        Parameters:
    13831390            plot:      whether or not print header info on the plot.
    1384             fontsize:  header font size (valid only plot=True)
     1391            fontsize:  header font size (valid only plot=True) default: 9
    13851392            logger:    whether or not print header info on the logger.
    13861393            selstr:    additional selection string (not verified)
     
    13951402        ssum=self._data.__str__()
    13961403        # Print Observation header to the upper-left corner of plot
    1397         if plot:
     1404        if self._headstring:
     1405            headstr = self._headstring
     1406            if extrastr != '': headstr[0]=extrastr+'\n'+headstr[0]
     1407            if selstr != '': headstr[2] += selstr
     1408            fontsize = fontsize or self._headsize
     1409        else:
    13981410            headstr=[ssum[ssum.find('Observer:'):ssum.find('Flux Unit:')]]
    13991411            headstr.append(ssum[ssum.find('Beams:'):ssum.find('Observer:')]
    1400                          +ssum[ssum.find('Rest Freqs:'):ssum.find('Abcissa:')])
     1412                           +ssum[ssum.find('Rest Freqs:'):ssum.find('Abcissa:')])
    14011413            if extrastr != '': headstr[0]=extrastr+'\n'+headstr[0]
    1402             #headstr[1]='Data File:     '+(filestr or 'unknown')+'\n'+headstr[1]
    14031414            ssel='***Selections***\n'+(selstr+self._data.get_selection().__str__() or 'none')
    14041415            headstr.append(ssel)
     1416            del ssel
     1417        fontsize = fontsize or 9
     1418        self._headsize = fontsize
     1419        self._headstring = headstr
     1420
     1421        if plot:
     1422            self._plotter.hold()
    14051423            nstcol=len(headstr)
    1406 
    1407             self._plotter.hold()
    14081424            for i in range(nstcol):
    14091425                self._plotter.figure.text(0.03+float(i)/nstcol,0.98,
     
    14181434                            verticalalignment='bottom',fontsize=8)
    14191435            self._plotter.release()
    1420             del headstr, ssel
    14211436        if logger:
     1437            sextra = headstr[0][0:headstr[0].find('Observer:')].rstrip('\n')
     1438            selstr = "Selections:    "+(headstr[2].lstrip('***Selections***\n') or 'none')+"\n \n"
     1439               
    14221440            asaplog.push("----------------\n  Plot Summary\n----------------")
    1423             asaplog.push(extrastr)
    1424             asaplog.push(ssum[ssum.find('Beams:'):])
    1425         del ssum
     1441            asaplog.push(sextra)
     1442            asaplog.push(ssum[ssum.find('Beams:'):ssum.find('Selection:')]\
     1443                         + selstr + ssum[ssum.find('Scan Source'):])
     1444        del ssum, headstr
     1445
     1446#     def clear_header(self):
     1447#         if not self._headstring or len(self._plotter.figure.texts) == 0:
     1448#             asaplog.push("No header has been plotted. Exit without any operation")
     1449#             asaplog.post("WARN")
     1450#         else:
     1451#             self._plotter.hold()
     1452#             for textobj in self._plotter.figure.texts:
     1453#                 if textobj.get_text() in self._headstring:
     1454#                     try:
     1455#                         textobj.remove()
     1456#                     except NotImplementedError:
     1457#                         self._plotter.figure.texts.pop(self._plotter.figure.texts.index(textobj))
     1458#             self._plotter.release()
     1459#         self._reset_header()
  • branches/casa-prerelease/pre-asap/python/casatoolbar.py

    r1983 r2052  
    181181    ### actual plotting of the new page
    182182    def _new_page(self,goback=False):
     183        top = None
    183184        if self.plotter._startrow <= 0:
    184185            msg = "The page counter is reset due to chages of plot settings. "
     
    187188            asaplog.post('WARN')
    188189            goback = False
    189            
     190        else:
     191            top = self.plotter._plotter.figure.subplotpars.top
     192
    190193        self.plotter._plotter.hold()
    191194        if goback:
     
    196199        self.plotter._plotter.release()
    197200        self.plotter._plotter.tidy()
     201        if self.plotter._headstring:
     202            if top and top != self.plotter._margins[3]:
     203                # work around for sdplot in CASA. complete checking in future?
     204                self.plotter._plotter.figure.subplots_adjust(top=top)
     205            self.plotter.print_header()
    198206        self.plotter._plotter.show(hardrefresh=False)
     207        del top
    199208
    200209    ### calculate the panel ID and start row to plot the previous page
  • branches/casa-prerelease/pre-asap/src

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/casa-prerelease/pre-asap/src/SConscript

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.