- Timestamp:
- 02/11/10 11:45:38 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r1695 r1696 876 876 def plotazel(self): 877 877 """ 878 plot azimuth and elevation versus time of a scantable 879 """ 880 import pylab as PL 881 from matplotlib.dates import DateFormatter, timezone, HourLocator, MinuteLocator, DayLocator 878 plot azimuth and elevation versus time of a scantable 879 """ 880 from matplotlib import pylab as PL 881 from matplotlib.dates import DateFormatter, timezone 882 from matplotlib.dates import HourLocator, MinuteLocator,SecondLocator, DayLocator 882 883 from matplotlib.ticker import MultipleLocator 883 884 from matplotlib.numerix import array, pi … … 899 900 minloc = HourLocator(range(0,23,12)) 900 901 timefmt = DateFormatter("%b%d") 902 elif tdel > 24./60.: 903 timefmt = DateFormatter('%H:%M') 904 majloc = HourLocator() 905 minloc = MinuteLocator(30) 901 906 else: 902 timefmt = DateFormatter('%H') 903 majloc = HourLocator() 904 minloc = MinuteLocator(20) 907 timefmt = DateFormatter('%H:%M') 908 majloc = MinuteLocator(interval=5) 909 minloc = SecondLocator(30) 910 905 911 PL.title(dstr) 906 912 PL.plot_date(t,el,'b,', tz=tz) 907 #ax.grid(True)908 913 ax.yaxis.grid(True) 909 yloc = MultipleLocator(30) 910 ax.set_ylim(0,90) 911 ax.xaxis.set_major_formatter(timefmt) 912 ax.xaxis.set_major_locator(majloc) 913 ax.xaxis.set_minor_locator(minloc) 914 ax.yaxis.set_major_locator(yloc) 914 915 915 if tdel > 1.0: 916 916 labels = ax.get_xticklabels() … … 923 923 if az[irow] < 0: az[irow] += 360.0 924 924 925 ax = PL.subplot(2,1,2) 926 PL.xlabel('Time (UT)') 927 PL.ylabel('Az [deg.]') 928 PL.plot_date(t,az,'b,', tz=tz) 929 ax.set_ylim(0,360) 930 #ax.grid(True) 931 ax.yaxis.grid(True) 932 #hfmt = DateFormatter('%H') 933 #hloc = HourLocator() 934 yloc = MultipleLocator(60) 925 ax2 = ax.figure.add_subplot(2,1,2, sharex=ax) 926 ax2.set_xlabel('Time (UT)') 927 ax2.set_ylabel('Az [deg.]') 928 ax2.plot_date(t,az,'b,', tz=tz) 929 ax2.yaxis.grid(True) 930 # set this last as x axis is shared 935 931 ax.xaxis.set_major_formatter(timefmt) 936 932 ax.xaxis.set_major_locator(majloc) 937 933 ax.xaxis.set_minor_locator(minloc) 938 ax.yaxis.set_major_locator(yloc)939 if tdel > 1.0:940 labels = ax.get_xticklabels()941 PL.setp(labels, fontsize=10)942 934 PL.ion() 943 935 PL.draw() … … 947 939 plot telescope pointings 948 940 """ 949 import pylab as PL 950 from matplotlib.dates import DateFormatter, timezone 951 from matplotlib.ticker import MultipleLocator 952 from matplotlib.numerix import array, pi, zeros 941 from matplotlib import pylab as PL 942 from matplotlib.numerix import array 953 943 dir = array(self._data.get_directionval()).transpose() 954 944 ra = dir[0]*180./pi … … 960 950 ax = PL.axes([0.1,0.1,0.8,0.8]) 961 951 ax.set_aspect('equal') 962 PL.plot(ra, dec, 'b,')952 PL.plot(ra, dec, 'b,') 963 953 PL.xlabel('RA [deg.]') 964 954 PL.ylabel('Declination [deg.]')
Note:
See TracChangeset
for help on using the changeset viewer.