Skip to content
Snippets Groups Projects
Commit 6fc82b2f authored by Jan Caron's avatar Jan Caron
Browse files

Documentation and cleanup of the pyramid package!

Renames:
datacollection --> dataset
optimizer      --> reconstruction

scripts:
interactive_setup is now implemented in an extended Spyder startup file.
some other scripts are now
the rest is NOT adapted, yet, which is the next task at hand
furthermore scripts will be sorted and unused ones deleted in the next commit
parent a088c4f5
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 17 14:28:10 2014
@author: Jan
"""
from numpy import pi
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
import pyramid.magcreator as mc
from pyramid.magdata import MagData
from pyramid.projector import SimpleProjector, YTiltProjector
from pyramid.phasemapper import PMConvolve
###################################################################################################
print('Jan')
dim = (128, 128, 128)
center = (int(dim[0]/2), int(dim[1]/2), int(dim[2]/2))
radius = dim[0]/4.
a = 1.
magnitude = mc.create_mag_dist_homog(mc.Shapes.sphere(dim, center, radius), pi/4)
mag_data = MagData(a, magnitude)
projector = SimpleProjector(dim)
phase_map = PMConvolve(a, projector)(mag_data)
axis = phase_map.display_phase()
axis.tick_params(axis='both', which='major', labelsize=18)
axis.set_title('Phase map', fontsize=24)
axis.set_xlabel('x [nm]', fontsize=18)
axis.set_ylabel('y [nm]', fontsize=18)
axis = phase_map.display_holo(density=20, interpolation='bilinear')
axis.tick_params(axis='both', which='major', labelsize=18)
axis.set_title('Magnetic induction map', fontsize=24)
axis.set_xlabel('x [nm]', fontsize=18)
axis.set_ylabel('y [nm]', fontsize=18)
mag_data.scale_down(2)
mag_data.quiver_plot()
axis = plt.gca()
axis.tick_params(axis='both', which='major', labelsize=18)
axis.set_title('Magnetization distribution', fontsize=24)
axis.set_xlabel('x [nm]', fontsize=18)
axis.set_ylabel('y [nm]', fontsize=18)
phase_map.make_color_wheel()
shape_vort = mc.Shapes.disc((64, 64, 64), (31.5, 31.5, 31.5), 24, 10)
magnitude_vort = mc.create_mag_dist_vortex(shape_vort)
mag_vort = MagData(a, magnitude_vort)
mag_vort.scale_down(2)
mag_vort.quiver_plot()
###################################################################################################
print('Patrick')
a = 10.0 # nm
b_0 = 3 # T
dim = (128, 128, 128)
center = (int(dim[0]/2), int(dim[1]/2), int(dim[2]/2)) # in px (z, y, x), index starts with 0!
mag_data = MagData(a, mc.create_mag_dist_homog(mc.Shapes.ellipse(dim, center, (20., 60.), 5.), 0))
tilts = np.array([0., 60.])/180.*pi
projectors = [YTiltProjector(mag_data.dim, tilt) for tilt in tilts]
phasemappers = [PMConvolve(mag_data.a, proj, b_0) for proj in projectors]
phase_maps = [pm(mag_data) for pm in phasemappers]
axis = phase_maps[0].display_holo(density=1, interpolation='bilinear')
axis.tick_params(axis='both', which='major', labelsize=18)
axis.set_title('Magnetic induction map', fontsize=24)
axis.xaxis.set_major_formatter(FuncFormatter(lambda x, pos: '{:g}'.format(x*a)))
axis.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '{:g}'.format(x*a)))
axis.set_xlabel('x [nm]', fontsize=18)
axis.set_ylabel('y [nm]', fontsize=18)
axis = phase_maps[0].display_phase(limit=17)
axis.tick_params(axis='both', which='major', labelsize=18)
axis.set_title('Phase map', fontsize=24)
axis.set_xlabel('x [nm]', fontsize=18)
axis.set_ylabel('y [nm]', fontsize=18)
axis = phase_maps[1].display_holo(density=1, interpolation='bilinear')
axis.tick_params(axis='both', which='major', labelsize=18)
axis.set_title('Magnetic induction map', fontsize=24)
axis.xaxis.set_major_formatter(FuncFormatter(lambda x, pos: '{:g}'.format(x*a)))
axis.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '{:g}'.format(x*a)))
axis.set_xlabel('x [nm]', fontsize=18)
axis.set_ylabel('y [nm]', fontsize=18)
axis = phase_maps[1].display_phase(limit=17)
axis.tick_params(axis='both', which='major', labelsize=18)
axis.set_title('Phase map', fontsize=24)
axis.set_xlabel('x [nm]', fontsize=18)
axis.set_ylabel('y [nm]', fontsize=18)
......@@ -9,7 +9,7 @@ Created on Tue Jan 28 15:15:08 2014
import numpy as np
from pyramid.magdata import MagData
from pyramid.projector import SimpleProjector
from pyramid.phasemapper import PMAdapterFM
from pyramid.phasemapper import PMAdapterFM, PMFourier
from matplotlib.ticker import FuncFormatter
data = np.loadtxt('../output/data from Edinburgh/long_grain_remapped_0p0035.txt', delimiter=',')
......@@ -28,17 +28,18 @@ magnitude = np.array((x_mag, y_mag, z_mag))
mag_data = MagData(a, magnitude)
mag_data.pad(30, 20, 0)
mag_data.scale_up()
mag_data.quiver_plot()
#mag_data.pad(30, 20, 0)
#
#mag_data.scale_up()
#
#mag_data.quiver_plot()
#mag_data.quiver_plot3d()
projector = SimpleProjector(mag_data.dim)
phasemapper = PMAdapterFM(mag_data.a, projector)
phasemapper = PMFourier(mag_data.a, projector, padding = 1)
phase_map = phasemapper(mag_data)
......
# -*- coding: utf-8 -*-
"""Imports pyramid package and sets working directory to output directory"""
import pyramid.analytic as an
import pyramid.holoimage as hi
import pyramid.magcreator as mc
import pyramid.phasemapper as pm
import pyramid.projector as pj
import pyramid.reconstructor as rc
from pyramid.magdata import MagData
from pyramid.phasemap import PhaseMap
import pyramid.analytic as an
import pyramid.reconstruction as rc
from pyramid.magdata import *
from pyramid.projector import *
from pyramid.kernel import *
from pyramid.phasemapper import *
from pyramid.phasemap import *
from pyramid.dataset import *
from pyramid.forwardmodel import *
from pyramid.costfunction import *
import os
os.chdir('C:\\Users\\Jan\\Home\\PhD Thesis\\Pyramid\\tests')
os.chdir('C:\\Users\\Jan\\Home\\PhD Thesis\\Pyramid\\output')
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Calling __init__
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Calling __init__
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Created <pyramid.projector.SimpleProjector object at 0x0DC7ECD0>
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Created <pyramid.projector.SimpleProjector object at 0x0DC7ECD0>
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Calling as function
2014-02-18 09:30:30: INFO @ <pyramid.projector>: mode == vector
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Calling _vector_field_projection
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __sub__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __neg__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __add__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Adding two PhaseMap objects
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling display_phase
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Calling as function
2014-02-18 09:30:30: INFO @ <pyramid.projector>: mode == vector
2014-02-18 09:30:30: INFO @ <pyramid.projector>: Calling _vector_field_projection
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __sub__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __neg__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __add__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Adding two PhaseMap objects
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __isub__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __sub__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __add__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Adding an offset
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:30: INFO @ <pyramid.phasemap>: Calling display_phase
2014-02-18 09:30:31: INFO @ <pyramid.projector>: Calling as function
2014-02-18 09:30:31: INFO @ <pyramid.projector>: mode == vector
2014-02-18 09:30:31: INFO @ <pyramid.projector>: Calling _vector_field_projection
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Calling __sub__
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Calling __neg__
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Calling __add__
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Adding two PhaseMap objects
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:31: INFO @ <pyramid.phasemap>: Calling display_phase
2014-02-18 09:30:31: INFO @ <pyramid.projector>: Calling as function
2014-02-18 09:30:31: INFO @ <pyramid.projector>: mode == vector
2014-02-18 09:30:31: INFO @ <pyramid.projector>: Calling _vector_field_projection
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __sub__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __neg__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __add__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Adding two PhaseMap objects
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __isub__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __sub__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __add__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Adding an offset
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:32: INFO @ <pyramid.phasemap>: Calling display_phase
2014-02-18 09:30:33: INFO @ <pyramid.projector>: Calling __init__
2014-02-18 09:30:33: INFO @ <pyramid.projector>: Calling __init__
2014-02-18 09:30:33: INFO @ <pyramid.projector>: Created <pyramid.projector.SimpleProjector object at 0x0DC7EB70>
2014-02-18 09:30:33: INFO @ <pyramid.projector>: Created <pyramid.projector.SimpleProjector object at 0x0DC7EB70>
2014-02-18 09:30:33: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:33: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
2014-02-18 09:30:33: INFO @ <pyramid.phasemap>: Calling __str__
2014-02-18 09:30:33: INFO @ <pyramid.phasemap>: Created PhaseMap(a=1.0, dim_uv=(128, 128))
......@@ -10,15 +10,17 @@ import numpy as np
from numpy import pi
from pyramid.magdata import MagData
from pyramid.projector import YTiltProjector
from pyramid.projector import YTiltProjector, XTiltProjector
from pyramid.phasemapper import PMConvolve
from pyramid.datacollection import DataCollection
from pyramid.dataset import DataSet
import pyramid.magcreator as mc
from pyramid.kernel import Kernel
from pyramid.forwardmodel import ForwardModel
from pyramid.costfunction import Costfunction
import pyramid.reconstruction as rc
from scipy.sparse.linalg import cg
from scipy.sparse.linalg import cg, LinearOperator
###################################################################################################
......@@ -41,7 +43,7 @@ phase_maps = [pm(mag_data) for pm in phasemappers]
dim_uv = dim[1:3]
data_collection = DataCollection(a, dim_uv, b_0)
data_collection = DataSet(a, dim_uv, b_0)
[data_collection.append((phase_maps[i], projectors[i])) for i in range(count)]
......@@ -100,7 +102,7 @@ phase_maps = [pm(mag_data) for pm in phasemappers]
dim_uv = dim[1:3]
data_collection = DataCollection(a, dim_uv, b_0)
data_collection = DataSet(a, dim_uv, b_0)
[data_collection.append((phase_maps[i], projectors[i])) for i in range(count)]
......@@ -166,35 +168,40 @@ print('--STARTING RECONSTRUCTION')
###################################################################################################
print('--Generating input phase_maps')
a = 1.
a = 10.
b_0 = 1000.
dim = (9, 9, 9)
count = 8
dim = (8, 8, 8)
count = 32
magnitude = np.zeros((3,)+dim)
magnitude[0, int(dim[0]/2), int(dim[1]/2), int(dim[2]/2)] = 1.
magnitude[:, 3:6, 3:6, 3:6] = 1# int(dim[0]/2), int(dim[1]/2), int(dim[2]/2)] = 1.
magnitude = mc.create_mag_dist_vortex(mc.Shapes.disc(dim, (3.5, 3.5, 3.5), 3, 4))
mag_data = MagData(a, magnitude)
mag_data.quiver_plot3d()
tilts = np.linspace(0, 2*pi, num=count, endpoint=False)
projectors = [YTiltProjector(mag_data.dim, tilt) for tilt in tilts]
tilts = np.linspace(0, 2*pi, num=count/2, endpoint=False)
projectors = []
projectors.extend([XTiltProjector(mag_data.dim, tilt) for tilt in tilts])
projectors.extend([YTiltProjector(mag_data.dim, tilt) for tilt in tilts])
phasemappers = [PMConvolve(mag_data.a, projector, b_0) for projector in projectors]
phase_maps = [pm(mag_data) for pm in phasemappers]
[phase_map.display_phase(title=u'Tilt series $(\phi = {:2.1f} \pi)$'.format(tilts[i]/pi))
for i, phase_map in enumerate(phase_maps)]
#[phase_map.display_phase(title=u'Tilt series $(\phi = {:2.1f} \pi)$'.format(tilts[i%(count/2)]/pi))
# for i, phase_map in enumerate(phase_maps)]
###################################################################################################
print('--Setting up data collection')
dim_uv = dim[1:3]
lam = 10. ** -10
size_2d = np.prod(dim_uv)
size_3d = np.prod(dim)
data_collection = DataCollection(a, dim_uv, b_0)
data_collection = DataSet(a, dim_uv, b_0)
[data_collection.append((phase_maps[i], projectors[i])) for i in range(count)]
......@@ -202,37 +209,62 @@ data = data_collection
y = data.phase_vec
kern = Kernel(data.a, data.dim_uv, data.b_0)
F = ForwardModel(data.projectors, kern)
C = Costfunction(y, F)
C = Costfunction(y, F, lam)
###################################################################################################
print('--Test simple solver')
M = np.asmatrix([F.jac_dot(None, np.eye(3*size_3d)[:, i]) for i in range(3*size_3d)]).T
lam = 1*10. ** -10
MTM = M.T * M + lam * np.asmatrix(np.eye(3*size_3d))
A = MTM#np.array([F(np.eye(81)[:, i]) for i in range(81)])
b = F.jac_T_dot(None, y)
b_test = np.asarray((M.T.dot(y)).T)[0]
#M = np.asmatrix([F.jac_dot(None, np.eye(3*size_3d)[:, i]) for i in range(3*size_3d)]).T
#MTM = M.T * M + lam * np.asmatrix(np.eye(3*size_3d))
#A = MTM#np.array([F(np.eye(81)[:, i]) for i in range(81)])
x_f = cg(A, b)[0]
mag_data_rec = MagData(a, np.zeros((3,)+dim))
mag_data_rec.mag_vec = x_f
mag_data_rec.quiver_plot3d()
#class A_adapt(LinearOperator):
#
# def __init__(self, FwdModel, lam, shape):
# self.fwd = FwdModel
# self.lam = lam
# self.shape = shape
#
# def matvec(self, vector):
# return self.fwd.jac_T_dot(None, self.fwd.jac_dot(None, vector)) + self.lam*vector
#
# @property
# def shape(self):
# return self.shape
#
# @property
# def dtype(self):
# return np.dtype("d") # None #np.ones(1).dtype
#
## TODO: .shape in F und C
#
#b = F.jac_T_dot(None, y)
#
#A_fast = A_adapt(F, lam, (3*size_3d, 3*size_3d))
#
#i = 0
#def printit(_):
# global i
# i += 1
# print i
#
#x_f, info = cg(A_fast, b, callback=printit)
#
#mag_data_rec = MagData(a, np.zeros((3,)+dim))
#
#mag_data_rec.mag_vec = x_f
#
#mag_data_rec.quiver_plot3d()
phase_maps_rec = [pm(mag_data_rec) for pm in phasemappers]
[phase_map.display_phase(title=u'Tilt series (rec.) $(\phi = {:2.1f} \pi)$'.format(tilts[i]/pi))
for i, phase_map in enumerate(phase_maps_rec)]
#phase_maps_rec = [pm(mag_data_rec) for pm in phasemappers]
#[phase_map.display_phase(title=u'Tilt series (rec.) $(\phi = {:2.1f} \pi)$'.format(tilts[i%(count/2)]/pi))
# for i, phase_map in enumerate(phase_maps_rec)]
mag_data_opt = rc.optimize_sparse_cg(data_collection)
mag_data_opt.quiver_plot3d()
#
#first_guess = MagData(a, np.zeros((3,)+dim))
#
#first_guess.magnitude[1, int(dim[0]/2), int(dim[1]/2), int(dim[2]/2)] = 1
......@@ -253,6 +285,77 @@ phase_maps_rec = [pm(mag_data_rec) for pm in phasemappers]
#phase_opt.display_phase()
###################################################################################################
print('--Singular value decomposition')
#a = 1.
#b_0 = 1000.
#dim = (3, 3, 3)
#count = 8
#
#magnitude = np.zeros((3,)+dim)
#magnitude[:, int(dim[0]/2), int(dim[1]/2), int(dim[2]/2)] = 1.
#
#mag_data = MagData(a, magnitude)
#mag_data.quiver_plot3d()
#
#tilts = np.linspace(0, 2*pi, num=count/2, endpoint=False)
#projectors = []
#projectors.extend([XTiltProjector(mag_data.dim, tilt) for tilt in tilts])
#projectors.extend([YTiltProjector(mag_data.dim, tilt) for tilt in tilts])
#phasemappers = [PMConvolve(mag_data.a, projector, b_0) for projector in projectors]
#phase_maps = [pm(mag_data) for pm in phasemappers]
#
##[phase_map.display_phase(title=u'Tilt series $(\phi = {:2.1f} \pi)$'.format(tilts[i%(count/2)]/pi))
## for i, phase_map in enumerate(phase_maps)]
#
#dim_uv = dim[1:3]
#
#lam = 10. ** -10
#
#size_2d = np.prod(dim_uv)
#size_3d = np.prod(dim)
#
#
#data_collection = DataCollection(a, dim_uv, b_0)
#
#[data_collection.append((phase_maps[i], projectors[i])) for i in range(count)]
#
#data = data_collection
#y = data.phase_vec
#kern = Kernel(data.a, data.dim_uv, data.b_0)
#F = ForwardModel(data.projectors, kern)
#C = Costfunction(y, F, lam)
#
#mag_data_opt = opt.optimize_sparse_cg(data_collection)
#mag_data_opt.quiver_plot3d()
#M = np.asmatrix([F.jac_dot(None, np.eye(3*size_3d)[:, i]) for i in range(3*size_3d)]).T
#MTM = M.T * M + lam * np.asmatrix(np.eye(3*size_3d))
#A = MTM#np.array([F(np.eye(81)[:, i]) for i in range(81)])
#
#
#
#U, s, V = np.linalg.svd(M)
##np.testing.assert_almost_equal(U.T, V, decimal=5)
#
#for value in range(20):
# print 'Singular value:', s[value]
# MagData(data.a, np.array(V[value,:]).reshape((3,)+dim)).quiver_plot3d()
#
#
#for value in range(-10,0):
# print 'Singular value:', s[value]
# MagData(data.a, np.array(V[value,:]).reshape((3,)+dim)).quiver_plot3d()
# TODO: print all singular vectors for a 2x2x2 distribution for each single and both tilt series!
# TODO: Separate the script for SVD and compliance tests
####################################################################################################
#print('--Further testing')
#
......@@ -281,7 +384,7 @@ phase_maps_rec = [pm(mag_data_rec) for pm in phasemappers]
#K = np.asmatrix(K)
#lam = 10. ** -10
#KTK = K.T * K + lam * np.asmatrix(np.eye(81))
#print lam,
#print lam,
##print pylab.cond(KTK),
#x_f = KTK.I * K.T * y
#print (np.asarray(K * x_f - y) ** 2).sum(),
......
File moved
......@@ -5,10 +5,10 @@
import os
import unittest
import pyramid.reconstructor as rc
import pyramid.reconstruction as rc
class TestCaseReconstructor(unittest.TestCase):
class TestCaseReconstruction(unittest.TestCase):
def setUp(self):
self.path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_phasemapper')
......@@ -21,5 +21,5 @@ class TestCaseReconstructor(unittest.TestCase):
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseReconstructor)
suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseReconstruction)
unittest.TextTestRunner(verbosity=2).run(suite)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment