This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Created 2015, Zack Gainsforth | |
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import struct | |
| from numpy.fft import fft, fftfreq | |
| def LoadSPAInterferogram(FileName): | |
| # Open the SPA file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys from PyQt4 import QtGui from mainwindow import Ui_MainWindow class Main(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self) if __name__ == '__main__': app = QtGui.QApplication(sys.argv) window = Main() window.show() sys.exit(app.exec_()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Created 2015, Zack Gainsforth | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from skimage import filters | |
| from skimage.transform import resize | |
| import os, sys | |
| import warnings | |
| with warnings.catch_warnings(): | |
| warnings.simplefilter("ignore") | |
| import tifffile as tif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Call this just before plt.show() | |
| def raise_window(figname=None): | |
| if figname: plt.figure(figname) | |
| cfm = plt.get_current_fig_manager() | |
| cfm.window.activateWindow() | |
| cfm.window.raise_() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot | |
| import ternary | |
| import numpy as np | |
| ## Boundary and Gridlines | |
| scale = 100 | |
| figure, tax = ternary.figure(scale=scale) | |
| # Draw Boundary and Gridlines | |
| tax.boundary(linewidth=2.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %pylab | |
| import tifffile | |
| import glob | |
| f = glob.glob(‘*.tsv’) | |
| for x in f: | |
| n = genfromtxt(x).astype('float32') | |
| tifffile.imsave(x+'.tif', n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Created 2016, Zack Gainsforth | |
| from __future__ import division | |
| import matplotlib | |
| #matplotlib.use('Qt4Agg') | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| def CBEDThicknessMeasure(lam, d0, r0, dr): | |
| # CBEDThicknessMeasure(lam, d0, r0, dr] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setBackgroundColor(0, 0, 0); | |
| run("Clear Outside"); | |
| run("Inverse FFT"); | |
| run("Bin...", "x=16 y=16 bin=Max"); | |
| run("Enhance Contrast", "saturated=0.35"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import division | |
| __author__ = 'Zack Gainsforth' | |
| __copyright__ = 'Copyright 2016, Zack Gainsforth' | |
| __email__ = '[email protected]' | |
| #numpy.set_printoptions(threshold=numpy.nan) # Makes arrays print fully when they are large. | |
| from collections import OrderedDict | |
| # Planck's constant [eV-s] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| from numpy import * | |
| import pickle | |
| def ShowLastPosSingleFig(plt): | |
| # Call plt.show but pickles the plot position on window close. When called a second time | |
| # it loads the figure to the last position. So matplotlib now remembers figure positions! | |
| # This version works for QT and WX backends. |