included starcamdata for problem1
[BS_AY250.git] / week4 / problem1 / starcam-plot.py
blob9daf2b9fd14afe838b738f69b3959545c6f31edd
1 #!/usr/bin/env python
2 '''
3 AY250 HW4 Problem 1
4 Make a nice plot
5 Author: Bryan Steinbach
6 '''
7 import numpy as np
8 import pylab
10 azs,dazs,model_dazs,els,dels,model_dels = np.load('starcamdata-20100828.npy')
12 nsource = 15
13 total_time = 6.1
14 allowed_params = 'npae ca ia ie tf ta te'
16 axfs = 10
17 def azelplot():
18 pylab.figure()
20 # Matplotlib doesn't have intelligent layout, so we have to manually pull in the subplots to make room for title and legend
21 pylab.subplots_adjust(bottom=0.16,top=0.89,wspace=0.25,hspace=0.25)
23 pylab.title('Star camera pointing offsets')
25 pylab.subplot(221)
26 pylab.scatter(azs,dazs,facecolor='white')
27 pylab.scatter(azs,model_dazs,marker='+')
28 # pylab.xlabel('Az (degrees)',fontsize=axfs)
29 pylab.ylabel('$\Delta$Az (arcminutes)',fontsize=axfs)
30 pylab.grid()
32 pylab.subplot(222)
33 pylab.scatter(els,dazs,facecolor='white')
34 pylab.scatter(els,model_dazs,marker='+')
35 # pylab.xlabel('El (degrees)',fontsize=axfs)
36 # pylab.ylabel('$\Delta$Az (arcminutes)',fontsize=axfs)
37 pylab.grid()
39 pylab.subplot(223)
40 pylab.scatter(azs,dels,facecolor='white')
41 pylab.scatter(azs,model_dels,marker='+')
42 pylab.xlabel('Az (degrees)',fontsize=axfs)
43 pylab.ylabel('$\Delta$El (arcminutes)',fontsize=axfs)
44 pylab.grid()
46 pylab.subplot(224)
47 l1 = pylab.scatter(els,dels,facecolor='white')
48 l2 = pylab.scatter(els,model_dels,marker='+')
49 pylab.xlabel('El (degrees)',fontsize=axfs)
50 # pylab.ylabel('$\Delta$El (arcminutes)',fontsize=axfs)
51 pylab.grid()
53 pylab.suptitle('Star Camera Pointing Model 8/28/10 %d stars %.1f hours\nModel free parameters: %s'%(nsource,total_time,allowed_params),fontsize=14)
55 pylab.figlegend((l1,l2),('Measured star position - boresight','Model'),'lower center',prop={'size':10})
58 pylab.savefig('starcam-20100828.png',figsize=((10,8)),dpi=250)
61 azelplot()
62 #pylab.show()