Commit b0a8e60f authored by Russell Luke's avatar Russell Luke
Browse files

actually hadn't merged all of Jazib's edits...

parent c2ecff2b
......@@ -88,12 +88,20 @@ class Elser_Experiment(PhaseExperiment):
fn="".join([str(datadir/"Elser"/"data"), str(self.Atoms), self.category])
# read text data file as a matrix of numbers
data = np.loadtxt(fn, delimiter="\t")
data = np.sqrt(data)/self.Nx
data = np.c_[data, np.zeros(self.Nx)] # add extra column
print(data)
data = data.flatten() # make it a one-dimensional array
M = fftshift(data)
# have to look at what Elser is actually doing with his data...
data = np.sqrt(data) / self.Nx
data = np.c_[data, np.zeros(self.Nx)] # add extra column
tmp = np.zeros((self.Nx, self.Nx))
tmp[:, np.arange(int(self.Nx / 2) + 1)] = data
tmp[1:int(self.Nx / 2), int(self.Nx / 2) + 1: self.Nx] = data[self.Nx - 1:int(self.Nx / 2):-1,
int(self.Nx / 2):1:-1]
tmp[int(self.Nx / 2) + 1: self.Nx, int(self.Nx / 2) + 1: self.Nx] = data[int(self.Nx / 2):1:-1,
int(self.Nx / 2):1:-1]
tmp[1, np.arange(int(self.Nx / 2) - 1, self.Nx - 1)] = data[np.arange(int(self.Nx / 2) - 1,
self.Nx - 1), 1]
# data = data.flatten() # make it a one-dimensional array
M = fftshift(tmp)
self.magn = 1 # magnification factor
self.farfield = True
print('Using farfield formula.')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment