from BinningFunction import binning import numpy as np #spm3path='C:\\Users\\mhupton\\Documents\\2021-3\\Kourtis\\Slot7_Kourtis' #tifpath='C:\\Users\\mhupton\\Documents\\2021-3\\Kourtis\\slot7' #fileroot='tal3_nov2021s3_1' #omitfile='C:\\Users\\mhupton\\Documents\\2021-3\\Kourtis\\omit.txt' #scannum=338 #username = input("Enter username:") #print("Username is: " + username) spm3path = input("Enter path for spm3 file (eg C:\\Users\\mhupton\\data): ") if spm3path[-1] != '\\': spm3path=spm3path+'\\' tifpath = input("Enter path for tif files (eg C:\\Users\\mhupton\\data\\slot3): ") if tifpath[-1] != '\\': tifpath=tifpath+'\\' fileroot=input("Enter filename without any extensions (eg 5Nov2021): ") scannum=input("Enter the number of the scan you would like to rebin (eg 338): ") magicchannel=input("Enter the focal channel on the lambda detector (eg 126): ") ylow=input("Enter the lowest y (analyzer chi) to include in binning (eg 50): ") yhigh=input("Enter the highest y (analyzer chi) to include in binning (eg 210): ") omitfile=input("path and file containing points to omit from binning. If none leave blank (eg C:\\Users\\mhupton\\data\\omit.txt): ") outputfile=input("path and filename for output file (eg C:\\Users\\mhupton\\data\\scan338rebin.txt): ") print("spm3 path is: " + spm3path) print("tifpath is: " + tifpath) print("fileroot is: " + fileroot) print("scan number is "+scannum) print("focal channel is "+magicchannel) print("horizontal summation includes channels "+ylow+ " to "+ yhigh) if len(omitfile)==0: print("There are not points omitted from the binning\n") else: print("File containing points to omit is "+omitfile) print("Output file name is "+outputfile) scannum=int(scannum) magicchannel=int(magicchannel) ylow=int(ylow) yhigh=int(yhigh) if len(omitfile)==0: spectra=binning(magicchannel,ylow ,yhigh,spm3path,tifpath,fileroot,scannum) else: spectra=binning(magicchannel,ylow ,yhigh,spm3path,tifpath,fileroot,scannum,omitfile) np.savetxt(outputfile,spectra,delimiter=' ') print("Finished\n")