Changeset 601


Ignore:
Timestamp:
05/02/05 09:23:58 (19 years ago)
Author:
mar637
Message:

Fixed asap00015, extracted pol_lablelling into separate function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release-1-fixes/python/asapplotter.py

    r597 r601  
    8282            maxrows = 9
    8383            if self._data[0].nrow() > maxrows:
    84                 print "Scan to be plotted contains more than %d rows.\n" \
    85                       "Selecting first %d rows..." % (maxrows,maxrows)
    86                 self._cursor["t"] = range(maxrows)
     84                if self._cursor["t"] is None or \
     85                       (isinstance(self._cursor["t"],list) and \
     86                        len(self._cursor["t"]) > maxrows ):
     87                    print "Scan to be plotted contains more than %d rows.\n" \
     88                          "Selecting first %d rows..." % (maxrows,maxrows)
     89                    self._cursor["t"] = range(maxrows)
    8790            self._plot_time(self._data[0], self._stacking)
    8891        elif self._panelling == 's':
     
    172175                else:
    173176                    if colmode == 'p':
    174                         if polmode == "stokes":
    175                             llab = scan._getpolarizationlabel(0,1,0)
    176                         elif polmode == "stokes2":
    177                             llab = scan._getpolarizationlabel(0,1,1)
    178                         elif polmode == "circular":
    179                             llab = scan._getpolarizationlabel(0,0,0)
    180                         else:
    181                             llab = scan._getpolarizationlabel(1,0,0)
     177                        llab = self._get_pollabel(scan, polmode)
    182178                    else:                   
    183179                        llab = self._ldict.get(colmode)+' '+str(j)
     
    265261                else:
    266262                    if colmode == 'p':
    267                         if polmode == "stokes":
    268                             llab = scan._getpolarizationlabel(0,1,0)
    269                         elif polmode == "stokes2":
    270                             llab = scan._getpolarizationlabel(0,1,1)
    271                         elif polmode == "circular":
    272                             llab = scan._getpolarizationlabel(0,0,0)
    273                         else:
    274                             llab = scan._getpolarizationlabel(1,0,0)
     263                        llab = self._get_pollabel(scan, polmode)
    275264                    else:
    276265                        llab = self._ldict.get(colmode)+' '+str(j)
     
    377366                        tlab = self._title[ii]
    378367                    else:
    379                         tlab = self._ldict.get(self._panelling)+' '+str(i)
     368                        if self._panelling == 'p':
     369                            tlab = self._get_pollabel(scan, polmode)
     370                        else:
     371                            tlab = self._ldict.get(self._panelling)+' '+str(i)
    380372                    if self._lmap and len(self._lmap) > 0:
    381373                        llab = self._lmap[jj]
    382374                    else:
    383375                        if colmode == 'p':
    384                             if polmode == "stokes":
    385                                 llab = scan._getpolarizationlabel(0,1,0)
    386                             elif polmode == "stokes2":
    387                                 llab = scan._getpolarizationlabel(0,1,1)
    388                             elif polmode == "circular":
    389                                 llab = scan._getpolarizationlabel(0,0,0)
    390                             else:
    391                                 llab = scan._getpolarizationlabel(1,0,0)
     376                            llab = self._get_pollabel(scan, polmode)
    392377                        else:
    393378                            llab = self._ldict.get(colmode)+' '+str(j)
    394                 if self._panelling == 'p':
    395                     if polmode == "stokes":
    396                         tlab = scan._getpolarizationlabel(0,1,0)
    397                     elif polmode == "stokes2":
    398                         tlab = scan._getpolarizationlabel(0,1,1)
    399                     elif polmode == "circular":
    400                         tlab = scan._getpolarizationlabel(0,0,0)
    401                     else:
    402                         tlab = scan._getpolarizationlabel(1,0,0)
    403379                self._plotter.set_line(label=llab)
    404380                self._plotter.plot(x,y,m)
     
    646622        if self._data and refresh: self.plot()
    647623
     624    def _get_pollabel(self, scan, polmode):
     625        tlab = ""
     626        if polmode == "stokes":
     627            tlab = scan._getpolarizationlabel(0,1,0)
     628        elif polmode == "stokes2":
     629            tlab = scan._getpolarizationlabel(0,1,1)
     630        elif polmode == "circular":
     631            tlab = scan._getpolarizationlabel(0,0,0)
     632        else:
     633            tlab = scan._getpolarizationlabel(1,0,0)
     634        return tlab
    648635           
    649636if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.