def testPlotAvgSequenceInt(self): """ Check we can plot the avg over a subset of patterns given as list of ints.""" analyzer = DiffractionAnalysis(input_path=self.__test_data, pattern_indices=[1, 3, 6]) analyzer.plotPattern(operation=numpy.mean) if RENDER_PLOT: plt.show()
def testPlotAvgPatternLegacy(self): """ Check we can plot the average diffraction pattern as a color map. """ analyzer = DiffractionAnalysis( input_path=TestUtilities.generateTestFilePath('diffr_0.1')) analyzer.plotPattern(operation=numpy.mean) if RENDER_PLOT: plt.show()
def testPlotSumPatternLogscale(self): """ Check we can plot one diffraction pattern as a color map. """ analyzer = DiffractionAnalysis(input_path=self.__test_data, poissonize=False) analyzer.plotPattern(operation=numpy.sum, logscale=True) if RENDER_PLOT: plt.show()
def testPlotOnePattern(self): """ Check we can plot one diffraction pattern as a color map. """ analyzer = DiffractionAnalysis(input_path=self.__test_data, pattern_indices=4) analyzer.plotPattern() if RENDER_PLOT: plt.show()
def testPlotOnePatternLegacy(self): """ Check we can plot one diffraction pattern from a v0.1 dir as a color map. """ analyzer = DiffractionAnalysis( input_path=TestUtilities.generateTestFilePath('diffr_0.1'), pattern_indices=4) analyzer.plotPattern(operation=None) if RENDER_PLOT: plt.show()
def tearDown(self): """ Tearing down a test. """ for f in self.__files_to_remove: if os.path.isfile(f): os.remove(f) for d in self.__dirs_to_remove: if os.path.isdir(d): shutil.rmtree(d) if RENDER_PLOT: plt.show()
def testPlotImage(self): """ Check we can plot an ndarray.""" image = numpy.random.random((100, 100)) plotImage(image) plt.show()
def testPlotRMSPattern(self): """ Check we can plot the rms diffraction pattern as a color map. """ analyzer = DiffractionAnalysis(input_path=self.__test_data) analyzer.plotPattern(operation=numpy.std) plt.show()
def testPlotPatternDefault(self): """ Check we the sum image of all patterns is plotted by default. """ analyzer = DiffractionAnalysis(input_path=self.__test_data) analyzer.plotPattern() plt.show()
def testPlotOnePatternPoissonized(self): """ Check we can plot one diffraction pattern as a color map. """ analyzer = DiffractionAnalysis(input_path=self.__test_data, pattern_indices=1) analyzer.plotPattern() plt.show()
def testPlotAvgPattern(self): """ Check we can plot the average diffraction pattern as a color map. """ analyzer = DiffractionAnalysis(input_path=self.__test_data) analyzer.plotPattern(operation=numpy.mean) if RENDER_PLOT: plt.show()