diff --git a/.hgignore b/.hgignore index 38bb72ddfacd602e9a4e1d0da86aa2f3e46a6eac..52b3b62f3534c495a9abbc07bad7980745d1afb9 100644 --- a/.hgignore +++ b/.hgignore @@ -13,3 +13,4 @@ files* build* Pyramid.egg-info* logfile.log +.idea* diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index ad51e801cfd91220dd642de63cafed6315bc5df1..0000000000000000000000000000000000000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Pyramid \ No newline at end of file diff --git a/.idea/Pyramid.iml b/.idea/Pyramid.iml deleted file mode 100644 index 5eca37029b0a0c6f0a7cb507cb9a545fcb15716b..0000000000000000000000000000000000000000 --- a/.idea/Pyramid.iml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="PYTHON_MODULE" version="4"> - <component name="NewModuleRootManager"> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/pyramid" isTestSource="false" /> - </content> - <orderEntry type="jdk" jdkName="Python 2.7.11 (C:\Anaconda2\python.exe)" jdkType="Python SDK" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="module" module-name="HyperSpy" /> - <orderEntry type="module" module-name="Jutil" /> - <orderEntry type="module" module-name="Publications" /> - <orderEntry type="module" module-name="Script-Vault" /> - </component> - <component name="ReSTService"> - <option name="workdir" value="$MODULE_DIR$" /> - <option name="DOC_DIR" value="$MODULE_DIR$" /> - </component> - <component name="TestRunnerService"> - <option name="projectConfiguration" value="Nosetests" /> - <option name="PROJECT_TEST_RUNNER" value="Nosetests" /> - </component> -</module> \ No newline at end of file diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index 7fb8ed00def85cd0fa9e3692d2786fc224c2273e..0000000000000000000000000000000000000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectCodeStyleSettingsManager"> - <option name="PER_PROJECT_SETTINGS"> - <value> - <XML> - <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" /> - </XML> - </value> - </option> - <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/dictionaries/Jan.xml b/.idea/dictionaries/Jan.xml deleted file mode 100644 index 9a9d8f96a55baaa8979b7e1af79b58ad0a21aae4..0000000000000000000000000000000000000000 --- a/.idea/dictionaries/Jan.xml +++ /dev/null @@ -1,3 +0,0 @@ -<component name="ProjectDictionaryState"> - <dictionary name="Jan" /> -</component> \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba45445dc9f3afa66e6a149914dc39e3df6..0000000000000000000000000000000000000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="Encoding"> - <file url="PROJECT" charset="UTF-8" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 94c0305e3243b7c6f18ed96bef7351a158bbfbb6..0000000000000000000000000000000000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,90 +0,0 @@ -<component name="InspectionProjectProfileManager"> - <profile version="1.0"> - <option name="myName" value="Project Default" /> - <inspection_tool class="LongLine" enabled="true" level="WARNING" enabled_by_default="true"> - <scope name="*.c" level="WARNING" enabled="false" /> - </inspection_tool> - <inspection_tool class="PyArgumentListInspection" enabled="true" level="WARNING" enabled_by_default="true"> - <scope name="gui" level="WARNING" enabled="false" /> - </inspection_tool> - <inspection_tool class="PyAttributeOutsideInitInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> - <inspection_tool class="PyBroadExceptionInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> - <inspection_tool class="PyCallByClassInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true"> - <scope name="gui" level="WEAK WARNING" enabled="false" /> - </inspection_tool> - <inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true"> - <scope name="gui" level="WARNING" enabled="false" /> - </inspection_tool> - <inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true"> - <option name="ourVersions"> - <value> - <list size="1"> - <item index="0" class="java.lang.String" itemvalue="3.5" /> - </list> - </value> - </option> - </inspection_tool> - <inspection_tool class="PyMandatoryEncodingInspection" enabled="true" level="WARNING" enabled_by_default="true" /> - <inspection_tool class="PyMissingOrEmptyDocstringInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true"> - <scope name="gui" level="WEAK WARNING" enabled="false" /> - </inspection_tool> - <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true"> - <scope name="gui" level="WARNING" enabled="false"> - <option name="ignoredPackages"> - <value> - <list size="0" /> - </value> - </option> - </scope> - <scope name="scripts" level="WARNING" enabled="true"> - <option name="ignoredPackages"> - <value> - <list size="2"> - <item index="0" class="java.lang.String" itemvalue="pylab" /> - <item index="1" class="java.lang.String" itemvalue="tqdm" /> - </list> - </value> - </option> - </scope> - <option name="ignoredPackages"> - <value> - <list size="1"> - <item index="0" class="java.lang.String" itemvalue="hyperspy" /> - </list> - </value> - </option> - </inspection_tool> - <inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true"> - <scope name="__init__" level="WEAK WARNING" enabled="true"> - <option name="ignoredErrors"> - <list> - <option value="E402" /> - </list> - </option> - </scope> - <option name="ignoredErrors"> - <list> - <option value="W503" /> - </list> - </option> - </inspection_tool> - <inspection_tool class="PyPep8NamingInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> - <inspection_tool class="PyShadowingNamesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> - <inspection_tool class="PyTypeCheckerInspection" enabled="false" level="WARNING" enabled_by_default="false" /> - <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true"> - <scope name="__init__" level="WARNING" enabled="false" /> - <option name="ignoredIdentifiers"> - <list> - <option value="multiprocessing" /> - <option value="hyperspy.api" /> - </list> - </option> - </inspection_tool> - <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false"> - <option name="processCode" value="true" /> - <option name="processLiterals" value="true" /> - <option name="processComments" value="true" /> - </inspection_tool> - <inspection_tool class="TodoComment" enabled="false" level="INFO" enabled_by_default="false" /> - </profile> -</component> \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 6933c1eaf531ddea432cb9d079f14ccacf517bf3..0000000000000000000000000000000000000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ -<component name="InspectionProjectProfileManager"> - <settings> - <option name="PROJECT_PROFILE" value="Project Default" /> - <option name="USE_PROJECT_PROFILE" value="true" /> - <version value="1.0" /> - </settings> -</component> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 2cc28d39a5075d44f3c329756c9b810c51d19dc6..0000000000000000000000000000000000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectLevelVcsManager" settingsEditedManually="false"> - <OptionsSetting value="true" id="Add" /> - <OptionsSetting value="true" id="Remove" /> - <OptionsSetting value="true" id="Checkout" /> - <OptionsSetting value="true" id="Update" /> - <OptionsSetting value="true" id="Status" /> - <OptionsSetting value="true" id="Edit" /> - <ConfirmationsSetting value="0" id="Add" /> - <ConfirmationsSetting value="0" id="Remove" /> - </component> - <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.11 (C:\Anaconda2\python.exe)" project-jdk-type="Python SDK" /> -</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 77d9492a5b635606502a4cacafc0f68dbf24c9e1..0000000000000000000000000000000000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectModuleManager"> - <modules> - <module fileurl="file://$PROJECT_DIR$/../HyperSpy/.idea/HyperSpy.iml" filepath="$PROJECT_DIR$/../HyperSpy/.idea/HyperSpy.iml" /> - <module fileurl="file://$PROJECT_DIR$/../Jutil/.idea/Jutil.iml" filepath="$PROJECT_DIR$/../Jutil/.idea/Jutil.iml" /> - <module fileurl="file://$PROJECT_DIR$/../Publications/.idea/Publications.iml" filepath="$PROJECT_DIR$/../Publications/.idea/Publications.iml" /> - <module fileurl="file://$PROJECT_DIR$/.idea/Pyramid.iml" filepath="$PROJECT_DIR$/.idea/Pyramid.iml" /> - <module fileurl="file://$PROJECT_DIR$/../Script-Vault/.idea/Script-Vault.iml" filepath="$PROJECT_DIR$/../Script-Vault/.idea/Script-Vault.iml" /> - </modules> - </component> -</project> \ No newline at end of file diff --git a/.idea/scopes/__c.xml b/.idea/scopes/__c.xml deleted file mode 100644 index 29b91034cc3e3de8b258fb9616aa8d03dffd5228..0000000000000000000000000000000000000000 --- a/.idea/scopes/__c.xml +++ /dev/null @@ -1,3 +0,0 @@ -<component name="DependencyValidationManager"> - <scope name="*.c" pattern="file[Pyramid]:pyramid/numcore/*.c" /> -</component> \ No newline at end of file diff --git a/.idea/scopes/__init__.xml b/.idea/scopes/__init__.xml deleted file mode 100644 index 067b2ec516c4336add3e7fda511fdd05163ebcee..0000000000000000000000000000000000000000 --- a/.idea/scopes/__init__.xml +++ /dev/null @@ -1,3 +0,0 @@ -<component name="DependencyValidationManager"> - <scope name="__init__" pattern="file[Pyramid]:pyramid/__init__.py" /> -</component> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 206c3879bb852f179cd4a505b56b6a562a039390..0000000000000000000000000000000000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="VcsDirectoryMappings"> - <mapping directory="" vcs="hg4idea" /> - <mapping directory="$PROJECT_DIR$/../Jutil" vcs="hg4idea" /> - <mapping directory="$PROJECT_DIR$/../Publications" vcs="hg4idea" /> - <mapping directory="$PROJECT_DIR$/../Script-Vault" vcs="hg4idea" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 50f66b1e1b18d1933049f44218840883a7fe081a..0000000000000000000000000000000000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,1500 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="AnalysisUIOptions"> - <option name="SCOPE_TYPE" value="3" /> - <option name="ANALYSIS_IN_BACKGROUND" value="true" /> - </component> - <component name="ChangeListManager"> - <list default="true" id="990252ab-aff5-4ac2-a857-b193d2c46b18" name="Default" comment="Updated long overdue scripts to work with new layout and refactoring!"> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/pyramid/kernel.py" afterPath="$PROJECT_DIR$/pyramid/kernel.py" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_pixel_fields.py" afterPath="$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_pixel_fields.py" /> - </list> - <ignored path="Pyramid.iws" /> - <ignored path=".idea/workspace.xml" /> - <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> - <option name="TRACKING_ENABLED" value="true" /> - <option name="SHOW_DIALOG" value="false" /> - <option name="HIGHLIGHT_CONFLICTS" value="true" /> - <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> - <option name="LAST_RESOLUTION" value="IGNORE" /> - </component> - <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> - <component name="CreatePatchCommitExecutor"> - <option name="PATCH_PATH" value="" /> - </component> - <component name="ErrorTreeViewConfiguration"> - <option name="autoscrollToSource" value="true" /> - <option name="IS_AUTOSCROLL_TO_SOURCE" value="true" /> - </component> - <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> - <component name="FavoritesManager"> - <favorites_list name="Pyramid" /> - </component> - <component name="FileEditorManager"> - <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> - <file leaf-file-name="example_joern.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/example_joern.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="patrick_nanowire_reconstruction.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/patrick_nanowire_reconstruction.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="patrick_nanowire_reconstruction_simulation.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/patrick_nanowire_reconstruction_simulation.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="result.pickle" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/result.pickle"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="rueffner_file.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/rueffner_file.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="vtk_conversion_nanowire_full.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/vtk_conversion_nanowire_full.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="reconstruct_random_pixels.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruct_random_pixels.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="reconstruction_linear_test.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruction_linear_test.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="reconstruction_linear_test_batch.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruction_linear_test_batch.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="reconstruction_sparse_cg_singular_values.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruction_sparse_cg_singular_values.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="compare_kernels.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_kernels.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="compare_methods.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_methods.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="compare_pixel_fields.py" pinned="false" current-in-tab="true"> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_pixel_fields.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.37866354"> - <caret line="79" column="31" selection-start-line="79" selection-start-column="31" selection-end-line="79" selection-end-column="31" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="kernel.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/pyramid/kernel.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="112" column="43" selection-start-line="112" selection-start-column="43" selection-end-line="112" selection-end-column="43" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="phasemap.py" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/pyramid/phasemap.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="154" column="16" selection-start-line="154" selection-start-column="16" selection-end-line="154" selection-end-column="16" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="pydev_run_in_console.py" pinned="false" current-in-tab="false"> - <entry file="file://$APPLICATION_HOME_DIR$/helpers/pydev/pydev_run_in_console.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="28" column="0" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - </file> - </leaf> - </component> - <component name="FileTemplateManagerImpl"> - <option name="RECENT_TEMPLATES"> - <list> - <option value="Python Script" /> - </list> - </option> - </component> - <component name="HgUpdateConfigurationSettings"> - <option name="updateType" value="MERGE" /> - <option name="shouldCommitAfterMerge" value="true" /> - </component> - <component name="IdeDocumentHistory"> - <option name="CHANGED_PATHS"> - <list> - <option value="$PROJECT_DIR$/../HyperSpy/hyperspy/tests/io/test_emd.py" /> - <option value="$PROJECT_DIR$/pyramid/__init__.py" /> - <option value="C:/Anaconda2/Lib/site-packages/nbformat/__init__.py" /> - <option value="C:/Anaconda2/Lib/site-packages/jsonschema/validators.py" /> - <option value="$PROJECT_DIR$/../HyperSpy/hyperspy/__init__.py" /> - <option value="$APPLICATION_HOME_DIR$/helpers/pydev/pydev_ipython/qt_loaders.py" /> - <option value="C:/Anaconda2/Lib/pkgutil.py" /> - <option value="C:/Anaconda2/Lib/site-packages/nbconvert/exporters/pdf.py" /> - <option value="C:/Anaconda2/Lib/subprocess.py" /> - <option value="$PROJECT_DIR$/scripts/reconstruction/reconstruction_3d_from_magdata.py" /> - <option value="$PROJECT_DIR$/scripts/reconstruction/reconstruction_2d_from_phasemap.py" /> - <option value="$PROJECT_DIR$/scripts/phasemap/phasemap_tilt_series.py" /> - <option value="$PROJECT_DIR$/scripts/phasemap/phasemap_from_raw.py" /> - <option value="$PROJECT_DIR$/scripts/phasemap/phasemap_from_image.py" /> - <option value="$PROJECT_DIR$/scripts/phasemap/phasemap_projection_arbitrary.py" /> - <option value="$PROJECT_DIR$/scripts/phasemap/phasemap_from_dm3.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magdata_from_vtk.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magdata_from_txtfortran.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magdata_from_dat.py" /> - <option value="$PROJECT_DIR$/pyramid/fielddata.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_core_shell_sphere.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_array_sphere_disc_slab.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_horseshoe.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_core_shell_disc.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_paper2_vortex_slab.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_vortex_slab.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_random_slabs.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_random_pixels.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_alternating_filaments.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_singularity.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_filament.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_vortex_sphere.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_flat_homog_slab.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_pyramid_logo.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_flat_vortex_slab.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_vortex_disc.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_disc.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_pixel.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_slab.py" /> - <option value="$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_sphere.py" /> - <option value="$PROJECT_DIR$/setup.py" /> - <option value="$PROJECT_DIR$/scripts/gui/phasemap_creator.py" /> - <option value="$PROJECT_DIR$/pyramid/reconstruction.py" /> - <option value="$PROJECT_DIR$/pyramid/projector.py" /> - <option value="$PROJECT_DIR$/pyramid/phasemapper.py" /> - <option value="$PROJECT_DIR$/pyramid/phasemap.py" /> - <option value="$PROJECT_DIR$/pyramid/diagnostics.py" /> - <option value="$PROJECT_DIR$/pyramid/dataset.py" /> - <option value="$PROJECT_DIR$/scripts/gui/mag_slicer.py" /> - <option value="$PROJECT_DIR$/pyramid/kernel.py" /> - <option value="$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_pixel_fields.py" /> - </list> - </option> - </component> - <component name="NamedScopeManager"> - <scope name="scripts" pattern="file[Pyramid]:scripts/*" /> - <scope name="gui" pattern="file[Pyramid]:scripts/gui/*" /> - <order> - <scope name="__init__" /> - <scope name="*.c" /> - </order> - </component> - <component name="ProjectFrameBounds"> - <option name="x" value="-8" /> - <option name="y" value="-8" /> - <option name="width" value="1936" /> - <option name="height" value="1056" /> - </component> - <component name="ProjectInspectionProfilesVisibleTreeState"> - <entry key="Project Default"> - <profile-state> - <expanded-state> - <State> - <id /> - </State> - <State> - <id>General</id> - </State> - <State> - <id>Python</id> - </State> - <State> - <id>Spelling</id> - </State> - </expanded-state> - <selected-state> - <State> - <id>PyArgumentListInspection</id> - </State> - </selected-state> - </profile-state> - </entry> - </component> - <component name="ProjectLevelVcsManager" settingsEditedManually="true"> - <OptionsSetting value="true" id="Add" /> - <OptionsSetting value="true" id="Remove" /> - <OptionsSetting value="true" id="Checkout" /> - <OptionsSetting value="true" id="Update" /> - <OptionsSetting value="true" id="Status" /> - <OptionsSetting value="true" id="Edit" /> - <ConfirmationsSetting value="0" id="Add" /> - <ConfirmationsSetting value="0" id="Remove" /> - </component> - <component name="ProjectView"> - <navigator currentView="ProjectPane" proportions="" version="1"> - <flattenPackages /> - <showMembers /> - <showModules /> - <showLibraryContents /> - <hideEmptyPackages /> - <abbreviatePackageNames /> - <autoscrollToSource /> - <autoscrollFromSource /> - <sortByType /> - <manualOrder /> - <foldersAlwaysOnTop value="true" /> - </navigator> - <panes> - <pane id="Scratches" /> - <pane id="ProjectPane"> - <subPane> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Script-Vault" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Script-Vault" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="scripts - Alt" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="test methods" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Script-Vault" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="scripts - Alt" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="reconstruction" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Script-Vault" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="scripts - Alt" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="collaborations" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - </subPane> - </pane> - <pane id="Scope" /> - <pane id="ColorIdeProjectViewPane"> - <subPane> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Pyramid" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - </subPane> - </pane> - </panes> - </component> - <component name="PropertiesComponent"> - <property name="settings.editor.selected.configurable" value="project.scopes" /> - <property name="settings.editor.splitter.proportion" value="0.2" /> - <property name="last_opened_file_path" value="$PROJECT_DIR$/files/vecdata" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatWidth0" value="44" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder0" value="0" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatWidth1" value="64" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder1" value="1" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatWidth2" value="65" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder2" value="2" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatWidth3" value="625" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder3" value="3" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth0" value="164" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeOrder0" value="0" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth1" value="163" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeOrder1" value="1" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth2" value="165" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeOrder2" value="2" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth3" value="306" /> - <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeOrder3" value="3" /> - <property name="last.edited.regexp" value="asdf aasfasf.version_info " /> - <property name="restartRequiresConfirmation" value="false" /> - <property name="SearchEverywhereHistoryKey" value="nbconvert	null	null boto.vendored.six._SixMetaPathImporter	null	null pkg_resources.extern.VendorImporter	null	null colorwheel	null	null" /> - </component> - <component name="Push.Settings"> - <excluded-roots> - <path value="$PROJECT_DIR$/../HyperSpy" /> - </excluded-roots> - </component> - <component name="PyConsoleOptionsProvider"> - <option name="myPythonConsoleState"> - <console-settings custom-start-script="# coding: utf-8 """Startup!""" from __future__ import division import sys import os import pdb import hyperspy.api as hs import pyramid from pyramid import * import pyramid.analytic as an import pyramid.magcreator as mc import pyramid.reconstruction as rc import jutil import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.pyplot as plt from pylab import * import logging.config logging.config.fileConfig(LOGGING_CONFIG, disable_existing_loggers=False) ion() # Enable Matplotlib's interactive mode sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) " module-name="Pyramid" is-module-sdk="true" working-directory="$PROJECT_DIR$/files/vecdata"> - <option name="myCustomStartScript" value="# coding: utf-8 """Startup!""" from __future__ import division import sys import os import pdb import hyperspy.api as hs import pyramid from pyramid import * import pyramid.analytic as an import pyramid.magcreator as mc import pyramid.reconstruction as rc import jutil import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.pyplot as plt from pylab import * import logging.config logging.config.fileConfig(LOGGING_CONFIG, disable_existing_loggers=False) ion() # Enable Matplotlib's interactive mode sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) " /> - <option name="myUseModuleSdk" value="true" /> - <option name="myModuleName" value="Pyramid" /> - <option name="myWorkingDirectory" value="$PROJECT_DIR$/files/vecdata" /> - <option name="myAddSourceRoots" value="true" /> - </console-settings> - </option> - </component> - <component name="PyDebuggerOptionsProvider"> - <option name="mySaveCallSignatures" value="true" /> - </component> - <component name="RecentsManager"> - <key name="MoveFile.RECENT_KEYS"> - <recent name="C:\Users\Jan\Home\PhD Thesis\Projects\Script-Vault" /> - </key> - </component> - <component name="RunManager" selected="Python.compare_pixel_fields"> - <configuration default="false" name="config" type="PythonConfigurationType" factoryName="Python" temporary="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/pyramid" /> - <option name="IS_MODULE_SDK" value="true" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/pyramid/config.py" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="false" name="colormap" type="PythonConfigurationType" factoryName="Python" temporary="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/pyramid" /> - <option name="IS_MODULE_SDK" value="true" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/pyramid/colormap.py" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="false" name="analytic" type="PythonConfigurationType" factoryName="Python" temporary="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/pyramid" /> - <option name="IS_MODULE_SDK" value="true" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/pyramid/analytic.py" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="false" name="__init__" type="PythonConfigurationType" factoryName="Python" temporary="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/pyramid" /> - <option name="IS_MODULE_SDK" value="true" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/pyramid/__init__.py" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="false" name="compare_pixel_fields" type="PythonConfigurationType" factoryName="Python" temporary="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods" /> - <option name="IS_MODULE_SDK" value="true" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Script-Vault" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_pixel_fields.py" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="true" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration"> - <method /> - </configuration> - <configuration default="true" type="PythonConfigurationType" factoryName="Python"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="true" type="docs" factoryName="Sphinx task"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="docutils_input_file" value="" /> - <option name="docutils_output_file" value="" /> - <option name="docutils_params" value="" /> - <option name="docutils_task" value="" /> - <option name="docutils_open_in_browser" value="false" /> - <method /> - </configuration> - <configuration default="true" type="tests" factoryName="Attests"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="" /> - <option name="CLASS_NAME" value="" /> - <option name="METHOD_NAME" value="" /> - <option name="FOLDER_NAME" value="" /> - <option name="TEST_TYPE" value="TEST_SCRIPT" /> - <option name="PATTERN" value="" /> - <option name="USE_PATTERN" value="false" /> - <method /> - </configuration> - <configuration default="true" type="tests" factoryName="Doctests"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="" /> - <option name="CLASS_NAME" value="" /> - <option name="METHOD_NAME" value="" /> - <option name="FOLDER_NAME" value="" /> - <option name="TEST_TYPE" value="TEST_SCRIPT" /> - <option name="PATTERN" value="" /> - <option name="USE_PATTERN" value="false" /> - <method /> - </configuration> - <configuration default="true" type="tests" factoryName="Nosetests"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="" /> - <option name="CLASS_NAME" value="" /> - <option name="METHOD_NAME" value="" /> - <option name="FOLDER_NAME" value="" /> - <option name="TEST_TYPE" value="TEST_SCRIPT" /> - <option name="PATTERN" value="" /> - <option name="USE_PATTERN" value="false" /> - <option name="PARAMS" value="" /> - <option name="USE_PARAM" value="false" /> - <method /> - </configuration> - <configuration default="true" type="tests" factoryName="Unittests"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="" /> - <option name="CLASS_NAME" value="" /> - <option name="METHOD_NAME" value="" /> - <option name="FOLDER_NAME" value="" /> - <option name="TEST_TYPE" value="TEST_FOLDER" /> - <option name="PATTERN" value="" /> - <option name="USE_PATTERN" value="false" /> - <option name="PUREUNITTEST" value="true" /> - <option name="PARAMS" value="" /> - <option name="USE_PARAM" value="false" /> - <method /> - </configuration> - <configuration default="true" type="tests" factoryName="py.test"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="" /> - <option name="CLASS_NAME" value="" /> - <option name="METHOD_NAME" value="" /> - <option name="FOLDER_NAME" value="" /> - <option name="TEST_TYPE" value="TEST_SCRIPT" /> - <option name="PATTERN" value="" /> - <option name="USE_PATTERN" value="false" /> - <option name="testToRun" value="" /> - <option name="keywords" value="" /> - <option name="params" value="" /> - <option name="USE_PARAM" value="false" /> - <option name="USE_KEYWORD" value="false" /> - <method /> - </configuration> - <configuration default="false" name="mag_slicer" type="PythonConfigurationType" factoryName="Python"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/scripts/gui" /> - <option name="IS_MODULE_SDK" value="true" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Script-Vault" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/scripts/gui/mag_slicer.py" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="false" name="fieldconverter" type="PythonConfigurationType" factoryName="Python" singleton="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs> - <env name="PYTHONUNBUFFERED" value="1" /> - </envs> - <option name="SDK_HOME" value="" /> - <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/pyramid" /> - <option name="IS_MODULE_SDK" value="true" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="$PROJECT_DIR$/pyramid/fieldconverter.py" /> - <option name="PARAMETERS" value="" /> - <option name="SHOW_COMMAND_LINE" value="true" /> - <method /> - </configuration> - <configuration default="false" name="Pyramid Sphinx" type="docs" factoryName="Sphinx task" singleton="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="docutils_input_file" value="C:\Users\Jan\Home\PhD Thesis\Projects\Pyramid\docs" /> - <option name="docutils_output_file" value="C:\Users\Jan\Home\PhD Thesis\Projects\Pyramid\docs\_build" /> - <option name="docutils_params" value="" /> - <option name="docutils_task" value="html" /> - <option name="docutils_open_in_browser" value="false" /> - <method /> - </configuration> - <configuration default="false" name="Pyramid Tests" type="tests" factoryName="Nosetests" singleton="true"> - <option name="INTERPRETER_OPTIONS" value="" /> - <option name="PARENT_ENVS" value="true" /> - <envs /> - <option name="SDK_HOME" value="C:\Anaconda2\python.exe" /> - <option name="WORKING_DIRECTORY" value="" /> - <option name="IS_MODULE_SDK" value="false" /> - <option name="ADD_CONTENT_ROOTS" value="true" /> - <option name="ADD_SOURCE_ROOTS" value="true" /> - <module name="Pyramid" /> - <option name="SCRIPT_NAME" value="" /> - <option name="CLASS_NAME" value="" /> - <option name="METHOD_NAME" value="" /> - <option name="FOLDER_NAME" value="$PROJECT_DIR$/pyramid/tests" /> - <option name="TEST_TYPE" value="TEST_FOLDER" /> - <option name="PATTERN" value="" /> - <option name="USE_PATTERN" value="false" /> - <option name="PARAMS" value="" /> - <option name="USE_PARAM" value="false" /> - <method /> - </configuration> - <list size="9"> - <item index="0" class="java.lang.String" itemvalue="Python.mag_slicer" /> - <item index="1" class="java.lang.String" itemvalue="Python.fieldconverter" /> - <item index="2" class="java.lang.String" itemvalue="Python docs.Pyramid Sphinx" /> - <item index="3" class="java.lang.String" itemvalue="Python tests.Pyramid Tests" /> - <item index="4" class="java.lang.String" itemvalue="Python.config" /> - <item index="5" class="java.lang.String" itemvalue="Python.colormap" /> - <item index="6" class="java.lang.String" itemvalue="Python.analytic" /> - <item index="7" class="java.lang.String" itemvalue="Python.__init__" /> - <item index="8" class="java.lang.String" itemvalue="Python.compare_pixel_fields" /> - </list> - <recent_temporary> - <list size="5"> - <item index="0" class="java.lang.String" itemvalue="Python.compare_pixel_fields" /> - <item index="1" class="java.lang.String" itemvalue="Python.__init__" /> - <item index="2" class="java.lang.String" itemvalue="Python.analytic" /> - <item index="3" class="java.lang.String" itemvalue="Python.colormap" /> - <item index="4" class="java.lang.String" itemvalue="Python.config" /> - </list> - </recent_temporary> - </component> - <component name="ShelveChangesManager" show_recycled="false" /> - <component name="StructureViewFactory"> - <option name="AUTOSCROLL_FROM_SOURCE" value="true" /> - <option name="ACTIVE_ACTIONS" value=",SHOW_INHERITED,SHOW_FIELDS" /> - </component> - <component name="SvnConfiguration"> - <configuration>C:\Users\Jan\AppData\Roaming\Subversion</configuration> - </component> - <component name="TaskManager"> - <task active="true" id="Default" summary="Default task"> - <changelist id="990252ab-aff5-4ac2-a857-b193d2c46b18" name="Default" comment="" /> - <created>1455975387282</created> - <option name="number" value="Default" /> - <updated>1455975387282</updated> - </task> - <task id="LOCAL-00001" summary="First use of PyCharms! Added .idea folder with PyCharms settings. Changed icon.ico (now round). PhaseMap and MagData: Now use h5py to load/save data (via HyperSpy). Deprecated loading routines (x3d) are gone now! tests: All tests now reflect this change. scripts: Streamlined some scripts. Many are now in separate project: Script-Vault "> - <created>1456134329804</created> - <option name="number" value="00001" /> - <option name="project" value="LOCAL" /> - <updated>1456134329804</updated> - </task> - <task id="LOCAL-00002" summary="Added icon and PyCharm files! "> - <created>1456180505764</created> - <option name="number" value="00002" /> - <option name="project" value="LOCAL" /> - <updated>1456180505764</updated> - </task> - <task id="LOCAL-00003" summary="First Publications commit! "> - <created>1456181242955</created> - <option name="number" value="00003" /> - <option name="project" value="LOCAL" /> - <updated>1456181242955</updated> - </task> - <task id="LOCAL-00004" summary="Added old backup copies (sort out in future)! "> - <created>1456181370435</created> - <option name="number" value="00004" /> - <option name="project" value="LOCAL" /> - <updated>1456181370435</updated> - </task> - <task id="LOCAL-00005" summary="Hopefully made hyperspy import (now at beginning of pyramid package) work! Added PyCharm files! Commit before Reformatting with PyCharms!"> - <created>1456182073457</created> - <option name="number" value="00005" /> - <option name="project" value="LOCAL" /> - <updated>1456182073457</updated> - </task> - <task id="LOCAL-00006" summary="Hopefully made hyperspy import (now at beginning of pyramid package) work! Added PyCharm files! Commit before Reformatting with PyCharms!"> - <created>1456182098486</created> - <option name="number" value="00006" /> - <option name="project" value="LOCAL" /> - <updated>1456182098486</updated> - </task> - <task id="LOCAL-00007" summary="New branch: new signals for holographic analysis!"> - <created>1456209518394</created> - <option name="number" value="00007" /> - <option name="project" value="LOCAL" /> - <updated>1456209518394</updated> - </task> - <task id="LOCAL-00008" summary="Commit after Reformatting with PyCharms!"> - <created>1456703900364</created> - <option name="number" value="00008" /> - <option name="project" value="LOCAL" /> - <updated>1456703900364</updated> - </task> - <task id="LOCAL-00009" summary="Added fieldconverter module! fieldconverter: methods to convert M to A to B magdata: a bit more parameters for quiver_plot3d(), added contour_plot3d() phasemapper: pm() extended for different projections (not just simple) kernel: u and v switched (now named after the unit magnetization direction, which makes much more sense)"> - <created>1457095777824</created> - <option name="number" value="00009" /> - <option name="project" value="LOCAL" /> - <updated>1457095777824</updated> - </task> - <task id="LOCAL-00010" summary="Refactoring: Replaced MagData with VectorData and added ScalarData class (and common superclass FieldData). magnitude is now called field (which is more appropriate) projector now uses FieldData to process both vector and scalar data (foundation was in place before)"> - <created>1457519303095</created> - <option name="number" value="00010" /> - <option name="project" value="LOCAL" /> - <updated>1457519303095</updated> - </task> - <task id="LOCAL-00011" summary="Refactoring: Replaced MagData with VectorData and added ScalarData class (and common superclass FieldData). magnitude is now called field (which is more appropriate) projector now uses FieldData to process both vector and scalar data (foundation was in place before)"> - <created>1457523017286</created> - <option name="number" value="00011" /> - <option name="project" value="LOCAL" /> - <updated>1457523017286</updated> - </task> - <task id="LOCAL-00012" summary="Refactoring: Replaced MagData with VectorData and added ScalarData class (and common superclass FieldData). magnitude is now called field (which is more appropriate) projector now uses FieldData to process both vector and scalar data (foundation was in place before)"> - <created>1457523121814</created> - <option name="number" value="00012" /> - <option name="project" value="LOCAL" /> - <updated>1457523121814</updated> - </task> - <task id="LOCAL-00013" summary="Updated long overdue scripts to work with new layout and refactoring!"> - <created>1458723675103</created> - <option name="number" value="00013" /> - <option name="project" value="LOCAL" /> - <updated>1458723675103</updated> - </task> - <option name="localTasksCounter" value="14" /> - <servers /> - </component> - <component name="TestHistory"> - <history-entry file="Nosetests_in_test_emd - 2016.03.11 at 09h 20m 49s.xml"> - <configuration name="Nosetests in test_emd" configurationId="tests" /> - </history-entry> - <history-entry file="Nosetests_in_test_emd - 2016.03.11 at 09h 30m 44s.xml"> - <configuration name="Nosetests in test_emd" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.08 at 21h 37m 05s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.09 at 00h 21m 59s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.09 at 00h 33m 38s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.09 at 00h 47m 08s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.09 at 09h 43m 39s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.09 at 11h 07m 10s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.11 at 15h 02m 03s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - <history-entry file="Pyramid_Tests - 2016.03.22 at 16h 50m 06s.xml"> - <configuration name="Pyramid Tests" configurationId="tests" /> - </history-entry> - </component> - <component name="TodoView" selected-index="3"> - <todo-panel id="selected-file"> - <is-autoscroll-to-source value="true" /> - </todo-panel> - <todo-panel id="all"> - <are-packages-shown value="true" /> - <is-autoscroll-to-source value="true" /> - </todo-panel> - </component> - <component name="ToolWindowManager"> - <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" /> - <editor active="true" /> - <layout> - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16897655" sideWeight="0.49186993" order="0" side_tool="false" content_ui="combo" /> - <window_info id="TODO" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3219616" sideWeight="0.49746513" order="9" side_tool="false" content_ui="tabs" x="-33" y="355" width="1594" height="283" /> - <window_info id="Messages" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3326226" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" /> - <window_info id="Event Log" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.42802057" sideWeight="0.50253487" order="8" side_tool="false" content_ui="tabs" /> - <window_info id="Python Console" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35927504" sideWeight="0.49746513" order="3" side_tool="false" content_ui="tabs" /> - <window_info id="Version Control" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.45095947" sideWeight="0.49746513" order="7" side_tool="false" content_ui="tabs" /> - <window_info id="Run" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.35980812" sideWeight="0.49746513" order="4" side_tool="false" content_ui="tabs" /> - <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.09808102" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Terminal" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.43316194" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> - <window_info id="Favorites" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.4224" sideWeight="0.5081301" order="11" side_tool="false" content_ui="tabs" /> - <window_info id="Debug" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35714287" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> - <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> - <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> - <window_info id="Inspection" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.37596402" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> - <window_info id="Thumbnails" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="WINDOWED" visible="false" show_stripe_button="false" weight="0.3708108" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" x="6" y="307" width="1908" height="381" /> - <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> - <window_info id="Find" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34168443" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" /> - <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - </layout> - <layout-to-restore> - <window_info id="TODO" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3219616" sideWeight="0.49746513" order="9" side_tool="false" content_ui="tabs" x="-33" y="355" width="1594" height="283" /> - <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> - <window_info id="Messages" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3326226" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" /> - <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> - <window_info id="Event Log" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.42857143" sideWeight="0.50253487" order="8" side_tool="false" content_ui="tabs" /> - <window_info id="Inspection" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.37596402" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> - <window_info id="Python Console" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3611825" sideWeight="0.49746513" order="3" side_tool="false" content_ui="tabs" /> - <window_info id="Version Control" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.44136462" sideWeight="0.49746513" order="7" side_tool="false" content_ui="tabs" /> - <window_info id="Run" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32334962" sideWeight="0.49746513" order="4" side_tool="false" content_ui="tabs" /> - <window_info id="Thumbnails" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="WINDOWED" visible="false" show_stripe_button="false" weight="0.3708108" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" x="6" y="307" width="1908" height="381" /> - <window_info id="Terminal" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.43316194" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.11311054" sideWeight="0.49186993" order="0" side_tool="false" content_ui="combo" /> - <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> - <window_info id="Find" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34168443" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" /> - <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.09808102" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Favorites" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.4224" sideWeight="0.5081301" order="11" side_tool="false" content_ui="tabs" /> - <window_info id="Debug" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32455012" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> - </layout-to-restore> - </component> - <component name="Vcs.Log.UiProperties"> - <option name="SHOW_ROOT_NAMES" value="true" /> - <option name="RECENTLY_FILTERED_USER_GROUPS"> - <collection /> - </option> - <option name="RECENTLY_FILTERED_BRANCH_GROUPS"> - <collection /> - </option> - </component> - <component name="VcsContentAnnotationSettings"> - <option name="myLimit" value="2678400000" /> - </component> - <component name="VcsManagerConfiguration"> - <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="false" /> - <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" /> - <option name="CHECK_CODE_CLEANUP_BEFORE_PROJECT_COMMIT" value="true" /> - <confirmMoveToFailedCommit value="1" /> - <option name="SHOW_DIRTY_RECURSIVELY" value="true" /> - <MESSAGE value="First use of PyCharms! Added .idea folder with PyCharms settings. Changed icon.ico (now round). PhaseMap and MagData: Now use h5py to load/save data (via HyperSpy). Deprecated loading routines (x3d) are gone now! tests: All tests now reflect this change. scripts: Streamlined some scripts. Many are now in separate project: Script-Vault " /> - <MESSAGE value="Added more signals for holographic imaging! " /> - <MESSAGE value="Added icon and PyCharm files! " /> - <MESSAGE value="First Publications commit! " /> - <MESSAGE value="Added old backup copies (sort out in future)! " /> - <MESSAGE value="Hopefully made hyperspy import (now at beginning of pyramid package) work! Added PyCharm files! Commit before Reformatting with PyCharms!" /> - <MESSAGE value="New branch: new signals for holographic analysis!" /> - <MESSAGE value="Commit after Reformatting with PyCharms!" /> - <MESSAGE value="Added fieldconverter module! fieldconverter: methods to convert M to A to B magdata: a bit more parameters for quiver_plot3d(), added contour_plot3d() phasemapper: pm() extended for different projections (not just simple) kernel: u and v switched (now named after the unit magnetization direction, which makes much more sense)" /> - <MESSAGE value="Refactoring: Replaced MagData with VectorData and added ScalarData class (and common superclass FieldData). magnitude is now called field (which is more appropriate) projector now uses FieldData to process both vector and scalar data (foundation was in place before)" /> - <MESSAGE value="Updated long overdue scripts to work with new layout and refactoring!" /> - <option name="LAST_COMMIT_MESSAGE" value="Updated long overdue scripts to work with new layout and refactoring!" /> - <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" /> - <option name="REARRANGE_BEFORE_PROJECT_COMMIT" value="true" /> - <option name="CHANGE_BROWSER_SETTINGS"> - <map> - <entry key="hg4idea"> - <value> - <ChangeBrowserSettings> - <option name="DATE_BEFORE" /> - <option name="DATE_AFTER" /> - </ChangeBrowserSettings> - </value> - </entry> - </map> - </option> - </component> - <component name="XDebuggerManager"> - <breakpoint-manager> - <breakpoints> - <line-breakpoint enabled="true" type="python-line"> - <url>file://$PROJECT_DIR$/pyramid/phasemap.py</url> - <line>157</line> - <option name="timeStamp" value="69" /> - </line-breakpoint> - </breakpoints> - <breakpoints-dialog> - <breakpoints-dialog /> - </breakpoints-dialog> - <default-breakpoints> - <breakpoint type="python-exception"> - <properties notifyOnTerminate="true" exception="BaseException"> - <option name="notifyOnTerminate" value="true" /> - </properties> - </breakpoint> - </default-breakpoints> - <option name="time" value="72" /> - </breakpoint-manager> - <watches-manager /> - </component> - <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_core_shell_disc.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.567297"> - <caret line="30" column="0" selection-start-line="30" selection-start-column="0" selection-end-line="30" selection-end-column="0" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_flat_vortex_slab.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.4916574"> - <caret line="26" column="0" selection-start-line="26" selection-start-column="0" selection-end-line="26" selection-end-column="0" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_core_shell_sphere.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.4538376"> - <caret line="24" column="58" selection-start-line="24" selection-start-column="58" selection-end-line="24" selection-end-column="58" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_vortex_disc.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.3214683"> - <caret line="17" column="17" selection-start-line="17" selection-start-column="17" selection-end-line="17" selection-end-column="17" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_horseshoe.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.55314535"> - <caret line="30" column="0" selection-start-line="30" selection-start-column="0" selection-end-line="30" selection-end-column="0" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_disc.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.46095446"> - <caret line="25" column="0" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_pixel.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.29501083"> - <caret line="16" column="27" selection-start-line="16" selection-start-column="27" selection-end-line="16" selection-end-column="27" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_slab.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.31344903"> - <caret line="17" column="6" selection-start-line="17" selection-start-column="6" selection-end-line="17" selection-end-column="6" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/magdata/magcreator/create_homog_sphere.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.51626897"> - <caret line="28" column="0" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../HyperSpy/setup.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/setup.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.63123643"> - <caret line="149" column="41" selection-start-line="149" selection-start-column="41" selection-end-line="149" selection-end-column="41" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://C:/Anaconda2/Lib/site-packages/PIL/Image.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="1301" column="0" selection-start-line="1301" selection-start-column="0" selection-end-line="1301" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/gui/phasemap_creator.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.71563345"> - <caret line="264" column="0" selection-start-line="264" selection-start-column="0" selection-end-line="264" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/version.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.11258278"> - <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/regularisator.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.36589405"> - <caret line="13" column="26" selection-start-line="13" selection-start-column="26" selection-end-line="13" selection-end-column="26" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/reconstruction.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.1768202"> - <caret line="7" column="72" selection-start-line="7" selection-start-column="72" selection-end-line="7" selection-end-column="72" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/ramp.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.43965518"> - <caret line="18" column="73" selection-start-line="18" selection-start-column="73" selection-end-line="18" selection-end-column="73" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/quaternion.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.43965518"> - <caret line="18" column="22" selection-start-line="18" selection-start-column="22" selection-end-line="18" selection-end-column="22" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/projector.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.418637"> - <caret line="23" column="0" selection-start-line="23" selection-start-column="0" selection-end-line="23" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/phasemapper.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.3678161"> - <caret line="264" column="57" selection-start-line="264" selection-start-column="57" selection-end-line="264" selection-end-column="57" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/magcreator.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.5354659"> - <caret line="296" column="0" selection-start-line="296" selection-start-column="0" selection-end-line="296" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/logging.ini"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.26008344"> - <caret line="11" column="25" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/forwardmodel.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.25173852"> - <caret line="46" column="0" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/fielddata.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.472879"> - <caret line="983" column="79" selection-start-line="983" selection-start-column="79" selection-end-line="983" selection-end-column="79" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/fieldconverter.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.44923505"> - <caret line="91" column="27" selection-start-line="91" selection-start-column="27" selection-end-line="91" selection-end-column="27" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/fft.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.40194714"> - <caret line="17" column="14" selection-start-line="17" selection-start-column="14" selection-end-line="17" selection-end-column="14" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/dataset.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.16037735"> - <caret line="7" column="14" selection-start-line="7" selection-start-column="14" selection-end-line="7" selection-end-column="14" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/costfunction.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.34366578"> - <caret line="15" column="0" selection-start-line="15" selection-start-column="0" selection-end-line="15" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/config.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.3207547"> - <caret line="14" column="4" selection-start-line="14" selection-start-column="4" selection-end-line="14" selection-end-column="4" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/colormap.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.29784366"> - <caret line="13" column="24" selection-start-line="13" selection-start-column="24" selection-end-line="13" selection-end-column="24" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/analytic.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.5269542"> - <caret line="23" column="0" selection-start-line="23" selection-start-column="0" selection-end-line="23" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/__init__.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.56469005"> - <caret line="60" column="17" selection-start-line="60" selection-start-column="17" selection-end-line="60" selection-end-column="17" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/diagnostics.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.20281996"> - <caret line="11" column="37" selection-start-line="11" selection-start-column="37" selection-end-line="11" selection-end-column="37" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/scripts/gui/mag_slicer.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.2624729"> - <caret line="213" column="42" selection-start-line="213" selection-start-column="42" selection-end-line="213" selection-end-column="42" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/example_joern.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/patrick_nanowire_reconstruction.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/patrick_nanowire_reconstruction_simulation.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/result.pickle"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/rueffner_file.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/collaborations/vtk_conversion_nanowire_full.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruct_random_pixels.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruction_linear_test.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruction_linear_test_batch.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/reconstruction/reconstruction_sparse_cg_singular_values.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_kernels.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_methods.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$APPLICATION_HOME_DIR$/helpers/pydev/pydev_run_in_console.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="28" column="0" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../HyperSpy/hyperspy/io.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.33294255"> - <caret line="343" column="0" selection-start-line="343" selection-start-column="0" selection-end-line="343" selection-end-column="0" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/phasemap.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="154" column="16" selection-start-line="154" selection-start-column="16" selection-end-line="154" selection-end-column="16" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/pyramid/kernel.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0"> - <caret line="112" column="43" selection-start-line="112" selection-start-column="43" selection-end-line="112" selection-end-column="43" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../Script-Vault/scripts - Alt/test methods/compare_pixel_fields.py"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.37866354"> - <caret line="79" column="31" selection-start-line="79" selection-start-column="31" selection-end-line="79" selection-end-column="31" /> - <folding /> - </state> - </provider> - </entry> - </component> - <component name="hg4idea.settings"> - <option name="CHECK_INCOMING_OUTGOING" value="true" /> - <option name="RECENT_HG_ROOT_PATH" value="$PROJECT_DIR$/../Script-Vault" /> - <option name="ROOT_SYNC" value="DONT_SYNC" /> - </component> - <component name="masterDetails"> - <states> - <state key="ScopeChooserConfigurable.UI"> - <settings> - <last-edited>gui</last-edited> - <splitter-proportions> - <option name="proportions"> - <list> - <option value="0.2" /> - </list> - </option> - </splitter-proportions> - <order> - <scope name="__init__" /> - <scope name="*.c" /> - <scope name="scripts" /> - <scope name="gui" /> - </order> - </settings> - </state> - </states> - </component> -</project> \ No newline at end of file diff --git a/pyramid/__init__.py b/pyramid/__init__.py index d75f904ee5e276bfb608bb5142d37a14049fc6ea..48789f455e8d02ca767dd229909c66e213594533 100644 --- a/pyramid/__init__.py +++ b/pyramid/__init__.py @@ -48,13 +48,6 @@ numcore """ -import logging -_log = logging.getLogger(__name__) -try: # Try importing HyperSpy (here because otherwise API Errors might occur): - import hyperspy.api -except ImportError: - _log.error('Could not load hyperspy package!') - from . import analytic from . import magcreator from . import reconstruction @@ -92,6 +85,8 @@ from .config import * from .version import version as __version__ from .version import hg_revision as __hg_revision__ +import logging +_log = logging.getLogger(__name__) _log.info("Starting Pyramid V{} HG{}".format(__version__, __hg_revision__)) del logging diff --git a/pyramid/colormap.py b/pyramid/colormap.py index 55543faf5eeb24b80073f9c6c5fcdc1dd2e50bce..73147b778ac6cbf59c59339bdc030427a67d6dd5 100644 --- a/pyramid/colormap.py +++ b/pyramid/colormap.py @@ -83,7 +83,7 @@ class DirectionalColormap(colors.LinearSegmentedColormap): def __init__(self, inverted=False): self._log.debug('Calling __create_directional_colormap') cdict = self.CDICT_INV if inverted else self.CDICT - super(DirectionalColormap, self).__init__('directional_colormap', cdict, N=256) + super().__init__('directional_colormap', cdict, N=256) self._log.debug('Created ' + str(self)) @classmethod @@ -250,5 +250,5 @@ class TransparentColormap(colors.LinearSegmentedColormap): blue = [(0., 0., b), (1., b, 1.)] alpha = [(0., 0., alpha_range[0]), (1., alpha_range[1], 1.)] cdict = {'red': red, 'green': green, 'blue': blue, 'alpha': alpha} - super(TransparentColormap, self).__init__('transparent_colormap', cdict, N=256) + super().__init__('transparent_colormap', cdict, N=256) self._log.debug('Created ' + str(self)) diff --git a/pyramid/fft.py b/pyramid/fft.py index f81d867cdf94589cb1aa5d345c6fbdddc2391402..7ca01fc43f9be13ed7df09b9c6806162b07c8ea5 100644 --- a/pyramid/fft.py +++ b/pyramid/fft.py @@ -11,10 +11,8 @@ FFT operations. """ -try: - import cPickle as pickle -except ImportError: - import pickle + +import pickle import logging import os @@ -22,28 +20,19 @@ import numpy as np from pyramid.config import NTHREADS -# pyFFTW depends on this -# try: -# from collections import Counter -# except ImportError: -# from collections_python27 import Counter -# import collections -# -# collections.Counter = Counter +_log = logging.getLogger(__name__) try: import pyfftw - BACKEND = 'fftw' except ImportError: pyfftw = None BACKEND = 'numpy' - print("pyFFTW module not found. Using numpy implementation.") + _log.info('pyFFTW module not found. Using numpy implementation.') __all__ = ['PLANS', 'FLOAT', 'COMPLEX', 'dump_wisdom', 'load_wisdom', # analysis:ignore 'zeros', 'empty', 'configure_backend', 'fftn', 'ifftn', 'rfftn', 'irfftn', 'rfftn_adj', 'irfftn_adj'] -_log = logging.getLogger(__name__) class FFTWCache(object): @@ -384,6 +373,12 @@ def configure_backend(backend): # On import: +ifftn = None +fftn = None +rfftn = None +irfftn = None +rfftn_adj = None +irfftn_adj = None if pyfftw is not None: configure_backend('fftw') else: diff --git a/pyramid/fielddata.py b/pyramid/fielddata.py index af6881e2331eb0f2998feca4c6b33a8227835ed0..e08aa9f1b68e6ae4b65338d1811380abb66fd264 100644 --- a/pyramid/fielddata.py +++ b/pyramid/fielddata.py @@ -6,19 +6,18 @@ from __future__ import division -from scipy.ndimage.interpolation import zoom - -from pyramid import fft -from pyramid.colormap import DirectionalColormap - +import abc import logging import os -from abc import ABCMeta, abstractmethod from numbers import Number import numpy as np from matplotlib import pyplot as plt from matplotlib.ticker import MaxNLocator +from scipy.ndimage.interpolation import zoom + +from pyramid import fft +from pyramid.colormap import DirectionalColormap _log = logging.getLogger(__name__) try: # Try importing HyperSpy: @@ -30,7 +29,7 @@ except ImportError: __all__ = ['VectorData', 'ScalarData'] -class FieldData(object): +class FieldData(object, metaclass=abc.ABCMeta): """Class for storing field data. Abstract base class for the representatio of magnetic or electric fields (see subclasses). @@ -50,7 +49,6 @@ class FieldData(object): """ - __metaclass__ = ABCMeta _log = logging.getLogger(__name__ + '.FieldData') @property @@ -231,7 +229,7 @@ class FieldData(object): mlab.orientation_axes() return plot - @abstractmethod + @abc.abstractmethod def scale_down(self, n): """Scale down the field distribution by averaging over two pixels along each axis. @@ -252,7 +250,7 @@ class FieldData(object): """ pass - @abstractmethod + @abc.abstractmethod def scale_up(self, n, order): """Scale up the field distribution using spline interpolation of the requested order. @@ -275,7 +273,7 @@ class FieldData(object): """ pass - @abstractmethod + @abc.abstractmethod def get_vector(self, mask): """Returns the field as a vector, specified by a mask. @@ -292,7 +290,7 @@ class FieldData(object): """ pass - @abstractmethod + @abc.abstractmethod def set_vector(self, vector, mask): """Set the field of the masked pixels to the values specified by `vector`. @@ -310,7 +308,7 @@ class FieldData(object): """ pass - @abstractmethod + @abc.abstractmethod def to_signal(self): """Convert :class:`~.FieldData` data into a HyperSpy signal. @@ -326,7 +324,7 @@ class FieldData(object): """ pass - @abstractmethod + @abc.abstractmethod def save_to_hdf5(self, filename, *args, **kwargs): """Save field data in a file with HyperSpys HDF5-format. @@ -365,11 +363,6 @@ class VectorData(FieldData): """ _log = logging.getLogger(__name__ + '.VectorData') - def __init__(self, a, field): - self._log.debug('Calling __init__') - super(VectorData, self).__init__(a, field) - self._log.debug('Created ' + str(self)) - def scale_down(self, n=1): """Scale down the field distribution by averaging over two pixels along each axis. @@ -389,7 +382,7 @@ class VectorData(FieldData): """ self._log.debug('Calling scale_down') - assert n > 0 and isinstance(n, (int, long)), 'n must be a positive integer!' + assert n > 0 and isinstance(n, int), 'n must be a positive integer!' self.a *= 2 ** n for t in range(n): # Pad if necessary: @@ -422,8 +415,8 @@ class VectorData(FieldData): Acts in place and changes dimensions and grid spacing accordingly. """ self._log.debug('Calling scale_up') - assert n > 0 and isinstance(n, (int, long)), 'n must be a positive integer!' - assert 5 > order >= 0 and isinstance(order, (int, long)), \ + assert n > 0 and isinstance(n, int), 'n must be a positive integer!' + assert 5 > order >= 0 and isinstance(order, int), \ 'order must be a positive integer between 0 and 5!' self.a /= 2 ** n self.field = np.array((zoom(self.field[0], zoom=2 ** n, order=order), @@ -1056,11 +1049,6 @@ class ScalarData(FieldData): """ _log = logging.getLogger(__name__ + '.ScalarData') - def __init__(self, a, field): - self._log.debug('Calling __init__') - super(ScalarData, self).__init__(a, field) - self._log.debug('Created ' + str(self)) - def scale_down(self, n=1): """Scale down the field distribution by averaging over two pixels along each axis. @@ -1080,7 +1068,7 @@ class ScalarData(FieldData): """ self._log.debug('Calling scale_down') - assert n > 0 and isinstance(n, (int, long)), 'n must be a positive integer!' + assert n > 0 and isinstance(n, int), 'n must be a positive integer!' self.a *= 2 ** n for t in range(n): # Pad if necessary: @@ -1112,8 +1100,8 @@ class ScalarData(FieldData): Acts in place and changes dimensions and grid spacing accordingly. """ self._log.debug('Calling scale_up') - assert n > 0 and isinstance(n, (int, long)), 'n must be a positive integer!' - assert 5 > order >= 0 and isinstance(order, (int, long)), \ + assert n > 0 and isinstance(n, int), 'n must be a positive integer!' + assert 5 > order >= 0 and isinstance(order, int), \ 'order must be a positive integer between 0 and 5!' self.a /= 2 ** n self.field = zoom(self.field, zoom=2 ** n, order=order) diff --git a/pyramid/forwardmodel.py b/pyramid/forwardmodel.py index eca8aca8a9b60220692746db9011a2627127a8e3..e09d39ad596e722b0804513874267cdb7b74f9bb 100644 --- a/pyramid/forwardmodel.py +++ b/pyramid/forwardmodel.py @@ -5,7 +5,7 @@ """This module provides the :class:`~.ForwardModel` class which represents a strategy to map a threedimensional magnetization distribution onto a two-dimensional phase map.""" -from __future__ import division, print_function +from __future__ import division import logging import multiprocessing as mp @@ -188,7 +188,7 @@ class DistributedForwardModel(ForwardModel): def __init__(self, data_set, ramp_order=None, nprocs=1): # Evoke super constructor to set up the normal ForwardModel: - super(DistributedForwardModel, self).__init__(data_set, ramp_order) + super().__init__(data_set, ramp_order) # Initialize multirocessing specific stuff: self.nprocs = nprocs img_per_proc = np.ceil(self.data_set.count / self.nprocs).astype(np.int) diff --git a/pyramid/kernel.py b/pyramid/kernel.py index 1d5a17f0dd9ac84392f45cd219f5ac08d6c67ce8..6ff2ac206ec049fb1a76a2ccebb9a0b40b65ed49 100644 --- a/pyramid/kernel.py +++ b/pyramid/kernel.py @@ -5,8 +5,6 @@ """This module provides the :class:`~.Kernel` class, representing the phase contribution of one single magnetized pixel.""" -from __future__ import print_function - import logging import numpy as np @@ -89,6 +87,10 @@ class Kernel(object): self.slice_mag = (slice(0, dim_uv[0]), # Magnetization is padded on the far end! slice(0, dim_uv[1])) # (Phase cutout is shifted as listed above) # Calculate kernel (single pixel phase): + # [M_0] = [PHI_0 / µ_0] = Tm² / N/A² = N/Am * A²/N = A/m + # --> This is the magnetization, not the magnetic moment (A/m * m³ = Am²)! + # [b_0] = [µ_0] * [M_0] = A/m * N/A² = N/Am = T + # [coeff] = [b_0 * a² / (2*PHI_0)] = T * m² / Tm² = 1 --> without unit (phase)! coeff = b_0 * a ** 2 / (2 * PHI_0) # Minus is gone because of negative z-direction v_dim, u_dim = dim_uv u = np.linspace(-(u_dim - 1), u_dim - 1, num=2 * u_dim - 1) @@ -141,7 +143,7 @@ class Kernel(object): None """ - self._log.debug('Calling print_info') + self._log.debug('Calling log_info') print('Shape of the FOV :', self.dim_uv) print('Shape of the Kernel:', self.dim_kern) print('Zero-padded shape :', self.dim_pad) diff --git a/pyramid/magcreator.py b/pyramid/magcreator.py index 20d31d4dc8f06ab7557352771927a3978807d26e..e31b44ead98953b98511852bfd70bece950c2774 100644 --- a/pyramid/magcreator.py +++ b/pyramid/magcreator.py @@ -28,7 +28,7 @@ __all__ = ['Shapes', 'create_mag_dist_homog', 'create_mag_dist_vortex'] _log = logging.getLogger(__name__) -class Shapes(object): +class Shapes(object, metaclass=abc.ABCMeta): """Abstract class containing functions for generating magnetic shapes. The :class:`~.Shapes` class is a collection of some methods that return a 3-dimensional @@ -38,11 +38,10 @@ class Shapes(object): """ - __metaclass__ = abc.ABCMeta _log = logging.getLogger(__name__ + '.Shapes') - @classmethod - def slab(cls, dim, center, width): + @staticmethod + def slab(dim, center, width): """Create the shape of a slab. Parameters @@ -60,7 +59,7 @@ class Shapes(object): The magnetic shape as a 3D-array with values between 1 and 0. """ - cls._log.debug('Calling slab') + _log.debug('Calling slab') assert np.shape(dim) == (3,), 'Parameter dim has to be a tuple of length 3!' assert np.shape(center) == (3,), 'Parameter center has to be a tuple of length 3!' assert np.shape(width) == (3,), 'Parameter width has to be a tuple of length 3!' @@ -70,8 +69,8 @@ class Shapes(object): zz_shape = np.where(abs(zz - center[0]) <= width[0] / 2, True, False) return np.logical_and(np.logical_and(xx_shape, yy_shape), zz_shape) - @classmethod - def disc(cls, dim, center, radius, height, axis='z'): + @staticmethod + def disc(dim, center, radius, height, axis='z'): """Create the shape of a cylindrical disc in x-, y-, or z-direction. Parameters @@ -93,7 +92,7 @@ class Shapes(object): The magnetic shape as a 3D-array with values between 1 and 0. """ - cls._log.debug('Calling disc') + _log.debug('Calling disc') assert np.shape(dim) == (3,), 'Parameter dim has to be a a tuple of length 3!' assert np.shape(center) == (3,), 'Parameter center has to be a a tuple of length 3!' assert radius > 0 and np.shape(radius) == (), 'Radius has to be a positive scalar value!' @@ -114,8 +113,8 @@ class Shapes(object): return np.logical_and(np.where(np.hypot(uu, vv) <= radius, True, False), np.where(abs(ww) <= height / 2, True, False)) - @classmethod - def ellipse(cls, dim, center, width, height, axis='z'): + @staticmethod + def ellipse(dim, center, width, height, axis='z'): """Create the shape of an elliptical cylinder in x-, y-, or z-direction. Parameters @@ -137,7 +136,7 @@ class Shapes(object): The magnetic shape as a 3D-array with values between 1 and 0. """ - cls._log.debug('Calling ellipse') + _log.debug('Calling ellipse') assert np.shape(dim) == (3,), 'Parameter dim has to be a a tuple of length 3!' assert np.shape(center) == (3,), 'Parameter center has to be a a tuple of length 3!' assert np.shape(width) == (2,), 'Parameter width has to be a a tuple of length 2!' @@ -159,8 +158,8 @@ class Shapes(object): return np.logical_and(np.where(distance <= 1, True, False), np.where(abs(ww) <= height / 2, True, False)) - @classmethod - def sphere(cls, dim, center, radius): + @staticmethod + def sphere(dim, center, radius): """Create the shape of a sphere. Parameters @@ -178,7 +177,7 @@ class Shapes(object): The magnetic shape as a 3D-array with values between 1 and 0. """ - cls._log.debug('Calling sphere') + _log.debug('Calling sphere') assert np.shape(dim) == (3,), 'Parameter dim has to be a a tuple of length 3!' assert np.shape(center) == (3,), 'Parameter center has to be a a tuple of length 3!' assert radius > 0 and np.shape(radius) == (), 'Radius has to be a positive scalar value!' @@ -186,8 +185,8 @@ class Shapes(object): distance = np.sqrt((xx - center[2]) ** 2 + (yy - center[1]) ** 2 + (zz - center[0]) ** 2) return np.where(distance <= radius, True, False) - @classmethod - def ellipsoid(cls, dim, center, width): + @staticmethod + def ellipsoid(dim, center, width): """Create the shape of an ellipsoid. Parameters @@ -205,7 +204,7 @@ class Shapes(object): The magnetic shape as a 3D-array with values between 1 and 0. """ - cls._log.debug('Calling ellipsoid') + _log.debug('Calling ellipsoid') assert np.shape(dim) == (3,), 'Parameter dim has to be a a tuple of length 3!' assert np.shape(center) == (3,), 'Parameter center has to be a a tuple of length 3!' assert np.shape(width) == (3,), 'Parameter width has to be a a tuple of length 3!' @@ -215,8 +214,8 @@ class Shapes(object): + ((zz - center[0]) / (width[0] / 2)) ** 2) return np.where(distance <= 1, True, False) - @classmethod - def filament(cls, dim, pos, axis='y'): + @staticmethod + def filament(dim, pos, axis='y'): """Create the shape of a filament. Parameters @@ -236,7 +235,7 @@ class Shapes(object): The magnetic shape as a 3D-array with values between 1 and 0. """ - cls._log.debug('Calling filament') + _log.debug('Calling filament') assert np.shape(dim) == (3,), 'Parameter dim has to be a tuple of length 3!' assert np.shape(pos) == (2,), 'Parameter pos has to be a tuple of length 2!' assert axis in {'z', 'y', 'x'}, 'Axis has to be x, y or z (as a string)!' @@ -249,8 +248,8 @@ class Shapes(object): mag_shape[pos[0], pos[1], :] = 1 return mag_shape - @classmethod - def pixel(cls, dim, pixel): + @staticmethod + def pixel(dim, pixel): """Create the shape of a single pixel. Parameters @@ -266,7 +265,7 @@ class Shapes(object): The magnetic shape as a 3D-array with values between 1 and 0. """ - cls._log.debug('Calling pixel') + _log.debug('Calling pixel') assert np.shape(dim) == (3,), 'Parameter dim has to be a tuple of length 3!' assert np.shape(pixel) == (3,), 'Parameter pixel has to be a tuple of length 3!' mag_shape = np.zeros(dim) diff --git a/pyramid/phasemap.py b/pyramid/phasemap.py index 5cd87598b900f5d1d2366a7f6a2e9b2596c3dfe7..7ba0d7971ec6a54335550022925728094a293fec 100644 --- a/pyramid/phasemap.py +++ b/pyramid/phasemap.py @@ -289,7 +289,7 @@ class PhaseMap(object): """ self._log.debug('Calling scale_down') - assert n > 0 and isinstance(n, (int, long)), 'n must be a positive integer!' + assert n > 0 and isinstance(n, int), 'n must be a positive integer!' self.a *= 2 ** n for t in range(n): # Pad if necessary: @@ -326,8 +326,8 @@ class PhaseMap(object): """ self._log.debug('Calling scale_up') - assert n > 0 and isinstance(n, (int, long)), 'n must be a positive integer!' - assert 5 > order >= 0 and isinstance(order, (int, long)), \ + assert n > 0 and isinstance(n, int), 'n must be a positive integer!' + assert 5 > order >= 0 and isinstance(order, int), \ 'order must be a positive integer between 0 and 5!' self.a /= 2 ** n self.phase = zoom(self.phase, zoom=2 ** n, order=order) diff --git a/pyramid/phasemapper.py b/pyramid/phasemapper.py index b07345a1defcd64014170e8b95114952e251f555..a94fb3cc5653b0b1446c5fa3ac1323051467122c 100644 --- a/pyramid/phasemapper.py +++ b/pyramid/phasemapper.py @@ -30,7 +30,7 @@ Q_E = 1.602E-19 # electron charge in C C = 2.998E8 # speed of light in m/s -class PhaseMapper(object): +class PhaseMapper(object, metaclass=abc.ABCMeta): """Abstract base class for the phase calculation from a 2-dimensional distribution. The :class:`~.PhaseMapper-` class represents a strategy for the phasemapping of a @@ -42,7 +42,6 @@ class PhaseMapper(object): """ - __metaclass__ = abc.ABCMeta _log = logging.getLogger(__name__ + '.PhaseMapper') @abc.abstractmethod @@ -261,11 +260,11 @@ class PhaseMapperRDRC(PhaseMapper): for j in range(dim_uv[0]): for i in range(dim_uv[1]): v_phase = v_phi[dim_uv[0] - 1 - j:(2 * dim_uv[0] - 1) - j, - dim_uv[1] - 1 - i:(2 * dim_uv[1] - 1) - i] + dim_uv[1] - 1 - i:(2 * dim_uv[1] - 1) - i] if abs(v_mag[j, i]) > self.threshold: phase += u_mag[j, i] * v_phase u_phase = u_phi[dim_uv[0] - 1 - j:(2 * dim_uv[0] - 1) - j, - dim_uv[1] - 1 - i:(2 * dim_uv[1] - 1) - i] + dim_uv[1] - 1 - i:(2 * dim_uv[1] - 1) - i] if abs(u_mag[j, i]) > self.threshold: phase -= v_mag[j, i] * u_phase # Return the phase: diff --git a/pyramid/projector.py b/pyramid/projector.py index 986c18f962e140d4d8b38125091fc8cc85953def..30e2f5efa23f667499ed896a5307408906dd1fa0 100644 --- a/pyramid/projector.py +++ b/pyramid/projector.py @@ -22,7 +22,7 @@ from pyramid.quaternion import Quaternion __all__ = ['RotTiltProjector', 'XTiltProjector', 'YTiltProjector', 'SimpleProjector'] -class Projector(object): +class Projector(object, metaclass=abc.ABCMeta): """Abstract base class representing a projection function. The :class:`~.Projector` class represents a projection function for a 3-dimensional @@ -56,7 +56,6 @@ class Projector(object): """ - __metaclass__ = abc.ABCMeta _log = logging.getLogger(__name__ + '.Projector') @abc.abstractmethod @@ -301,7 +300,7 @@ class RotTiltProjector(Projector): weights = csr_matrix(coo_matrix((data, (rows, columns)), shape=shape)) # Calculate coefficients by rotating unity matrix (unit vectors, (x,y,z)): coeff = quat.matrix[:2, :].dot(np.eye(3)) - super(RotTiltProjector, self).__init__(dim, dim_uv, weights, coeff) + super().__init__(dim, dim_uv, weights, coeff) self._log.debug('Created ' + str(self)) @staticmethod @@ -420,7 +419,7 @@ class XTiltProjector(Projector): self.sparsity = 1. - len(data) / np.prod(shape, dtype=np.float) weight = csr_matrix(coo_matrix((np.tile(data, dim_rot), (rows, columns)), shape=shape)) coeff = [[1, 0, 0], [0, np.cos(tilt), np.sin(tilt)]] - super(XTiltProjector, self).__init__(dim, dim_uv, weight, coeff) + super().__init__(dim, dim_uv, weight, coeff) self._log.debug('Created ' + str(self)) @staticmethod @@ -537,7 +536,7 @@ class YTiltProjector(Projector): self.sparsity = 1. - len(data) / np.prod(shape, dtype=np.float) weight = csr_matrix(coo_matrix((np.tile(data, dim_rot), (rows, columns)), shape=shape)) coeff = [[np.cos(tilt), 0, np.sin(tilt)], [0, 1, 0]] - super(YTiltProjector, self).__init__(dim, dim_uv, weight, coeff) + super().__init__(dim, dim_uv, weight, coeff) self._log.debug('Created ' + str(self)) @staticmethod @@ -664,7 +663,7 @@ class SimpleProjector(Projector): shape = (np.prod(dim_uv), np.prod(dim)) self.sparsity = 1. - len(data) / np.prod(shape, dtype=np.float) weight = csr_matrix((data, indices, indptr), shape=shape) - super(SimpleProjector, self).__init__(dim, dim_uv, weight, coeff) + super().__init__(dim, dim_uv, weight, coeff) self._log.debug('Created ' + str(self)) def get_info(self, verbose=False): diff --git a/pyramid/reconstruction.py b/pyramid/reconstruction.py index 8fe34f1862749fca4ec595e05e0609a6cdaf6390..166242e9dfda5e15c43b49966bfe10c7436edadc 100644 --- a/pyramid/reconstruction.py +++ b/pyramid/reconstruction.py @@ -43,9 +43,9 @@ def optimize_linear(costfunction, max_iter=None): """ import jutil.cg as jcg _log.debug('Calling optimize_linear') - _log.info('Cost before optimization: {}'.format(costfunction(np.zeros(costfunction.n)))) + _log.info('Cost before optimization: {:.3e}'.format(costfunction(np.zeros(costfunction.n)))) x_opt = jcg.conj_grad_minimize(costfunction, max_iter=max_iter).x - _log.info('Cost after optimization: {}'.format(costfunction(x_opt))) + _log.info('Cost after optimization: {:.3e}'.format(costfunction(x_opt))) # Cut ramp parameters if necessary (this also saves the final parameters in the ramp class!): x_opt = costfunction.fwd_model.ramp.extract_ramp_params(x_opt) # Create and return fitting VectorData object: diff --git a/pyramid/regularisator.py b/pyramid/regularisator.py index 0952cbf0ccc0173e537f336005c6e089775d4bf8..335cd36659c902769d4166f28f369606b13d05fc 100644 --- a/pyramid/regularisator.py +++ b/pyramid/regularisator.py @@ -18,7 +18,7 @@ __all__ = ['NoneRegularisator', 'ZeroOrderRegularisator', 'FirstOrderRegularisat 'ComboRegularisator'] -class Regularisator(object): +class Regularisator(object, metaclass=abc.ABCMeta): """Class for providing a regularisation term which implements additional constraints. Represents a certain constraint for the 3D magnetization distribution whose cost is to minimize @@ -40,7 +40,6 @@ class Regularisator(object): """ - __metaclass__ = abc.ABCMeta _log = logging.getLogger(__name__ + '.Regularisator') @abc.abstractmethod @@ -150,7 +149,7 @@ class ComboRegularisator(Regularisator): def __init__(self, reg_list): self._log.debug('Calling __init__') self.reg_list = reg_list - super(ComboRegularisator, self).__init__(norm=None, lam=None) + super().__init__(norm=None, lam=None) self._log.debug('Created ' + str(self)) def __call__(self, x): @@ -246,7 +245,7 @@ class NoneRegularisator(Regularisator): self.norm = None self.lam = 0 self.add_params = None - super(NoneRegularisator, self).__init__(norm=None, lam=None) + super().__init__(norm=None, lam=None) self._log.debug('Created ' + str(self)) def __call__(self, x): @@ -324,19 +323,22 @@ class ZeroOrderRegularisator(Regularisator): Regularisation parameter determining the weighting between measurements and regularisation. p: int, optional Order of the norm (default: 2, which means a standard L2-norm). + add_params : int + Number of additional parameters which are not used in the regularisation. Used to cut + the input vector into the appropriate size. """ _log = logging.getLogger(__name__ + '.ZeroOrderRegularisator') - def __init__(self, _=None, lam=1E-4, p=2, add_params=None): + def __init__(self, _=None, lam=1E-4, p=2, add_params=0): self._log.debug('Calling __init__') self.p = p if p == 2: norm = jnorm.L2Square() else: norm = jnorm.LPPow(p, 1e-12) - super(ZeroOrderRegularisator, self).__init__(norm, lam, add_params) + super().__init__(norm, lam, add_params) self._log.debug('Created ' + str(self)) @@ -356,10 +358,13 @@ class FirstOrderRegularisator(Regularisator): Regularisation parameter determining the weighting between measurements and regularisation. p: int, optional Order of the norm (default: 2, which means a standard L2-norm). + add_params : int + Number of additional parameters which are not used in the regularisation. Used to cut + the input vector into the appropriate size. """ - def __init__(self, mask, lam=1E-4, p=2, add_params=None): + def __init__(self, mask, lam=1E-4, p=2, add_params=0): self.p = p D0 = jdiff.get_diff_operator(mask, 0, 3) D1 = jdiff.get_diff_operator(mask, 1, 3) @@ -369,5 +374,5 @@ class FirstOrderRegularisator(Regularisator): norm = jnorm.WeightedL2Square(D) else: norm = jnorm.WeightedTV(jnorm.LPPow(p, 1e-12), D, [D0.shape[0], D.shape[0]]) - super(FirstOrderRegularisator, self).__init__(norm, lam, add_params) + super().__init__(norm, lam, add_params) self._log.debug('Created ' + str(self)) diff --git a/pyramid/tests/test_analytic.py b/pyramid/tests/test_analytic.py index 401a4f225d7aa13d1a616ac489c158a60abcbe8d..9fd470419dc094ac2ff0d398a53298067e7e666b 100644 --- a/pyramid/tests/test_analytic.py +++ b/pyramid/tests/test_analytic.py @@ -26,7 +26,8 @@ class TestCaseAnalytic(unittest.TestCase): width = (self.dim[0] / 2, self.dim[1] / 2, self.dim[2] / 2) phase = an.phase_mag_slab(self.dim, self.a, self.phi, self.center, width).phase reference = np.load(os.path.join(self.path, 'ref_phase_slab.npy')) - assert_allclose(phase, reference, err_msg='Unexpected behavior in phase_mag_slab()') + assert_allclose(phase, reference, atol=1E-10, + err_msg='Unexpected behavior in phase_mag_slab()') def test_phase_mag_disc(self): """Test of the phase_mag_disc method.""" @@ -34,15 +35,16 @@ class TestCaseAnalytic(unittest.TestCase): height = self.dim[2] / 2 phase = an.phase_mag_disc(self.dim, self.a, self.phi, self.center, radius, height).phase reference = np.load(os.path.join(self.path, 'ref_phase_disc.npy')) - assert_allclose(phase, reference, err_msg='Unexpected behavior in phase_mag_disc()') + assert_allclose(phase, reference, atol=1E-10, + err_msg='Unexpected behavior in phase_mag_disc()') def test_phase_mag_sphere(self): """Test of the phase_mag_sphere method.""" radius = self.dim[2] / 4 phase = an.phase_mag_sphere(self.dim, self.a, self.phi, self.center, radius).phase reference = np.load(os.path.join(self.path, 'ref_phase_sphere.npy')) - assert_allclose(phase, reference, err_msg='Unexpected behavior in phase_mag_sphere()', - atol=1E-10) + assert_allclose(phase, reference, atol=1E-10, + err_msg='Unexpected behavior in phase_mag_sphere()') def test_phase_mag_vortex(self): """Test of the phase_mag_vortex method.""" @@ -50,7 +52,8 @@ class TestCaseAnalytic(unittest.TestCase): height = self.dim[2] / 2 phase = an.phase_mag_vortex(self.dim, self.a, self.center, radius, height).phase reference = np.load(os.path.join(self.path, 'ref_phase_vort.npy')) - assert_allclose(phase, reference, err_msg='Unexpected behavior in phase_mag_vortex()') + assert_allclose(phase, reference, atol=1E-10, + err_msg='Unexpected behavior in phase_mag_vortex()') if __name__ == '__main__': diff --git a/pyramid/tests/test_dataset.py b/pyramid/tests/test_dataset.py index 8cb02abd8a14b1440216f7824eea59a0ad7c2422..115eb71d4f5f973bc8934017df14cf25ae3a539a 100644 --- a/pyramid/tests/test_dataset.py +++ b/pyramid/tests/test_dataset.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """Testcase for the dataset module""" -from __future__ import print_function - import os import unittest diff --git a/pyramid/version.py b/pyramid/version.py index e047f287248354ed17d57fd98906adc2637a80a8..2595067adb0ececd385daafea1438730c625f255 100644 --- a/pyramid/version.py +++ b/pyramid/version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- -"""This file is generated automatically by the Pyramid `setup.pr`""" -version = '0.1.0-dev' -hg_revision = 'a7afcc233730+' +""""This file is generated automatically by the Pyramid `setup.py`""" +version = "0.1.0-dev" +hg_revision = "b'111e1118104a+'" diff --git a/scripts/gui/mag_slicer.py b/scripts/gui/mag_slicer.py index e0a46f610a50acbb312f83334cfe2c826d6c2ae6..90e3476edc33acd6ad44ba5f94149653fd4b9aef 100644 --- a/scripts/gui/mag_slicer.py +++ b/scripts/gui/mag_slicer.py @@ -10,181 +10,64 @@ import os import sys -import pyramid -from pyramid.fielddata import VectorData -from pyramid.kernel import Kernel -from pyramid.phasemapper import PhaseMapperRDFC -from pyramid.projector import SimpleProjector +from PyQt4 import QtGui, QtCore +from PyQt4.uic import loadUiType -from PyQt4 import QtCore, QtGui -from matplotlibwidget import MatplotlibWidget +from matplotlib.figure import Figure +from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas +from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s +import pyramid as pr -try: - _encoding = QtGui.QApplication.UnicodeUTF8 +UI_MainWindow, QMainWindow = loadUiType('mag_slicer.ui') - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: +class Main(QMainWindow, UI_MainWindow): - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) - - -class UI_MagSlicerMain(QtGui.QWidget): - def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) - Form = self - self.setGeometry(100, 100, 1405, 550) - self.setWindowTitle('Mag Slicer') - ########################################################################################### - self.verticalLayout = QtGui.QVBoxLayout(Form) - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.pushButtonLoad = QtGui.QPushButton(Form) - self.pushButtonLoad.setObjectName(_fromUtf8("pushButtonLoad")) - self.horizontalLayout.addWidget(self.pushButtonLoad) - self.checkBoxScale = QtGui.QCheckBox(Form) - self.checkBoxScale.setChecked(True) - self.checkBoxScale.setTristate(False) - self.checkBoxScale.setObjectName(_fromUtf8("checkBoxScale")) - self.horizontalLayout.addWidget(self.checkBoxScale) - self.checkBoxLog = QtGui.QCheckBox(Form) - self.checkBoxLog.setObjectName(_fromUtf8("checkBoxLog")) - self.horizontalLayout.addWidget(self.checkBoxLog) - self.comboBoxSlice = QtGui.QComboBox(Form) - self.comboBoxSlice.setObjectName(_fromUtf8("comboBoxSlice")) - self.comboBoxSlice.addItem(_fromUtf8("")) - self.comboBoxSlice.addItem(_fromUtf8("")) - self.comboBoxSlice.addItem(_fromUtf8("")) - self.horizontalLayout.addWidget(self.comboBoxSlice) - self.labelSlice = QtGui.QLabel(Form) - self.labelSlice.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | - QtCore.Qt.AlignVCenter) - self.labelSlice.setObjectName(_fromUtf8("labelSlice")) - self.horizontalLayout.addWidget(self.labelSlice) - self.spinBoxSlice = QtGui.QSpinBox(Form) - self.spinBoxSlice.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | - QtCore.Qt.AlignVCenter) - self.spinBoxSlice.setMaximum(0) - self.spinBoxSlice.setProperty("value", 0) - self.spinBoxSlice.setObjectName(_fromUtf8("spinBoxSlice")) - self.horizontalLayout.addWidget(self.spinBoxSlice) - self.scrollBarSlice = QtGui.QScrollBar(Form) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.scrollBarSlice.sizePolicy().hasHeightForWidth()) - self.scrollBarSlice.setSizePolicy(sizePolicy) - self.scrollBarSlice.setMinimumSize(QtCore.QSize(400, 0)) - self.scrollBarSlice.setMaximum(0) - self.scrollBarSlice.setOrientation(QtCore.Qt.Horizontal) - self.scrollBarSlice.setObjectName(_fromUtf8("scrollBarSlice")) - self.horizontalLayout.addWidget(self.scrollBarSlice) - self.checkBoxSmooth = QtGui.QCheckBox(Form) - self.checkBoxSmooth.setChecked(True) - self.checkBoxSmooth.setObjectName(_fromUtf8("checkBoxSmooth")) - self.horizontalLayout.addWidget(self.checkBoxSmooth) - self.checkBoxAuto = QtGui.QCheckBox(Form) - self.checkBoxAuto.setChecked(True) - self.checkBoxAuto.setObjectName(_fromUtf8("checkBoxAuto")) - self.horizontalLayout.addWidget(self.checkBoxAuto) - self.labelGain = QtGui.QLabel(Form) - self.labelGain.setObjectName(_fromUtf8("labelGain")) - self.horizontalLayout.addWidget(self.labelGain) - self.spinBoxGain = QtGui.QDoubleSpinBox(Form) - self.spinBoxGain.setEnabled(False) - self.spinBoxGain.setMaximum(1000000.0) - self.spinBoxGain.setSingleStep(0.1) - self.spinBoxGain.setProperty("value", 1.0) - self.spinBoxGain.setObjectName(_fromUtf8("spinBoxGain")) - self.horizontalLayout.addWidget(self.spinBoxGain) - self.verticalLayout.addLayout(self.horizontalLayout) - self.horizontalLayoutPlots = QtGui.QHBoxLayout() - self.horizontalLayoutPlots.setSpacing(0) - self.horizontalLayoutPlots.setSizeConstraint(QtGui.QLayout.SetNoConstraint) - self.horizontalLayoutPlots.setObjectName(_fromUtf8("horizontalLayoutPlots")) - self.mplWidgetMag = MatplotlibWidget(Form) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(10) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.mplWidgetMag.sizePolicy().hasHeightForWidth()) - self.mplWidgetMag.setSizePolicy(sizePolicy) - self.mplWidgetMag.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) - self.mplWidgetMag.setLayoutDirection(QtCore.Qt.LeftToRight) - self.mplWidgetMag.setAutoFillBackground(False) - self.mplWidgetMag.setObjectName(_fromUtf8("mplWidgetMag")) - self.horizontalLayoutPlots.addWidget(self.mplWidgetMag) - self.mplWidgetHolo = MatplotlibWidget(Form) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(10) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.mplWidgetHolo.sizePolicy().hasHeightForWidth()) - self.mplWidgetHolo.setSizePolicy(sizePolicy) - self.mplWidgetHolo.setObjectName(_fromUtf8("mplWidgetHolo")) - self.horizontalLayoutPlots.addWidget(self.mplWidgetHolo) - self.mplWidgetPhase = MatplotlibWidget(Form) - self.mplWidgetPhase.setEnabled(True) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(10) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.mplWidgetPhase.sizePolicy().hasHeightForWidth()) - self.mplWidgetPhase.setSizePolicy(sizePolicy) - self.mplWidgetPhase.setObjectName(_fromUtf8("mplWidgetPhase")) - self.horizontalLayoutPlots.addWidget(self.mplWidgetPhase) - self.verticalLayout.addLayout(self.horizontalLayoutPlots) - ########################################################################################### - self.retranslateUi(Form) - self.connect(self.spinBoxSlice, QtCore.SIGNAL(_fromUtf8("editingFinished()")), - self.scrollBarSlice.setValue) - self.connect(self.scrollBarSlice, QtCore.SIGNAL(_fromUtf8("valueChanged(int)")), - self.spinBoxSlice.setValue) - self.connect(self.checkBoxAuto, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), - self.spinBoxGain.setDisabled) - self.connect(self.checkBoxLog, QtCore.SIGNAL(_fromUtf8('clicked()')), + def __init__(self): + super().__init__() + self.setupUi(self) + self.connect(self.checkBoxLog, QtCore.SIGNAL('clicked()'), self.update_slice) - self.connect(self.checkBoxScale, QtCore.SIGNAL(_fromUtf8('clicked()')), + self.connect(self.checkBoxScale, QtCore.SIGNAL('clicked()'), self.update_slice) - self.connect(self.spinBoxSlice, QtCore.SIGNAL(_fromUtf8('valueChanged(int)')), + self.connect(self.spinBoxSlice, QtCore.SIGNAL('valueChanged(int)'), self.update_slice) - self.connect(self.comboBoxSlice, QtCore.SIGNAL(_fromUtf8('currentIndexChanged(int)')), + self.connect(self.comboBoxSlice, QtCore.SIGNAL('currentIndexChanged(int)'), self.update_phase) - self.connect(self.spinBoxGain, QtCore.SIGNAL(_fromUtf8('editingFinished()')), + self.connect(self.spinBoxGain, QtCore.SIGNAL('valueChanged(double)'), self.update_phase) - self.connect(self.checkBoxAuto, QtCore.SIGNAL(_fromUtf8('toggled(bool)')), + self.connect(self.checkBoxAuto, QtCore.SIGNAL('toggled(bool)'), self.update_phase) - self.connect(self.checkBoxSmooth, QtCore.SIGNAL(_fromUtf8('toggled(bool)')), + self.connect(self.checkBoxSmooth, QtCore.SIGNAL('toggled(bool)'), self.update_phase) - self.connect(self.pushButtonLoad, QtCore.SIGNAL(_fromUtf8('clicked()')), + self.connect(self.pushButtonLoad, QtCore.SIGNAL('clicked()'), self.load) - QtCore.QMetaObject.connectSlotsByName(Form) - self.mplWidgetMag.axes.set_visible(False) - self.mplWidgetHolo.axes.set_visible(False) - self.mplWidgetPhase.axes.set_visible(False) self.mag_data_loaded = False - def retranslateUi(self, Form): - ########################################################################################### - Form.setWindowTitle(_translate("Form", "Mag Slicer", None)) - self.pushButtonLoad.setText(_translate("Form", "Laden", None)) - self.checkBoxScale.setText(_translate("Form", "Scaled", None)) - self.checkBoxLog.setText(_translate("Form", "Log", None)) - self.comboBoxSlice.setItemText(0, _translate("Form", "xy-plane", None)) - self.comboBoxSlice.setItemText(1, _translate("Form", "xz-plane", None)) - self.comboBoxSlice.setItemText(2, _translate("Form", "zy-plane", None)) - self.labelSlice.setText(_translate("Form", "Slice:", None)) - self.checkBoxSmooth.setText(_translate("Form", "Smooth", None)) - self.checkBoxAuto.setText(_translate("Form", "Auto", None)) - self.labelGain.setText(_translate("Form", "Gain:", None)) - ########################################################################################### + def addmpl(self): + fig = Figure() + fig.add_subplot(111, aspect='equal') + self.canvasMag = FigureCanvas(fig) + self.layoutMag.addWidget(self.canvasMag) + self.canvasMag.draw() + self.toolbarMag = NavigationToolbar(self.canvasMag, self, coordinates=True) + self.layoutMag.addWidget(self.toolbarMag) + fig = Figure() + fig.add_subplot(111, aspect='equal') + self.canvasPhase = FigureCanvas(fig) + self.layoutPhase.addWidget(self.canvasPhase) + self.canvasPhase.draw() + self.toolbarPhase = NavigationToolbar(self.canvasPhase, self, coordinates=True) + self.layoutPhase.addWidget(self.toolbarPhase) + fig = Figure() + fig.add_subplot(111, aspect='equal') + self.canvasHolo = FigureCanvas(fig) + self.layoutHolo.addWidget(self.canvasHolo) + self.canvasHolo.draw() + self.toolbarHolo = NavigationToolbar(self.canvasHolo, self, coordinates=True) + self.layoutHolo.addWidget(self.toolbarHolo) def update_phase(self): if self.mag_data_loaded: @@ -202,46 +85,51 @@ class UI_MagSlicerMain(QtGui.QWidget): gain = 'auto' else: gain = self.spinBoxGain.value() - self.projector = SimpleProjector(self.mag_data.dim, axis=self.mode) + self.projector = pr.SimpleProjector(self.mag_data.dim, axis=self.mode) self.spinBoxSlice.setMaximum(length) self.scrollBarSlice.setMaximum(length) self.spinBoxSlice.setValue(int(length / 2.)) self.update_slice() - self.phase_mapper = PhaseMapperRDFC(Kernel(self.mag_data.a, self.projector.dim_uv)) + kernel = pr.Kernel(self.mag_data.a, self.projector.dim_uv) + self.phase_mapper = pr.PhaseMapperRDFC(kernel) self.phase_map = self.phase_mapper(self.projector(self.mag_data)) - self.phase_map.display_phase(axis=self.mplWidgetPhase.axes, cbar=False) + self.canvasPhase.figure.axes[0].clear() + self.phase_map.display_phase(axis=self.canvasPhase.figure.axes[0], cbar=False) if self.checkBoxSmooth.isChecked(): interpolation = 'bilinear' else: interpolation = 'none' - self.phase_map.display_holo(axis=self.mplWidgetHolo.axes, gain=gain, + self.canvasHolo.figure.axes[0].clear() + self.phase_map.display_holo(axis=self.canvasHolo.figure.axes[0], gain=gain, interpolation=interpolation) - self.mplWidgetPhase.draw() - self.mplWidgetHolo.draw() + self.canvasPhase.draw() + self.canvasHolo.draw() def update_slice(self): if self.mag_data_loaded: - self.mag_data.quiver_plot(axis=self.mplWidgetMag.axes, proj_axis=self.mode, + self.canvasMag.figure.axes[0].clear() + self.mag_data.quiver_plot(axis=self.canvasMag.figure.axes[0], proj_axis=self.mode, ax_slice=self.spinBoxSlice.value(), log=self.checkBoxLog.isChecked(), scaled=self.checkBoxScale.isChecked()) - self.mplWidgetMag.draw() + self.canvasMag.draw() def load(self): - directory = os.path.join(pyramid.DIR_FILES, 'magdata') - mag_file = QtGui.QFileDialog.getOpenFileName(self, 'Open Data File', directory, - 'HDF5 files (*.hdf5)') - self.mag_data = VectorData.load_from_hdf5(mag_file) + try: + directory = os.path.join(pr.DIR_FILES, 'vecdata') + mag_file = QtGui.QFileDialog.getOpenFileName(self, 'Open Data File', directory, + 'HDF5 files (*.hdf5)') + except ValueError: + return # Abort if no conf_path is selected! + self.mag_data = pr.VectorData.load_from_hdf5(mag_file) + if not self.mag_data_loaded: + self.addmpl() self.mag_data_loaded = True - self.mplWidgetMag.axes.set_visible(True) - self.mplWidgetHolo.axes.set_visible(True) - self.mplWidgetPhase.axes.set_visible(True) self.comboBoxSlice.setCurrentIndex(0) self.update_phase() - if __name__ == '__main__': app = QtGui.QApplication(sys.argv) - widget = UI_MagSlicerMain() - widget.show() + main = Main() + main.show() sys.exit(app.exec_()) diff --git a/scripts/gui/mag_slicer.ui b/scripts/gui/mag_slicer.ui index 453a95c9fddad3f0fb70d320d4e2d347e3d776bb..bd983878330be31ef9f6bacfed4d4b2f537e7259 100644 --- a/scripts/gui/mag_slicer.ui +++ b/scripts/gui/mag_slicer.ui @@ -1,224 +1,251 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>993</width> - <height>351</height> + <width>1222</width> + <height>480</height> </rect> </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> <property name="windowTitle"> - <string>Mag Slicer</string> + <string>MagSlicer</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QPushButton" name="pushButtonLoad"> - <property name="text"> - <string>Laden</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBoxScale"> - <property name="text"> - <string>Scaled</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <property name="tristate"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBoxLog"> - <property name="text"> - <string>Log</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBoxSlice"> - <item> + <widget class="QWidget" name="centralwidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="windowTitle"> + <string>Mag Slicer</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="pushButtonLoad"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> - <string>xy-plane</string> + <string>Laden</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBoxScale"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </item> - <item> <property name="text"> - <string>xz-plane</string> + <string>Scaled</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="tristate"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBoxLog"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Log</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBoxSlice"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>xy-plane</string> + </property> + </item> + <item> + <property name="text"> + <string>xz-plane</string> + </property> + </item> + <item> + <property name="text"> + <string>zy-plane</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QLabel" name="labelSlice"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Slice:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBoxSlice"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="value"> + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QScrollBar" name="scrollBarSlice"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>400</width> + <height>0</height> + </size> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBoxSmooth"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Smooth</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBoxAuto"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Auto</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelGain"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </item> - <item> <property name="text"> - <string>zy-plane</string> + <string>Gain:</string> </property> + </widget> + </item> + <item> + <widget class="QDoubleSpinBox" name="spinBoxGain"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximum"> + <double>1000000.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + <property name="value"> + <double>1.000000000000000</double> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QWidget" name="layoutPlots" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayoutPlots"> + <item> + <layout class="QVBoxLayout" name="layoutMag"/> </item> - </widget> - </item> - <item> - <widget class="QLabel" name="labelSlice"> - <property name="text"> - <string>Slice:</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBoxSlice"> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="maximum"> - <number>0</number> - </property> - <property name="value"> - <number>0</number> - </property> - </widget> - </item> - <item> - <widget class="QScrollBar" name="scrollBarSlice"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>400</width> - <height>0</height> - </size> - </property> - <property name="maximum"> - <number>0</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBoxSmooth"> - <property name="text"> - <string>Smooth</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBoxAuto"> - <property name="text"> - <string>Auto</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelGain"> - <property name="text"> - <string>Gain:</string> - </property> - </widget> - </item> - <item> - <widget class="QDoubleSpinBox" name="spinBoxGain"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="maximum"> - <double>1000000.000000000000000</double> - </property> - <property name="singleStep"> - <double>0.100000000000000</double> - </property> - <property name="value"> - <double>1.000000000000000</double> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutPlots"> - <property name="spacing"> - <number>0</number> - </property> - <property name="sizeConstraint"> - <enum>QLayout::SetNoConstraint</enum> - </property> - <item> - <widget class="MatplotlibWidget" name="mplWidgetMag"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Ignored" vsizetype="Expanding"> - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="cursor"> - <cursorShape>ArrowCursor</cursorShape> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="MatplotlibWidget" name="mplWidgetHolo"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Ignored" vsizetype="Expanding"> - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="MatplotlibWidget" name="mplWidgetPhase"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Ignored" vsizetype="Expanding"> - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </item> - </layout> + <item> + <layout class="QVBoxLayout" name="layoutPhase"/> + </item> + <item> + <layout class="QVBoxLayout" name="layoutHolo"/> + </item> + </layout> + </widget> + </item> + </layout> + </widget> </widget> - <customwidgets> - <customwidget> - <class>MatplotlibWidget</class> - <extends>QWidget</extends> - <header>matplotlibwidget</header> - </customwidget> - </customwidgets> <resources/> <connections> <connection> @@ -228,28 +255,28 @@ <slot>setValue(int)</slot> <hints> <hint type="sourcelabel"> - <x>335</x> - <y>18</y> + <x>322</x> + <y>19</y> </hint> <hint type="destinationlabel"> - <x>380</x> - <y>17</y> + <x>386</x> + <y>20</y> </hint> </hints> </connection> <connection> <sender>scrollBarSlice</sender> - <signal>valueChanged(int)</signal> + <signal>sliderMoved(int)</signal> <receiver>spinBoxSlice</receiver> <slot>setValue(int)</slot> <hints> <hint type="sourcelabel"> - <x>364</x> - <y>27</y> + <x>431</x> + <y>24</y> </hint> <hint type="destinationlabel"> <x>321</x> - <y>29</y> + <y>20</y> </hint> </hints> </connection> @@ -260,12 +287,12 @@ <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>761</x> - <y>18</y> + <x>1065</x> + <y>22</y> </hint> <hint type="destinationlabel"> - <x>870</x> - <y>14</y> + <x>1166</x> + <y>21</y> </hint> </hints> </connection> diff --git a/scripts/gui/phasemap_creator.py b/scripts/gui/phasemap_creator.py index 9871cd63c2ec05b0180e3af025f238a97c4f5a8f..35128970d34c27e00abca7b5215754d77359025b 100644 --- a/scripts/gui/phasemap_creator.py +++ b/scripts/gui/phasemap_creator.py @@ -11,192 +11,70 @@ import os import sys -import hyperspy.api as hs +from PyQt4 import QtGui, QtCore +from PyQt4.uic import loadUiType -from pyramid import PhaseMap +from matplotlib.figure import Figure +from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas +from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar import numpy as np +import pyramid as pr +import hyperspy.api as hs from PIL import Image -from PyQt4 import QtCore, QtGui -from matplotlibwidget import MatplotlibWidget - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) -except AttributeError: +UI_MainWindow, QMainWindow = loadUiType('phasemap_creator.ui') - def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) +class Main(QMainWindow, UI_MainWindow): -class UI_PhaseMapCreatorMain(QtGui.QWidget): - def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) - Form = self - self.setGeometry(100, 100, 900, 900) - self.setWindowTitle('PhaseMap Creator') - Form.setObjectName(_fromUtf8('PhaseMap Creator')) - ########################################################################################### - self.verticalLayout = QtGui.QVBoxLayout(Form) - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.mplwidget = MatplotlibWidget(Form) - self.mplwidget.setObjectName(_fromUtf8("mplwidget")) - self.verticalLayout.addWidget(self.mplwidget) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.pushButton_phase = QtGui.QPushButton(Form) - self.pushButton_phase.setObjectName(_fromUtf8("pushButton_phase")) - self.horizontalLayout.addWidget(self.pushButton_phase) - self.pushButton_mask = QtGui.QPushButton(Form) - self.pushButton_mask.setObjectName(_fromUtf8("pushButton_mask")) - self.horizontalLayout.addWidget(self.pushButton_mask) - self.pushButton_conf = QtGui.QPushButton(Form) - self.pushButton_conf.setObjectName(_fromUtf8("pushButton_conf")) - self.horizontalLayout.addWidget(self.pushButton_conf) - self.pushButton_export = QtGui.QPushButton(Form) - self.pushButton_export.setObjectName(_fromUtf8("pushButton_export")) - self.horizontalLayout.addWidget(self.pushButton_export) - self.verticalLayout.addLayout(self.horizontalLayout) - self.horizontalLayout_2 = QtGui.QHBoxLayout() - self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) - self.label_a = QtGui.QLabel(Form) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_a.sizePolicy().hasHeightForWidth()) - self.label_a.setSizePolicy(sizePolicy) - self.label_a.setObjectName(_fromUtf8("label_a")) - self.horizontalLayout_2.addWidget(self.label_a) - self.doubleSpinBox_a = QtGui.QDoubleSpinBox(Form) - self.doubleSpinBox_a.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | - QtCore.Qt.AlignVCenter) - self.doubleSpinBox_a.setMaximum(1000) - self.doubleSpinBox_a.setProperty("value", 1) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.doubleSpinBox_a.sizePolicy().hasHeightForWidth()) - self.doubleSpinBox_a.setSizePolicy(sizePolicy) - self.doubleSpinBox_a.setObjectName(_fromUtf8("doubleSpinBox_a")) - self.horizontalLayout_2.addWidget(self.doubleSpinBox_a) - self.label_thres = QtGui.QLabel(Form) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_thres.sizePolicy().hasHeightForWidth()) - self.label_thres.setSizePolicy(sizePolicy) - self.label_thres.setObjectName(_fromUtf8("label_thres")) - self.horizontalLayout_2.addWidget(self.label_thres) - self.doubleSpinBox_thres = QtGui.QDoubleSpinBox(Form) - self.doubleSpinBox_thres.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | - QtCore.Qt.AlignVCenter) - self.doubleSpinBox_thres.setMaximum(0) - self.doubleSpinBox_thres.setProperty("value", 0) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.doubleSpinBox_thres.sizePolicy().hasHeightForWidth()) - self.doubleSpinBox_thres.setSizePolicy(sizePolicy) - self.doubleSpinBox_thres.setObjectName(_fromUtf8("doubleSpinBox_thres")) - self.horizontalLayout_2.addWidget(self.doubleSpinBox_thres) - self.horizontalScrollBar = QtGui.QScrollBar(Form) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.horizontalScrollBar.sizePolicy().hasHeightForWidth()) - self.horizontalScrollBar.setSizePolicy(sizePolicy) - self.horizontalScrollBar.setOrientation(QtCore.Qt.Horizontal) - self.horizontalScrollBar.setMaximum(0) - self.horizontalScrollBar.setObjectName(_fromUtf8("horizontalScrollBar")) - self.horizontalLayout_2.addWidget(self.horizontalScrollBar) - self.checkBox_mask = QtGui.QCheckBox(Form) - self.checkBox_mask.setChecked(True) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.checkBox_mask.sizePolicy().hasHeightForWidth()) - self.checkBox_mask.setSizePolicy(sizePolicy) - self.checkBox_mask.setObjectName(_fromUtf8("checkBox_mask")) - self.horizontalLayout_2.addWidget(self.checkBox_mask) - self.checkBox_conf = QtGui.QCheckBox(Form) - self.checkBox_conf.setChecked(True) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.checkBox_conf.sizePolicy().hasHeightForWidth()) - self.checkBox_conf.setSizePolicy(sizePolicy) - self.checkBox_conf.setObjectName(_fromUtf8("checkBox_conf")) - self.horizontalLayout_2.addWidget(self.checkBox_conf) - self.verticalLayout.addLayout(self.horizontalLayout_2) - ########################################################################################### - self.retranslateUi(Form) - # CONNECTS: - self.connect(self.pushButton_phase, QtCore.SIGNAL(_fromUtf8('clicked()')), + def __init__(self): + super().__init__() + self.setupUi(self) + self.connect(self.pushButton_phase, QtCore.SIGNAL('clicked()'), self.load_phase) - self.connect(self.pushButton_mask, QtCore.SIGNAL(_fromUtf8('clicked()')), + self.connect(self.pushButton_mask, QtCore.SIGNAL('clicked()'), self.load_mask) - self.connect(self.pushButton_conf, QtCore.SIGNAL(_fromUtf8('clicked()')), + self.connect(self.pushButton_conf, QtCore.SIGNAL('clicked()'), self.load_conf) - self.connect(self.pushButton_export, QtCore.SIGNAL(_fromUtf8('clicked()')), + self.connect(self.pushButton_export, QtCore.SIGNAL('clicked()'), self.export) - self.connect(self.horizontalScrollBar, QtCore.SIGNAL(_fromUtf8("valueChanged(int)")), + self.connect(self.horizontalScrollBar, QtCore.SIGNAL('valueChanged(int)'), self.doubleSpinBox_thres.setValue) - self.connect(self.doubleSpinBox_thres, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), + self.connect(self.doubleSpinBox_thres, QtCore.SIGNAL('valueChanged(double)'), self.horizontalScrollBar.setValue) - self.connect(self.checkBox_mask, QtCore.SIGNAL(_fromUtf8('clicked()')), + self.connect(self.checkBox_mask, QtCore.SIGNAL('clicked()'), self.update_phasemap) - self.connect(self.checkBox_conf, QtCore.SIGNAL(_fromUtf8('clicked()')), + self.connect(self.checkBox_conf, QtCore.SIGNAL('clicked()'), self.update_phasemap) - self.connect(self.doubleSpinBox_a, QtCore.SIGNAL(_fromUtf8('editingFinished()')), + self.connect(self.doubleSpinBox_a, QtCore.SIGNAL('editingFinished()'), self.update_phasemap) - self.connect(self.doubleSpinBox_thres, QtCore.SIGNAL(_fromUtf8('valueChanged(double)')), + self.connect(self.doubleSpinBox_thres, QtCore.SIGNAL('valueChanged(double)'), self.update_mask) - QtCore.QMetaObject.connectSlotsByName(Form) - # OTHER STUFF: - self.mplwidget.axes.set_visible(False) - self.mplwidget.axes.set_visible(False) - self.mplwidget.axes.set_visible(False) - self.pushButton_mask.setEnabled(False) - self.pushButton_conf.setEnabled(False) - self.pushButton_export.setEnabled(False) - self.doubleSpinBox_thres.setEnabled(False) - self.horizontalScrollBar.setEnabled(False) self.phase_loaded = False self.mask_loaded = False - self.dir = '' + self.dir = os.path.join(pr.DIR_FILES) - def retranslateUi(self, Form): - ########################################################################################### - Form.setWindowTitle(_translate("Form", "PhaseMap Creator", None)) - self.pushButton_phase.setText(_translate("Form", "Load Phase", None)) - self.pushButton_mask.setText(_translate("Form", "Load Mask", None)) - self.pushButton_conf.setText(_translate("Form", "Load Confidence", None)) - self.pushButton_export.setText(_translate("Form", "Export PhaseMap", None)) - self.label_a.setText(_translate("Form", "Grid Spacing [nm]:", None)) - self.label_thres.setText(_translate("Form", "Mask Threshold:", None)) - self.checkBox_mask.setText(_translate("Form", "show mask", None)) - self.checkBox_conf.setText(_translate("Form", "show confidence", None)) - ########################################################################################### + def addmpl(self): + fig = Figure() + fig.add_subplot(111, aspect='equal') + self.canvas = FigureCanvas(fig) + self.mplLayout.addWidget(self.canvas) + self.canvas.draw() + self.toolbar = NavigationToolbar(self.canvas, self, coordinates=True) + self.mplLayout.addWidget(self.toolbar) def update_phasemap(self): if self.phase_loaded: self.phase_map.a = self.doubleSpinBox_a.value() show_mask = self.checkBox_mask.isChecked() show_conf = self.checkBox_conf.isChecked() - self.mplwidget.axes.clear() - self.mplwidget.axes.hold(True) - self.phase_map.display_phase('PhaseMap', axis=self.mplwidget.axes, + self.canvas.figure.axes[0].clear() + self.canvas.figure.axes[0].hold(True) + self.phase_map.display_phase('PhaseMap', axis=self.canvas.figure.axes[0], show_mask=show_mask, show_conf=show_conf, cbar=False) - self.mplwidget.draw() + self.canvas.draw() def update_mask(self): if self.mask_loaded: @@ -209,14 +87,13 @@ class UI_PhaseMapCreatorMain(QtGui.QWidget): def load_phase(self): try: self.phase_path = QtGui.QFileDialog.getOpenFileName(self, 'Load Phase', self.dir) - self.phase_map = PhaseMap.from_signal(hs.load(self.phase_path)) + self.phase_map = pr.PhaseMap.from_signal(hs.load(self.phase_path)) except ValueError: return # Abort if no phase_path is selected! self.doubleSpinBox_a.setValue(self.phase_map.a) self.dir = os.path.join(os.path.dirname(self.phase_path)) - self.mplwidget.axes.set_visible(True) - self.mplwidget.axes.set_visible(True) - self.mplwidget.axes.set_visible(True) + if not self.phase_loaded: + self.addmpl() self.pushButton_mask.setEnabled(True) self.pushButton_conf.setEnabled(True) self.pushButton_export.setEnabled(True) @@ -258,7 +135,7 @@ class UI_PhaseMapCreatorMain(QtGui.QWidget): except ValueError: return # Abort if no conf_path is selected! confidence = hs.load(conf_path).data - confidence /= confidence.max() + confidence = confidence / confidence.max() confidence = np.asarray(Image.fromarray(confidence).resize(self.phase_map.dim_uv)) self.phase_map.confidence = confidence self.update_phasemap() @@ -276,6 +153,6 @@ class UI_PhaseMapCreatorMain(QtGui.QWidget): if __name__ == '__main__': app = QtGui.QApplication(sys.argv) - widget = UI_PhaseMapCreatorMain() - widget.show() + main = Main() + main.show() sys.exit(app.exec_()) diff --git a/scripts/gui/phasemap_creator.ui b/scripts/gui/phasemap_creator.ui index 80c739104dd0b1949b8d01363c8c453b363e2147..caa64fc2d2c44c5fc59bbdf24ab48fbfe612a6ea 100644 --- a/scripts/gui/phasemap_creator.ui +++ b/scripts/gui/phasemap_creator.ui @@ -1,209 +1,222 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>789</width> - <height>775</height> + <width>726</width> + <height>632</height> </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string>MainWindow</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="MatplotlibWidget" name="mplwidget"/> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QPushButton" name="pushButton_phase"> - <property name="text"> - <string>Load Phase</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pushButton_mask"> - <property name="text"> - <string>Load Mask</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pushButton_conf"> - <property name="text"> - <string>Load Confidence</string> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pushButton_export"> - <property name="text"> - <string>Export Phasemap</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Grid spacing [nm]:</string> - </property> - </widget> - </item> - <item> - <widget class="QDoubleSpinBox" name="doubleSpinBox_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>60</width> - <height>0</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="maximum"> - <double>1000.000000000000000</double> - </property> - <property name="value"> - <double>1.000000000000000</double> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Mask Threshold:</string> - </property> - </widget> - </item> - <item> - <widget class="QDoubleSpinBox" name="doubleSpinBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>60</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="prefix"> - <string/> - </property> - <property name="decimals"> - <number>2</number> - </property> - <property name="maximum"> - <double>0.000000000000000</double> - </property> - </widget> - </item> - <item> - <widget class="QScrollBar" name="horizontalScrollBar"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximum"> - <number>0</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_mask"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>show mask</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_conf"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>show confidence</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> + <widget class="QWidget" name="centralwidget"> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QWidget" name="mplwidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QVBoxLayout" name="mplLayout"/> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="pushButton_phase"> + <property name="text"> + <string>Load Phase</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pushButton_mask"> + <property name="text"> + <string>Load Mask</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pushButton_conf"> + <property name="text"> + <string>Load Confidence</string> + </property> + <property name="checkable"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pushButton_export"> + <property name="text"> + <string>Export Phasemap</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Grid spacing [nm]:</string> + </property> + </widget> + </item> + <item> + <widget class="QDoubleSpinBox" name="doubleSpinBox_a"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="value"> + <double>1.000000000000000</double> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Mask Threshold:</string> + </property> + </widget> + </item> + <item> + <widget class="QDoubleSpinBox" name="doubleSpinBox_thres"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="prefix"> + <string/> + </property> + <property name="decimals"> + <number>2</number> + </property> + <property name="maximum"> + <double>0.000000000000000</double> + </property> + </widget> + </item> + <item> + <widget class="QScrollBar" name="horizontalScrollBar"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="singleStep"> + <number>1</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_mask"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>show mask</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_conf"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>show confidence</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> </widget> - <customwidgets> - <customwidget> - <class>MatplotlibWidget</class> - <extends>QWidget</extends> - <header>matplotlibwidget</header> - </customwidget> - </customwidgets> <resources/> <connections/> </ui> diff --git a/scripts/magdata/magdata_from_vtk.py b/scripts/magdata/magdata_from_vtk.py index d16a2230fc526fb4e0768224e730ff4c2aa920b4..b17b8e7e2d48fa8a478436a6df7b38dc0176a052 100644 --- a/scripts/magdata/magdata_from_vtk.py +++ b/scripts/magdata/magdata_from_vtk.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """Create magnetization distributions from vtk-files.""" -from __future__ import print_function - import logging.config import os from time import sleep @@ -25,8 +23,7 @@ b_0 = 1. def enclosing_zero(x, y, nx=30, ny=30): - """ - Construct a grid of points, that are some distance away from points (x, y) + """Construct a grid of points, that are some distance away from points (x, y) Parameters ---------- @@ -47,7 +44,7 @@ def enclosing_zero(x, y, nx=30, ny=30): dx = x.ptp() / nx dy = y.ptp() / ny xp, yp = np.mgrid[x.min() - 2 * dx:x.max() + 2 * dx:(nx + 2) * 1j, - y.min() - 2 * dy:y.max() + 2 * dy:(ny + 2) * 1j] + y.min() - 2 * dy:y.max() + 2 * dy:(ny + 2) * 1j] xp = xp.ravel() yp = yp.ravel() # Use KDTree to answer the question: "which point of set (x, y) is the diff --git a/scripts/phasemap/phasemap_from_dm3.py b/scripts/phasemap/phasemap_from_dm3.py index 3eaf9d6cfbdca2473836ad494b1c298457587910..0301697b81041df24a04de72827b96c085b6db34 100644 --- a/scripts/phasemap/phasemap_from_dm3.py +++ b/scripts/phasemap/phasemap_from_dm3.py @@ -7,18 +7,19 @@ import os import numpy as np from PIL import Image -import hyperspy.hspy as hp -import pyramid as py +import hyperspy.api as hs +import pyramid as pr import matplotlib.pyplot as plt -logging.config.fileConfig(py.LOGGING_CONFIG, disable_existing_loggers=False) +logging.config.fileConfig(pr.LOGGING_CONFIG, disable_existing_loggers=False) ################################################################################################### -path_mag = 'zi_an_38kx_220K_09p32_w1198_h154.dm3' -path_mask = 'zi_an_38kx_220K_00p10_w1198_h154_mask_in.txt' +path_mag = 'zi_an_skyrmions_02_38kx_220K_06p27_r_t_magn_x13_y27_w420_h400.dm3' +path_mask = 'zi_an_skyrmions_02_38kx_220K_06p27_r_t_magn_x13_y27_w420_h400_mask_roi.txt' path_conf = None -filename = 'phasemap_dm3_zi_an_magnetite_09p32.hdf5' +filename = 'phasemap_dm3_{}.hdf5'.format(os.path.splitext(path_mag)[0]) +print(filename) a = 1. dim_uv = None threshold = 0.5 @@ -26,16 +27,16 @@ flip_up_down = True ################################################################################################### # Load images: -im_mag_hp = hp.load(os.path.join(py.DIR_FILES, 'dm3', path_mag)) +im_mag_hp = hs.load(os.path.join(pr.DIR_FILES, 'dm3', path_mag)) im_mag = Image.fromarray(im_mag_hp.data) if path_mask is not None: # im_mask_hp = hp.load(os.path.join(pr.DIR_FILES, 'dm3', path_mask)) - mask_data = np.genfromtxt(os.path.join(py.DIR_FILES, 'dm3', path_mask), delimiter=',') + mask_data = np.genfromtxt(os.path.join(pr.DIR_FILES, 'dm3', path_mask), delimiter=',') im_mask = Image.fromarray(mask_data) # )im_mask_hp.data) else: im_mask = Image.new('F', im_mag.size, 'white') if path_conf is not None: - im_conf_hp = hp.load(os.path.join(py.DIR_FILES, 'dm3', path_conf)) + im_conf_hp = hs.load(os.path.join(pr.DIR_FILES, 'dm3', path_conf)) im_conf = Image.fromarray(im_conf_hp.data) else: im_conf = Image.new('F', im_mag.size, 'white') @@ -54,7 +55,7 @@ mask = np.where(np.asarray(im_mask) >= threshold, True, False) confidence = np.where(np.asarray(im_conf) >= threshold, 1, 0) # Create and save PhaseMap object: -phase_map = py.PhaseMap(a, phase, mask, confidence, unit='rad') -phase_map.save_to_hdf5(os.path.join(py.DIR_FILES, 'phasemap', filename), overwrite=True) +phase_map = pr.PhaseMap(a, phase, mask, confidence, unit='rad') +phase_map.save_to_hdf5(os.path.join(pr.DIR_FILES, 'phasemap', filename), overwrite=True) phase_map.display_combined() plt.show() diff --git a/scripts/phasemap/phasemap_from_raw.py b/scripts/phasemap/phasemap_from_raw.py index 887004147a61f22c580a753e828dad63f455a8b2..71cca7d695e9a4f8371f46294017e99298803277 100644 --- a/scripts/phasemap/phasemap_from_raw.py +++ b/scripts/phasemap/phasemap_from_raw.py @@ -4,12 +4,11 @@ import logging.config import os -import pyramid as pr - import matplotlib.pyplot as plt import numpy as np from PIL import Image +import pyramid as pr logging.config.fileConfig(pr.LOGGING_CONFIG, disable_existing_loggers=False) diff --git a/scripts/reconstruction/reconstruction_2d_from_phasemap.py b/scripts/reconstruction/reconstruction_2d_from_phasemap.py index 7ed9b370d64d21009c8ed104d1fdc50e11bd9d2e..7d04d2c49779221a03d5e12709b737fecd268646 100644 --- a/scripts/reconstruction/reconstruction_2d_from_phasemap.py +++ b/scripts/reconstruction/reconstruction_2d_from_phasemap.py @@ -1,19 +1,20 @@ # -*- coding: utf-8 -*- """Reconstruct a magnetization distributions from a single phase map.""" -from __future__ import print_function +import logging.config +import matplotlib.pyplot as plt import numpy as np + import pyramid as pr from jutil.taketime import TakeTime -import logging.config logging.config.fileConfig(pr.LOGGING_CONFIG, disable_existing_loggers=False) ################################################################################################### -phase_name = 'phasemap_gui_150917_skyrm_M_100mT' +phase_name = 'phasemap_dm3_zi_an_skyrmions_02_38kx_220K_06p27_r_t_magn_x13_y27_w420_h400' b_0 = 1 # in T -lam = 1E-1 +lam = 1E-3 max_iter = 100 buffer_pixel = 0 order = 1 @@ -47,7 +48,6 @@ else: mag_data_buffer = mag_data_rec.copy() mag_data_rec.crop((0, buffer_pixel, buffer_pixel)) mag_name = '{}_lam={}'.format(phase_name.replace('phasemap', 'magdata_rec'), lam) -mag_data_rec = mag_data_rec.flip(axis='y') mag_data_rec.save_to_hdf5(mag_name + '.hdf5', overwrite=True) # Plot stuff: @@ -69,3 +69,4 @@ difference = (phase_map_rec.phase - phase_map.phase).mean() (phase_map_rec - phase_map).display_phase('Difference (mean: {:.2g})'.format(difference)) if order is not None: fwd_model.ramp(0).display_combined('Fitted Ramp') +plt.show() diff --git a/setup.py b/setup.py index 3d455d0c5437f7e83b6840824e79b06c8ce5e75f..d2b588f85ec645f35782cfc7d40c2a545d5d5292 100644 --- a/setup.py +++ b/setup.py @@ -2,8 +2,6 @@ # coding=utf-8 """Setup for testing, building, distributing and installing the 'Pyramid'-package""" -from __future__ import print_function - import os import re import subprocess @@ -16,7 +14,7 @@ from setuptools import setup, find_packages from setuptools.extension import Extension # Import Hyperspy before actually doing stuff, to set the PyQT API at the very beginning (to 2). -# If this is not done, something sets it to 1 befor HyperSpy is imported, which leads to errors. +# If this is not done, something sets it to 1 befor Hyperspy is imported, which leads to errors. DISTNAME = 'pyramid' @@ -104,9 +102,9 @@ def write_version_py(filename='pyramid/version.py'): """ version_string = '# -*- coding: utf-8 -*-\n' + \ - '"""This file is generated automatically by the Pyramid `setup.py`"""\n' + \ - 'version = \'{}\'\n'.format(VERSION) + \ - 'hg_revision = \'{}\'\n'.format(hg_version()) + '""""This file is generated automatically by the Pyramid `setup.py`"""\n' + \ + 'version = "{}"\n'.format(VERSION) + \ + 'hg_revision = "{}"\n'.format(hg_version()) with open(os.path.join(os.path.dirname(__file__), filename), 'w') as vfile: vfile.write(version_string) @@ -148,16 +146,12 @@ setup(name=DISTNAME, version=VERSION, packages=find_packages(exclude=['tests']), include_dirs=[numpy.get_include()], - requires=['numpy', 'matplotlib', 'mayavi', 'hyperspy', 'PIL', 'scipy', 'pyfftw', 'Cython'], + requires=['numpy', 'scipy', 'matplotlib', 'Pillow', + 'mayavi', 'pyfftw', 'hyperspy', 'Cython'], scripts=get_files('scripts'), test_suite='nose.collector', cmdclass={'build_ext': build_ext, 'build': build}, ext_package='pyramid/numcore', - ext_modules=[ - Extension('phasemapper_core', ['pyramid/numcore/phasemapper_core.pyx'], - include_dirs=[numpy.get_include()], - extra_compile_args=['-march=native', '-mtune=native'] - ) - ] - ) + ext_modules=[Extension('phasemapper_core', ['pyramid/numcore/phasemapper_core.pyx'], + include_dirs=[numpy.get_include()])]) print('-------------------------------------------------------------------------------\n')