def pushButton_3_clicked(self): ''' Slot for pushButton_3. Detector pixel plot. ''' window = QWidget() plot(self.detector) plt.show()
import foxsisim.reflectivity as ref import matplotlib.pyplot as plt from foxsisim.plotting import plot if __name__ == '__main__': r = ref.Reflectivity() plot(r) plt.show()
seglen = 30 base = [0, 0, 0] focal_length = 200 module = Module(radii=radii, seglen=seglen, base=base, angles=None, focal=focal_length, conic=True) detector = Detector(center=[0, 0, 230]) # focal point is at 230 by default # generate nrays from the source rays = source.generateRays(module.targetFront, nrays) plt.figure() plt.hist([ray.energy for ray in rays], normed=True, label='generated rays') plt.legend() plt.show() # pass rays through module module.passRays(rays, robust=True) # catch rays at detector detector.catchRays(rays) rays_on_detector = len(detector.rays) plot(detector, energy_range=[0, 15]) plt.show() print('Number of rays on Detector ' + str(rays_on_detector)) print('Time total: ' + str((datetime.now() - tstart).seconds) + ' seconds') print('Time per ray (s): ' + str(rays_on_detector / float((datetime.now() - tstart).seconds)))
module = Module(radii=[5.151, 3.799], seglen=30.0, base=[0, 0, 0], focal=200, angles=None, conic=False) detector = Detector(width=0.96, height=0.96, normal=[0, 0, 1], center=[0, 0, 200.0 + 30.0], reso=[128, 128]) source_distance = -2187.5 offaxis_angle_arcmin = 1.0 source = Source( type='point', center=[ source_distance * np.sin(np.deg2rad(offaxis_angle_arcmin / 60.0)), 0.0, source_distance ], color=[0, 1, 1]) rays = source.generateRays(module.targetFront, 2000) module.passRays(rays, robust=True) detector.catchRays(rays) plot(detector) scatterHist(rays) plt.show()
from foxsisim.plotting import plot import matplotlib.pyplot as plt if __name__ == '__main__': # create module/detector/source objects using defaults module = Module() detector = Detector() source = Source() # generate 1000 rays at source rays = source.generateRays(module.targetFront, 1000) # pass rays through module module.passRays(rays, robust=True) # catch rays at detector detector.catchRays(rays) # plot detector pixels plot(detector) # create scatter plot detectorRays = detector.rays fig2 = plt.figure(figsize=(5,5)) scatterHist(detectorRays,fig2) # show plt.show()
#!/usr/bin/env python import foxsisim.reflectivity as ref import matplotlib.pyplot as plt from foxsisim.plotting import plot if __name__ == '__main__': r = ref.Reflectivity(material='Ni') plot(r) plt.show()