def testNumpylPowerVsTime(self): """ Test export numpy array from the total power as function of time. """ xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) xs_mf, int0_mean = xfel_photon_analyzer.numpyTotalPower()
def testPlotTotalPowerVsTime(self): """ Test plotting the total power as function of time. """ xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) xfel_photon_analyzer.plotTotalPower()
def testPlotIntensityQMap(self): """ Test plotting the intensity map.""" xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) xfel_photon_analyzer.plotIntensityMap(qspace=True)
def testPlotOnAxisPowerDensityVsEnergy(self): """ Test plotting the total power spectrum.""" xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) xfel_photon_analyzer.plotOnAxisPowerDensity(spectrum=True)
def testPlotOnAxisPowerDensityVsTime(self): """ Test plotting the on-axis power as function of time. """ xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) xfel_photon_analyzer.plotOnAxisPowerDensity()
def testNumpyTotalPowerVsEnergy(self): """ Test export numpy array from the total power spectrum.""" xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) energy, totalPower = xfel_photon_analyzer.numpyTotalPower( spectrum=True)
def testShapedConstruction(self): """ Testing the construction of the class with non-default parameters. """ # Construct the object. xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) self.assertIsInstance(xfel_photon_analyzer, XFELPhotonAnalysis) self.assertIsInstance(xfel_photon_analyzer, AbstractAnalysis) self.assertIsInstance(xfel_photon_analyzer, object) self.assertIsInstance(xfel_photon_analyzer.wavefront, wpg.Wavefront)
def testMultiplePlots(self): """ Check that we can plot multiple times without clashes.""" xfel_photon_analyzer = XFELPhotonAnalysis( input_path=TestUtilities.generateTestFilePath( 'prop_out_0000001.h5')) xfel_photon_analyzer.plotIntensityMap(qspace=False) xfel_photon_analyzer.plotIntensityMap(qspace=True)
def main(args): # Setup the object. analyzer = XFELPhotonAnalysis(input_path=args.input_file) if args._do_intensity_distribution: analyzer.plotIntensityMap(logscale=args.logscale) if args._do_qspace_intensity: analyzer.plotIntensityMap(logscale=args.logscale, qspace=True) if args._do_total_power: analyzer.plotTotalPower() if args._do_on_axis_power: analyzer.plotOnAxisPowerDensity() if args._do_spectrum: analyzer.plotTotalPower(spectrum=True) if args._do_animate: analyzer.animate(logscale=args.logscale, qspace=False) if not args._do_animate: plt.show()