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 1504 additions and 2041 deletions
# -*- coding: utf-8 -*-
"""Create magnetic distributions with simple geometries."""
import pdb
import traceback
import sys
from numpy import pi
import pyramid.magcreator as mc
from pyramid.magdata import MagData
def create_sample():
'''Calculate, display and save simple magnetic distributions to file.
Arguments:
None
Returns:
None
'''
# Input parameters:
key = 'slab'
filename = '../output/mag_dist_' + key + '.txt'
dim = (1, 128, 128) # in px (z, y, x)
res = 10.0 # in nm
phi = pi/4
# Geometry parameters:
center = (0, 64, 64) # in px (z, y, x), index starts with 0!
width = (1, 50, 50) # in px (z, y, x)
radius = 25 # in px
height = 1 # in px
pos = (0, 63) # in px (tuple of length 2)
pixel = (0, 63, 63) # in px (z, y, x), index starts with 0!
# Determine the magnetic shape:
if key == 'slab':
mag_shape = mc.Shapes.slab(dim, center, width)
elif key == 'disc':
mag_shape = mc.Shapes.disc(dim, center, radius, height)
elif key == 'sphere':
mag_shape = mc.Shapes.sphere(dim, center, radius)
elif key == 'filament':
mag_shape = mc.Shapes.filament(dim, pos)
elif key == 'pixel':
mag_shape = mc.Shapes.pixel(dim, pixel)
# Create magnetic distribution
magnitude = mc.create_mag_dist(mag_shape, phi)
mag_data = MagData(res, magnitude)
mag_data.quiver_plot()
mag_data.save_to_llg(filename)
if __name__ == "__main__":
try:
create_sample()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
# -*- coding: utf-8 -*-
"""Create the Pyramid-Logo."""
import pdb
import traceback
import sys
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
from pyramid.magdata import MagData
from pyramid.phasemap import PhaseMap
def create_vortex():
'''Calculate and display the Pyramid-Logo.
Arguments:
None
Returns:
None
'''
# Input parameters:
filename = '../output/mag_dist_vortex.txt'
res = 10.0 # in nm
density = 1
dim = (1, 128, 128)
center = (0, int(dim[1]/2)-0.5, int(dim[2]/2)-0.5)
radius = 0.25 * dim[1]
height = 1
# Create magnetic shape:
mag_shape = mc.Shapes.disc(dim, center, radius, height)
mag_data = MagData(res, mc.create_mag_dist_vortex(mag_shape))
mag_data.quiver_plot()
mag_data.quiver_plot3d()
mag_data.save_to_llg(filename)
projection = pj.simple_axis_projection(mag_data)
phase_map = PhaseMap(res, pm.phase_mag_real(res, projection, 'slab'))
hi.display_combined(phase_map, density, 'Vortex State')
phase_slice = phase_map.phase[dim[1]/2, :]
fig = plt.figure()
fig.add_subplot(111)
plt.plot(range(dim[1]), phase_slice)
if __name__ == "__main__":
try:
create_vortex()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 03 11:15:38 2013
@author: Jan
"""
import time
import pdb
import traceback
import sys
import numpy as np
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
from numpy import pi
def get_jacobi():
'''Calculate and display the phase map from a given magnetization.
Arguments:
None
Returns:
None
'''
# TODO: Input via GUI
b_0 = 1.0 # in T
dim = (1, 3, 3) # in px (y,x)
res = 10.0 # in nm
phi = pi/4
center = (0, 1, 1) # in px (y,x) index starts with 0!
width = (0, 1, 1) # in px (y,x)
mag_data = MagData(res, mc.create_mag_dist(mc.Shapes.slab(dim, center, width), phi))
projection = pj.simple_axis_projection(mag_data)
'''NUMERICAL SOLUTION'''
# numerical solution Real Space (Slab):
jacobi = np.zeros((dim[2]*dim[1], 2*dim[2]*dim[1]))
tic = time.clock()
phase_map = PhaseMap(res, pm.phase_mag_real(res, projection, 'slab', b_0, jacobi=jacobi))
toc = time.clock()
phase_map.display()
np.savetxt('../output/jacobi.npy', jacobi)
print 'Time for Real Space Approach with Jacobi-Matrix (Slab): ' + str(toc - tic)
return jacobi
if __name__ == "__main__":
try:
jacobi = get_jacobi()
except:
type, value, tb = sys.exc_info()
traceback.print_exc()
pdb.post_mortem(tb)
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'create_logo.ui'
#
# Created: Tue May 21 14:29:03 2013
# by: PyQt4 UI code generator 4.9.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_CreateLogoWidget(object):
def setupUi(self, CreateLogoWidget):
CreateLogoWidget.setObjectName(_fromUtf8("CreateLogoWidget"))
CreateLogoWidget.resize(520, 492)
self.verticalLayout_2 = QtGui.QVBoxLayout(CreateLogoWidget)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.xLabel = QtGui.QLabel(CreateLogoWidget)
self.xLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.xLabel.setObjectName(_fromUtf8("xLabel"))
self.horizontalLayout.addWidget(self.xLabel)
self.xSpinBox = QtGui.QSpinBox(CreateLogoWidget)
self.xSpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.xSpinBox.setMaximum(512)
self.xSpinBox.setProperty("value", 128)
self.xSpinBox.setObjectName(_fromUtf8("xSpinBox"))
self.horizontalLayout.addWidget(self.xSpinBox)
self.yLabel = QtGui.QLabel(CreateLogoWidget)
self.yLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.yLabel.setObjectName(_fromUtf8("yLabel"))
self.horizontalLayout.addWidget(self.yLabel)
self.ySpinBox = QtGui.QSpinBox(CreateLogoWidget)
self.ySpinBox.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.ySpinBox.setMaximum(512)
self.ySpinBox.setProperty("value", 128)
self.ySpinBox.setObjectName(_fromUtf8("ySpinBox"))
self.horizontalLayout.addWidget(self.ySpinBox)
self.logoPushButton = QtGui.QPushButton(CreateLogoWidget)
self.logoPushButton.setObjectName(_fromUtf8("logoPushButton"))
self.horizontalLayout.addWidget(self.logoPushButton)
self.verticalLayout.addLayout(self.horizontalLayout)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.mplWidget = MatplotlibWidget(CreateLogoWidget)
self.mplWidget.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.mplWidget.setLayoutDirection(QtCore.Qt.LeftToRight)
self.mplWidget.setAutoFillBackground(False)
self.mplWidget.setObjectName(_fromUtf8("mplWidget"))
self.verticalLayout_2.addWidget(self.mplWidget)
self.retranslateUi(CreateLogoWidget)
QtCore.QMetaObject.connectSlotsByName(CreateLogoWidget)
def retranslateUi(self, CreateLogoWidget):
CreateLogoWidget.setWindowTitle(QtGui.QApplication.translate("CreateLogoWidget", "Form", None, QtGui.QApplication.UnicodeUTF8))
self.xLabel.setText(QtGui.QApplication.translate("CreateLogoWidget", "X [px] :", None, QtGui.QApplication.UnicodeUTF8))
self.yLabel.setText(QtGui.QApplication.translate("CreateLogoWidget", "Y [px] :", None, QtGui.QApplication.UnicodeUTF8))
self.logoPushButton.setText(QtGui.QApplication.translate("CreateLogoWidget", "Create Logo", None, QtGui.QApplication.UnicodeUTF8))
from matplotlibwidget import MatplotlibWidget
This diff is collapsed.
This diff is collapsed.
# -*- 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 os
os.chdir('C:\Users\Jan\Home\PhD Thesis\Pyramid\output')
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# -*- coding: utf-8 -*-
# Copyright 2020 by Forschungszentrum Juelich GmbH
# Author: J. Caron
#
"""Subpackage containing functionality for visualisation of multidimensional fields."""
from . import fields
from . import io
from . import models
from . import reconstruct
from . import vis
from . import utils
__version__ = "0.3.5"
__git_revision__ = "undefined"
import logging
_log = logging.getLogger(__name__)
_log.info(f'Imported EMPyRe V-{__version__}')
del logging
__all__ = ['fields', 'io', 'models', 'reconstruct', 'vis', 'utils']
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# -*- coding: utf-8 -*-
# Copyright 2020 by Forschungszentrum Juelich GmbH
# Author: J. Caron
#
"""Subpackage containing EMPyRe IO functionality for several EMPyRe classes."""
from .io_field import *
__all__ = []
__all__.extend(io_field.__all__)
del io_field