예제 #1
0
 def buttonClick(self,fn=None):
     """This will output the beam list, create an image of the beams and close the program. """
     if fn is None:
         fn = tkFileDialog.asksaveasfilename(title="save Beam Codes and Image",filetypes=[('TXT','.txt')])
     fnbase = ''.join(os.path.splitext(fn)[:-1])
     allbeam = BeamSelector(self.lines)
     fig = allbeam.plotbeams(self.output,True,fnbase+'.png',"Chosenbeams")
     plt.close(fig)
     f = open(fnbase+'.txt', 'w')
     for beam in self.output:
         f.write("%s\n" % (int(beam)))
     if not self.subgui:
         #sys.exit()
         self.parent.destroy()
예제 #2
0
 def buttonClick(self, fn=None):
     """This will output the beam list, create an image of the beams and close the program. """
     if fn is None:
         fn = tkFileDialog.asksaveasfilename(title="save Beam Codes and Image", filetypes=[("TXT", ".txt")])
     fnbase = "".join(os.path.splitext(fn)[:-1])
     allbeam = BeamSelector(self.lines)
     fig = allbeam.plotbeams(self.output, True, fnbase + ".png", "Chosenbeams")
     plt.close(fig)
     f = open(fnbase + ".txt", "w")
     for beam in self.output:
         f.write("%s\n" % (int(beam)))
     if not self.subgui:
         # sys.exit()
         self.parent.destroy()
예제 #3
0
#!/usr/bin/env python
"""
Created on Fri Sep 19 10:26:47 2014

@author: Bodangles
"""

import numpy as np
import matplotlib.pyplot as plt
from beamfuncs import BeamSelector

chosenbeams = np.loadtxt('SelectedBeamCodes.txt')
beamman = np.loadtxt('bcotable.txt')

allbeam = BeamSelector(beamman)
allbeamorig = allbeam
allbeam.shiftbeams(azoff=15,eloff=-16)
(azvec,elvec) = allbeam.azelvecs()
allbeamlist = allbeam.beamnumdict.keys()
azlog =np.where( azvec==0.0)[0]
chosenbeams = np.array(allbeamlist)[azlog]
#allbeam.switchzenith()
allbeam.plotbeams(chosenbeams,True,'beampic.png',"Possible Beams from Boresite")
allbeam.printbeamangles('outangles.txt',chosenbeams)
plt.show(False)