Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • fix-squeeze
  • master
  • pyramid-master
  • 0.0.0
  • 0.0.1
  • 0.1.0
  • 0.2.0
  • 0.2.1
  • 0.3.0
  • 0.3.1
  • 0.3.2
  • 0.3.2-dev
  • 0.3.3
  • 0.3.4
  • 0.3.5
  • testtag
16 results

Target

Select target project
  • empyre/empyre
  • weber/empyre
  • wessels/empyre
  • bryan/empyre
4 results
Select Git revision
  • add_field_tests
  • colorclipping
  • master
  • pyramid-master
  • support-ragged
  • support36
  • 0.0.0
  • 0.0.1
  • 0.1.0
  • 0.2.0
  • 0.2.1
11 results
Show changes
Showing
with 0 additions and 834 deletions
File deleted
File deleted
File deleted
File deleted
File deleted
# -*- coding: utf-8 -*-
"""Testcase for the magdata module."""
import unittest
import numpy as np
from numpy import pi
from pyramid.magdata import MagData
# py.test
# TODO: define test constants somewhere
# TODO: proper error messages
# TODO: Docstring
class TestCaseMagData(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_init(self):
magnitude = (np.zeros((1, 1, 1), np.zeros(1, 1, 1), np.zeros(1, 1, 1)))
magnitude = (np.zeros((1, 1, 1), np.zeros(1, 1, 1), np.zeros(1, 1, 1)))
self.assertRaises(AssertionError, MagData, 10.0, )
self.assertEqual(self.mag_data.filename, self.filename)
def test_resolution(self):
self.assertEqual(self.mag_data.res, 10.0)
def test_dimensions(self):
self.assertEqual(self.mag_data.dim, (1, 3, 5))
def test_length(self):
self.assertEqual(self.mag_data.length, (10.0, 30.0, 50.0))
def test_magnitude(self):
test_shape = (1, 3, 5)
test_array = np.zeros(test_shape)
z_mag = self.mag_data.magnitude[0]
y_mag = self.mag_data.magnitude[1]
x_mag = self.mag_data.magnitude[2]
self.assertEqual(z_mag.shape, test_shape)
self.assertEqual(y_mag.shape, test_shape)
self.assertEqual(x_mag.shape, test_shape)
np.testing.assert_array_equal(z_mag, test_array, 'Testmessage')
test_array[:, 1, 1:4] = np.cos(pi/4)
np.testing.assert_array_almost_equal(y_mag, test_array, err_msg='y failure')
np.testing.assert_array_almost_equal(x_mag, test_array, err_msg='x failure')
def test_load_from_llg(self):
pass
def test_save_to_llg(self):
pass
def test_load_from_netcdf(self):
pass
def test_save_to_netcdf(self):
pass
def test_quiver_plot(self):
pass
def test_quiver_plot3d(self):
pass
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseMagData)
unittest.TextTestRunner(verbosity=2).run(suite)
LLGFileCreator2D: test_data
5 3 1
5.000000e-07 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 1.500000e-06 5.000000e-07 7.071068e-01 7.071068e-01 0.000000e+00
2.500000e-06 1.500000e-06 5.000000e-07 7.071068e-01 7.071068e-01 0.000000e+00
3.500000e-06 1.500000e-06 5.000000e-07 7.071068e-01 7.071068e-01 0.000000e+00
4.500000e-06 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
\ No newline at end of file
# -*- coding: utf-8 -*-
"""Testcase for the phasemap module."""
import unittest
from pyramid.phasemap import PhaseMap
class TestCasePhaseMap(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_template(self):
pass
def test_load_from_txt(self):
pass
def test_save_to_txt(self):
pass
def test_load_from_netcdf(self):
pass
def test_save_to_netcdf(self):
pass
def test_display(self):
pass
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestCasePhaseMap)
unittest.TextTestRunner(verbosity=2).run(suite)
# -*- coding: utf-8 -*-
"""Testcase for the phasemapper module."""
import unittest
import pyramid.phasemapper as pm
class TestCasePhaseMapper(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_phase_mag_fourier(self):
pass
def test_phase_mag_real_slab(self):
pass
def test_phase_mag_real_disc(self):
pass
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestCasePhaseMapper)
unittest.TextTestRunner(verbosity=2).run(suite)
# -*- coding: utf-8 -*-
"""Testcase for the projector module."""
import unittest
import numpy as np
from numpy import pi
import pyramid.projector as pj
import pyramid.magcreator as mc
from pyramid.magdata import MagData
class TestCaseProjector(unittest.TestCase):
def setUp(self):
self.mag_data = MagData.load_from_llg('test_projector/ref_mag_data.txt')
def tearDown(self):
self.mag_data = None
def test_simple_axis_projection(self):
z_proj_ref = (np.loadtxt('test_projector/ref_proj_z.txt'))
y_proj_ref = (np.loadtxt('test_projector/ref_proj_y.txt'))
x_proj_ref = (np.loadtxt('test_projector/ref_proj_x.txt'))
z_proj = pj.simple_axis_projection(self.mag_data, 'z')
y_proj = pj.simple_axis_projection(self.mag_data, 'y')
x_proj = pj.simple_axis_projection(self.mag_data, 'x')
np.testing.assert_equal(z_proj[0], z_proj_ref, 'Testmessage') # TODO: Real messages!
np.testing.assert_equal(z_proj[1], z_proj_ref, 'Testmessage')
np.testing.assert_equal(y_proj[0], y_proj_ref, 'Testmessage')
np.testing.assert_equal(y_proj[1], y_proj_ref, 'Testmessage')
np.testing.assert_equal(x_proj[0], x_proj_ref, 'Testmessage')
np.testing.assert_equal(x_proj[1], x_proj_ref, 'Testmessage')
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseProjector)
unittest.TextTestRunner(verbosity=2).run(suite)
LLGFileCreator: test_projector/ref_mag_data
7 6 5
5.000000e-07 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.000000e-07 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 1.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 2.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 3.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 3.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 3.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 3.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 3.500000e-06 5.000000e-07 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 3.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 3.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 4.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 4.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 4.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 4.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 4.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 4.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 4.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.500000e-06 5.000000e-07 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.000000e-07 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.000000e-07 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.000000e-07 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.000000e-07 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.000000e-07 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.000000e-07 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.000000e-07 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 1.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 1.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 1.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 1.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 1.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 1.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 1.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 2.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 2.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 2.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 2.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 2.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 2.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 2.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 3.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 3.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 3.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 3.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 3.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 3.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 3.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 4.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 4.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 4.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 4.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 4.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 4.500000e-06 1.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 4.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.500000e-06 1.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.000000e-07 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.000000e-07 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.000000e-07 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.000000e-07 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.000000e-07 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.000000e-07 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.000000e-07 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 1.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 1.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 1.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 1.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 1.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 1.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 1.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 2.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 2.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 2.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 2.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 2.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 2.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 2.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 3.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 3.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 3.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
3.500000e-06 3.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 3.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 3.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 3.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.000000e-07 4.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 4.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 4.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 4.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 4.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 4.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 4.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.500000e-06 2.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 5.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.500000e-06 2.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.000000e-07 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.000000e-07 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.000000e-07 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.000000e-07 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.000000e-07 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.000000e-07 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.000000e-07 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 1.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 1.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 1.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 1.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 1.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 1.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 1.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 2.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 2.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 2.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 2.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 2.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 2.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 2.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 3.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 3.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 3.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 3.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 3.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 3.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 3.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 4.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 4.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 4.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 4.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
4.500000e-06 4.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 4.500000e-06 3.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
6.500000e-06 4.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.500000e-06 3.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.000000e-07 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.000000e-07 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.000000e-07 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.000000e-07 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.000000e-07 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.000000e-07 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.000000e-07 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 1.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 1.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 1.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 1.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 1.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 1.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 1.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 2.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 2.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 2.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 2.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 2.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 2.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 2.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 3.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 3.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 3.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 3.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 3.500000e-06 4.500000e-06 1.000000e+00 1.000000e+00 1.000000e+00
5.500000e-06 3.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 3.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 4.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 4.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 4.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 4.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 4.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 4.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 4.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.000000e-07 5.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
1.500000e-06 5.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
2.500000e-06 5.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
3.500000e-06 5.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
4.500000e-06 5.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
5.500000e-06 5.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
6.500000e-06 5.500000e-06 4.500000e-06 0.000000e+00 0.000000e+00 0.000000e+00
\ No newline at end of file
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 1.000000000000000000e+00 3.000000000000000000e+00 5.000000000000000000e+00 3.000000000000000000e+00 1.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 3.000000000000000000e+00 5.000000000000000000e+00 3.000000000000000000e+00 1.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 3.000000000000000000e+00 5.000000000000000000e+00 3.000000000000000000e+00 1.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 3.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00
# -*- coding: utf-8 -*-
"""Testcase for the reconstructor module."""
import unittest
import pyramid.reconstructor as rc
class TestCaseReconstructor(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_template(self):
pass
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestCaseReconstructor)
unittest.TextTestRunner(verbosity=2).run(suite)
# -*- coding: utf-8 -*-
"""Compare the different methods to create phase maps."""
import time
import pdb, traceback, sys
import numpy as np
from numpy import pi
import matplotlib.pyplot as plt
import pyramid.magcreator as mc
import pyramid.projector as pj
import pyramid.phasemapper as pm
import pyramid.holoimage as hi
import pyramid.analytic as an
from pyramid.magdata import MagData
from pyramid.phasemap import PhaseMap
import shelve
def phase_from_mag():
'''Calculate and display the phase map from a given magnetization.
Arguments:
None
Returns:
None
'''
# Create / Open databank:
data_shelve = shelve.open('../output/method_errors_shelve')
'''FOURIER PADDING->RMS|DURATION'''
# Parameters:
b_0 = 1 # in T
res = 10.0 # in nm
dim = (1, 128, 128)
beta = -pi/4
padding_list = [0, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4,5, 6,7, 8,9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
geometry = 'disc'
# Create magnetic shape:
if geometry == 'slab':
center = (0, dim[1]/2-0.5, dim[2]/2-0.5) # in px (z, y, x) index starts with 0!
width = (1, dim[1]/2, dim[2]/2) # in px (z, y, x)
mag_shape = mc.Shapes.slab(dim, center, width)
phase_ana = an.phase_mag_slab(dim, res, beta, center, width, b_0)
elif geometry == 'disc':
center = (0, dim[1]/2-0.5, dim[2]/2-0.5) # in px (z, y, x) index starts with 0!
radius = dim[1]/4 # in px
height = 1 # in px
mag_shape = mc.Shapes.disc(dim, center, radius, height)
phase_ana = an.phase_mag_disc(dim, res, beta, center, radius, b_0)
# Project the magnetization data:
mag_data = MagData(res, mc.create_mag_dist(mag_shape, beta))
projection = pj.simple_axis_projection(mag_data)
# Create data:
data = np.zeros((3, len(padding_list)))
data[0, :] = padding_list
for (i, padding) in enumerate(padding_list):
print 'padding =', padding_list[i]
# Key:
key = ', '.join(['Padding->RMS|duration', 'Fourier', 'padding={}'.format(padding_list[i]),
'B0={}'.format(b_0), 'res={}'.format(res), 'dim={}'.format(dim),
'beta={}'.format(beta), 'geometry={}'.format(geometry)])
if data_shelve.has_key(key):
data[:, i] = data_shelve[key]
else:
start_time = time.time()
phase_num = pm.phase_mag_fourier(res, projection, b_0, padding_list[i])
data[2, i] = time.time() - start_time
phase_diff = phase_ana - phase_num
PhaseMap(res, phase_diff).display()
data[1, i] = np.std(phase_diff)
data_shelve[key] = data[:, i]
# Plot duration against padding:
fig = plt.figure()
axis = fig.add_subplot(1, 1, 1)
axis.set_yscale('log')
axis.plot(data[0], data[1])
axis.set_title('Fourier Space Approach: Variation of the Padding')
axis.set_xlabel('padding')
axis.set_ylabel('RMS')
# Plot RMS against padding:
fig = plt.figure()
axis = fig.add_subplot(1, 1, 1)
axis.plot(data[0], data[2])
axis.set_title('Fourier Space Approach: Variation of the Padding')
axis.set_xlabel('padding')
axis.set_ylabel('duration [s]')
# fig = plt.figure()
# axis = fig.add_subplot(1, 1, 1, aspect='equal')
# im = plt.pcolormesh(self.phase, cmap=cmap)
# # Set the axes ticks and labels:
# ticks = axis.get_xticks()*self.res
# axis.set_xticklabels(ticks)
# ticks = axis.get_yticks()*self.res
# axis.set_yticklabels(ticks)
# axis.set_title(title)
# axis.set_xlabel('x-axis [nm]')
# axis.set_ylabel('y-axis [nm]')
# # Plot the phase map:
# fig = plt.gcf()
# fig.subplots_adjust(right=0.85)
# cbar_ax = fig.add_axes([0.9, 0.15, 0.02, 0.7])
# fig.colorbar(im, cax=cbar_ax)
# plt.show()
# '''REAL SLAB '''
# beta = np.linspace(0, 2*pi, endpoint=False, num=72)
#
# RMS = np.zeros(len(beta))
# for i in range(len(beta)):
# print 'beta =', round(360*beta[i]/(2*pi))
# mag_data = MagData(res, mc.create_mag_dist(mag_shape, beta[i]))
# projection = pj.simple_axis_projection(mag_data)
# phase_num = pm.phase_mag_real(res, projection, 'slab', b_0)
# phase_ana = an.phase_mag_slab(dim, res, beta[i], center, width, b_0)
# phase_diff = phase_ana - phase_num
# RMS[i] = np.std(phase_diff)
#
# fig = plt.figure()
# fig.add_subplot(111)
# plt.plot(np.round(360*beta/(2*pi)), RMS)
# phase_map_slab = PhaseMap(res, pm.phase_mag_real(res, projection, 'slab', b_0))
# phase_map_disc = PhaseMap(res, pm.phase_mag_real(res, projection, 'disc', b_0))
# # Display the combinated plots with phasemap and holography image:
# hi.display_combined(phase_map_ana, density, 'Analytic Solution')
# hi.display_combined(phase_map_fft, density, 'Fourier Space')
# hi.display_combined(phase_map_slab, density, 'Real Space (Slab)')
# hi.display_combined(phase_map_disc, density, 'Real Space (Disc)')
#
# # Plot differences to the analytic solution:
#
# phase_map_diff_slab = PhaseMap(res, phase_map_ana.phase-phase_map_slab.phase)
# phase_map_diff_disc = PhaseMap(res, phase_map_ana.phase-phase_map_disc.phase)
#
# RMS_slab = phase_map_diff_slab.phase
# RMS_disc = phase_map_diff_disc.phase
data_shelve.close()
if __name__ == "__main__":
try:
phase_from_mag()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
\ No newline at end of file
# -*- coding: utf-8 -*-
"""Compare the different methods to create phase maps."""
import time
import pdb, traceback, sys
import numpy as np
from numpy import pi
import pyramid.magcreator as mc
import pyramid.projector as pj
import pyramid.phasemapper as pm
import pyramid.holoimage as hi
import pyramid.analytic as an
from pyramid.magdata import MagData
from pyramid.phasemap import PhaseMap
def compare_methods():
'''Calculate and display the phase map from a given magnetization.
Arguments:
None
Returns:
None
'''
# Input parameters:
b_0 = 1 # in T
res = 10.0 # in nm
beta = pi/4
padding = 20
density = 10
dim = (1, 128, 128) # in px (z, y, x)
# Create magnetic shape:
geometry = 'slab'
if geometry == 'slab':
center = (0, dim[1]/2.-0.5, dim[2]/2.-0.5) # in px (z, y, x) index starts with 0!
width = (1, dim[1]/2., dim[2]/2.) # in px (z, y, x)
mag_shape = mc.Shapes.slab(dim, center, width)
phase_ana = an.phase_mag_slab(dim, res, beta, center, width, b_0)
elif geometry == 'disc':
center = (0, dim[1]/2.-0.5, dim[2]/2.-0.5) # in px (z, y, x) index starts with 0!
radius = dim[1]/4 # in px
height = 1 # in px
mag_shape = mc.Shapes.disc(dim, center, radius, height)
phase_ana = an.phase_mag_disc(dim, res, beta, center, radius, height, b_0)
elif geometry == 'sphere':
center = (50, 50, 50) # in px (z, y, x) index starts with 0!
radius = 25 # in px
mag_shape = mc.Shapes.sphere(dim, center, radius)
phase_ana = an.phase_mag_sphere(dim, res, beta, center, radius, b_0)
# Project the magnetization data:
mag_data = MagData(res, mc.create_mag_dist(mag_shape, beta))
mag_data.quiver_plot(ax_slice=int(center[0]))
projection = pj.simple_axis_projection(mag_data)
# Construct phase maps:
phase_map_ana = PhaseMap(res, phase_ana)
start_time = time.time()
phase_map_fft = PhaseMap(res, pm.phase_mag_fourier(res, projection, b_0, padding))
print 'Time for Fourier space approach: ', time.time() - start_time
start_time = time.time()
phase_map_slab = PhaseMap(res, pm.phase_mag_real(res, projection, 'slab', b_0))
print 'Time for real space approach (Slab):', time.time() - start_time
start_time = time.time()
phase_map_disc = PhaseMap(res, pm.phase_mag_real(res, projection, 'disc', b_0))
print 'Time for real space approach (Disc):', time.time() - start_time
# Display the combinated plots with phasemap and holography image:
hi.display_combined(phase_map_ana, density, 'Analytic Solution')
hi.display_combined(phase_map_fft, density, 'Fourier Space')
hi.display_combined(phase_map_slab, density, 'Real Space (Slab)')
hi.display_combined(phase_map_disc, density, 'Real Space (Disc)')
# Plot differences to the analytic solution:
phase_map_diff_fft = PhaseMap(res, phase_map_ana.phase-phase_map_fft.phase)
phase_map_diff_slab = PhaseMap(res, phase_map_ana.phase-phase_map_slab.phase)
phase_map_diff_disc = PhaseMap(res, phase_map_ana.phase-phase_map_disc.phase)
RMS_fft = np.std(phase_map_diff_fft.phase)
RMS_slab = np.std(phase_map_diff_slab.phase)
RMS_disc = np.std(phase_map_diff_disc.phase)
phase_map_diff_fft.display('Fourier Space (RMS = {:3.2e})'.format(RMS_fft))
phase_map_diff_slab.display('Real Space (Slab) (RMS = {:3.2e})'.format(RMS_slab))
phase_map_diff_disc.display('Real Space (Disc) (RMS = {:3.2e})'.format(RMS_disc))
if __name__ == "__main__":
try:
compare_methods()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
\ No newline at end of file
# -*- coding: utf-8 -*-
"""Compare the phase map of one pixel for different real space approaches."""
import pdb, traceback, sys
from numpy import pi
import pyramid.magcreator as mc
import pyramid.projector as pj
import pyramid.phasemapper as pm
from pyramid.magdata import MagData
from pyramid.phasemap import PhaseMap
def compare_pixel_fields():
'''Calculate and display the phase map for different real space approaches.
Arguments:
None
Returns:
None
'''
# Input parameters:
res = 10.0 # in nm
beta = pi/2 # in rad
dim = (1, 11, 11)
pixel = (0, 5, 5)
# Create magnetic data, project it, get the phase map and display the holography image:
mag_data = MagData(res, mc.create_mag_dist(mc.Shapes.pixel(dim, pixel), beta))
projection = pj.simple_axis_projection(mag_data)
phase_map_slab = PhaseMap(res, pm.phase_mag_real(res, projection, 'slab'))
phase_map_slab.display('Phase of one Pixel (Slab)')
phase_map_disc = PhaseMap(res, pm.phase_mag_real(res, projection, 'disc'))
phase_map_disc.display('Phase of one Pixel (Disc)')
phase_map_diff = PhaseMap(res, phase_map_disc.phase - phase_map_slab.phase)
phase_map_diff.display('Phase difference of one Pixel (Disc - Slab)')
if __name__ == "__main__":
try:
compare_pixel_fields()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
\ No newline at end of file
# -*- coding: utf-8 -*-
"""Create magnetic distribution of alternating filaments"""
import pdb, traceback, sys
import numpy as np
from numpy import pi
import pyramid.magcreator as mc
from pyramid.magdata import MagData
def create_alternating_filaments():
'''Calculate, display and save the magnetic distribution of alternating filaments to file.
Arguments:
None
Returns:
None
'''
# Input parameters:
filename = '../output/mag_dist_alt_filaments.txt'
dim = (1, 21, 21) # in px (z, y, x)
res = 10.0 # in nm
beta = pi/2
spacing = 5
# Create lists for magnetic objects:
count = int((dim[1]-1) / spacing) + 1
mag_shape_list = np.zeros((count,) + dim)
beta_list = np.zeros(count)
for i in range(count):
pos = i * spacing
mag_shape_list[i] = mc.Shapes.filament(dim, (0, pos))
beta_list[i] = (1-2*(int(pos/spacing)%2)) * beta
# Create magnetic distribution
magnitude = mc.create_mag_dist_comb(mag_shape_list, beta_list)
mag_data = MagData(res, magnitude)
mag_data.quiver_plot()
mag_data.save_to_llg(filename)
if __name__ == "__main__":
try:
create_alternating_filaments()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
\ No newline at end of file
# -*- coding: utf-8 -*-
"""Create the Pyramid-Logo."""
import pdb, traceback, sys
import numpy as np
from numpy import pi
import pyramid.magcreator as mc
import pyramid.projector as pj
import pyramid.phasemapper as pm
import pyramid.holoimage as hi
from pyramid.magdata import MagData
from pyramid.phasemap import PhaseMap
def create_logo():
'''Calculate and display the Pyramid-Logo.
Arguments:
None
Returns:
None
'''
# Input parameters:
res = 10.0 # in nm
beta = pi/2 # in rad
density = 10
dim = (1, 128, 128)
# Create magnetic shape:
mag_shape = np.zeros(dim)
x = range(dim[2])
y = range(dim[1])
xx, yy = np.meshgrid(x, y)
bottom = (yy >= 0.25*dim[1])
left = (yy <= 0.75/0.5 * dim[1]/dim[2] * xx)
right = np.fliplr(left)
mag_shape[0,...] = np.logical_and(np.logical_and(left, right), bottom)
# Create magnetic data, project it, get the phase map and display the holography image:
mag_data = MagData(res, mc.create_mag_dist(mag_shape, beta))
projection = pj.simple_axis_projection(mag_data)
phase_map = PhaseMap(res, pm.phase_mag_real(res, projection, 'slab'))
hi.display(hi.holo_image(phase_map, density), 'PYRAMID - LOGO')
if __name__ == "__main__":
try:
create_logo()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
\ No newline at end of file