{"action":"created","comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments/69588984","id":69588984,"diff_hunk":"@@ -0,0 +1,161 @@\n+# -*- coding: utf-8 -*-\r\n+# Copyright 2007-2016 The HyperSpy developers\r\n+#\r\n+# This file is part of  HyperSpy.\r\n+#\r\n+#  HyperSpy is free software: you can redistribute it and/or modify\r\n+# it under the terms of the GNU General Public License as published by\r\n+# the Free Software Foundation, either version 3 of the License, or\r\n+# (at your option) any later version.\r\n+#\r\n+#  HyperSpy is distributed in the hope that it will be useful,\r\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n+# GNU General Public License for more details.\r\n+#\r\n+# You should have received a copy of the GNU General Public License\r\n+# along with  HyperSpy.  If not, see <http://www.gnu.org/licenses/>.\r\n+\r\n+\r\n+import numpy as np\r\n+\r\n+from hyperspy._signals.complex_signal import ComplexSignal\r\n+\r\n+\r\n+class ElectronWaveImage(ComplexSignal):\r\n+    \"\"\"Signal2D subclass for complex electron wave data (e.g. reconstructed from holograms).\"\"\"\r\n+\r\n+    _record_by = \"image\"\r\n+    _signal_type = \"electron wave\"\r\n+\r\n+    def __init__(self, *args, **kwargs):\r\n+        super().__init__(*args, **kwargs)\r\n+        self.axes_manager.set_signal_dimension(2)\r\n+        self.metadata.Signal.binned = False\r\n+\r\n+    def add_phase_ramp(self, ramp_x, ramp_y, offset=0):\r\n+        \"\"\"Add a linear phase ramp to the wave.\r\n+\r\n+        Parameters\r\n+        ----------\r\n+        ramp_x: float\r\n+            Slope of the ramp in x-direction.\r\n+        ramp_y: float\r\n+            Slope of the ramp in y-direction.\r\n+        offset: float, optional\r\n+            Offset of the ramp at the fulcrum.\r\n+        Notes\r\n+        -----\r\n+            The fulcrum of the linear ramp is at the origin and the slopes are given in units of\r\n+            the axis with the according scale taken into account. Both are available via the\r\n+            `axes_manager` of the signal.\r\n+\r\n+        \"\"\"\r\n+        phase = self.phase\r\n+        phase.add_ramp(ramp_x, ramp_y, offset)\r\n+        self.phase = phase\r\n+\r\n+    def plot(self,\r\n+             colorbar=True,\r\n+             scalebar=True,\r\n+             scalebar_color=\"white\",\r\n+             axes_ticks=None,\r\n+             auto_contrast=True,\r\n+             saturated_pixels=0,\r\n+             vmin=None,\r\n+             vmax=None,\r\n+             no_nans=False,\r\n+             centre_colormap=\"auto\",\r\n+             **kwargs\r\n+             ):\r\n+        \"\"\"Plot image.\r","path":"hyperspy/_signals/electron_wave_image.py","position":71,"original_position":71,"commit_id":"8dbe4c3be1a760f5434c5e04bb4b4bf7a31af93b","original_commit_id":"8dbe4c3be1a760f5434c5e04bb4b4bf7a31af93b","user":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars.githubusercontent.com/u/989719?v=3","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"body":"Same comment as above regarding the docstring.","created_at":"2016-07-05T15:55:36Z","updated_at":"2016-07-05T15:55:36Z","html_url":"https://github.com/hyperspy/hyperspy/pull/1058#discussion_r69588984","pull_request_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058","_links":{"self":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments/69588984"},"html":{"href":"https://github.com/hyperspy/hyperspy/pull/1058#discussion_r69588984"},"pull_request":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058"}}},"pull_request":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058","id":72552905,"html_url":"https://github.com/hyperspy/hyperspy/pull/1058","diff_url":"https://github.com/hyperspy/hyperspy/pull/1058.diff","patch_url":"https://github.com/hyperspy/hyperspy/pull/1058.patch","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1058","number":1058,"state":"open","locked":false,"title":"Added support for complex data and a basic class for wave images","user":{"login":"CodeMonkeyJan","id":14233291,"avatar_url":"https://avatars.githubusercontent.com/u/14233291?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeMonkeyJan","html_url":"https://github.com/CodeMonkeyJan","followers_url":"https://api.github.com/users/CodeMonkeyJan/followers","following_url":"https://api.github.com/users/CodeMonkeyJan/following{/other_user}","gists_url":"https://api.github.com/users/CodeMonkeyJan/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMonkeyJan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMonkeyJan/subscriptions","organizations_url":"https://api.github.com/users/CodeMonkeyJan/orgs","repos_url":"https://api.github.com/users/CodeMonkeyJan/repos","events_url":"https://api.github.com/users/CodeMonkeyJan/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMonkeyJan/received_events","type":"User","site_admin":false},"body":"As discussed in #787 I added the two classes for hologram and wave images.\r\nAs stated there, HologramImage is nearly empty and WaveImage has some basic functionality (convenience properties and a few functions).\r\nThere are a lot of TODOs in the code which in part hold a few things I could still do, for example making the functions work with image stacks. For this I would like to ask what the proper implementation for iterating over the images in the stack in HyperSpy would be. Any ideas?\r\nOther TODOs include names of colleagues of mine (@FWin22 and @woozey), whose tasks it would be (after a successful merge) to fill the two classes with life :-)!\r\nI also added a few basic tests.\r\nI know this PR is in an early state, but maybe you could give me input what could be improved.\r\n\r\n-------------------------------------------------------------------\r\nI'll track the required course of action here:\r\n- [x] Merge #1074 adding the skimage dependency (this should be merged first, because both other PRs implement this as well).\r\n- [x] Merge #1089 for ufunc functionality.\r\n- [ ] Merge this PR containing the WaveImage class, testing and documentation.\r\n- [ ] Merge #1079 containing the HologramImage class, testing and documentation, maintained by @woozey. This should be merged last, because it depends on both prior PRs.","created_at":"2016-06-03T18:52:38Z","updated_at":"2016-07-05T15:55:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36c97341e57c0cec530684a789010afb5ad70a7e","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/20","html_url":"https://github.com/hyperspy/hyperspy/milestones/RELEASE_next_minor","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/20/labels","id":1827002,"number":20,"title":"RELEASE_next_minor","description":"Next release that adds functionality in a backwards-compatible manner.","creator":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars.githubusercontent.com/u/989719?v=3","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":2,"state":"open","created_at":"2016-06-14T16:25:26Z","updated_at":"2016-07-03T16:54:01Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058/commits","review_comments_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058/comments","review_comment_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/1058/comments","statuses_url":"https://api.github.com/repos/hyperspy/hyperspy/statuses/8dbe4c3be1a760f5434c5e04bb4b4bf7a31af93b","head":{"label":"CodeMonkeyJan:master","ref":"master","sha":"8dbe4c3be1a760f5434c5e04bb4b4bf7a31af93b","user":{"login":"CodeMonkeyJan","id":14233291,"avatar_url":"https://avatars.githubusercontent.com/u/14233291?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeMonkeyJan","html_url":"https://github.com/CodeMonkeyJan","followers_url":"https://api.github.com/users/CodeMonkeyJan/followers","following_url":"https://api.github.com/users/CodeMonkeyJan/following{/other_user}","gists_url":"https://api.github.com/users/CodeMonkeyJan/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMonkeyJan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMonkeyJan/subscriptions","organizations_url":"https://api.github.com/users/CodeMonkeyJan/orgs","repos_url":"https://api.github.com/users/CodeMonkeyJan/repos","events_url":"https://api.github.com/users/CodeMonkeyJan/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMonkeyJan/received_events","type":"User","site_admin":false},"repo":{"id":56061656,"name":"hyperspy","full_name":"CodeMonkeyJan/hyperspy","owner":{"login":"CodeMonkeyJan","id":14233291,"avatar_url":"https://avatars.githubusercontent.com/u/14233291?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeMonkeyJan","html_url":"https://github.com/CodeMonkeyJan","followers_url":"https://api.github.com/users/CodeMonkeyJan/followers","following_url":"https://api.github.com/users/CodeMonkeyJan/following{/other_user}","gists_url":"https://api.github.com/users/CodeMonkeyJan/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMonkeyJan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMonkeyJan/subscriptions","organizations_url":"https://api.github.com/users/CodeMonkeyJan/orgs","repos_url":"https://api.github.com/users/CodeMonkeyJan/repos","events_url":"https://api.github.com/users/CodeMonkeyJan/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMonkeyJan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CodeMonkeyJan/hyperspy","description":"Multidimensional data analysis","fork":true,"url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy","forks_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/forks","keys_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/teams","hooks_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/hooks","issue_events_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/issues/events{/number}","events_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/events","assignees_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/assignees{/user}","branches_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/branches{/branch}","tags_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/tags","blobs_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/statuses/{sha}","languages_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/languages","stargazers_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/stargazers","contributors_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/contributors","subscribers_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/subscribers","subscription_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/subscription","commits_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/contents/{+path}","compare_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/merges","archive_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/downloads","issues_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/issues{/number}","pulls_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/pulls{/number}","milestones_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/milestones{/number}","notifications_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/labels{/name}","releases_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/releases{/id}","deployments_url":"https://api.github.com/repos/CodeMonkeyJan/hyperspy/deployments","created_at":"2016-04-12T12:36:18Z","updated_at":"2016-06-28T08:19:29Z","pushed_at":"2016-06-27T12:54:26Z","git_url":"git://github.com/CodeMonkeyJan/hyperspy.git","ssh_url":"git@github.com:CodeMonkeyJan/hyperspy.git","clone_url":"https://github.com/CodeMonkeyJan/hyperspy.git","svn_url":"https://github.com/CodeMonkeyJan/hyperspy","homepage":"http://www.hyperspy.org","size":77465,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"hyperspy:master","ref":"master","sha":"67f96bea30b344cc2296408f4725774e2e24f6f8","user":{"login":"hyperspy","id":989756,"avatar_url":"https://avatars.githubusercontent.com/u/989756?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperspy","html_url":"https://github.com/hyperspy","followers_url":"https://api.github.com/users/hyperspy/followers","following_url":"https://api.github.com/users/hyperspy/following{/other_user}","gists_url":"https://api.github.com/users/hyperspy/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperspy/subscriptions","organizations_url":"https://api.github.com/users/hyperspy/orgs","repos_url":"https://api.github.com/users/hyperspy/repos","events_url":"https://api.github.com/users/hyperspy/events{/privacy}","received_events_url":"https://api.github.com/users/hyperspy/received_events","type":"Organization","site_admin":false},"repo":{"id":2233998,"name":"hyperspy","full_name":"hyperspy/hyperspy","owner":{"login":"hyperspy","id":989756,"avatar_url":"https://avatars.githubusercontent.com/u/989756?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperspy","html_url":"https://github.com/hyperspy","followers_url":"https://api.github.com/users/hyperspy/followers","following_url":"https://api.github.com/users/hyperspy/following{/other_user}","gists_url":"https://api.github.com/users/hyperspy/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperspy/subscriptions","organizations_url":"https://api.github.com/users/hyperspy/orgs","repos_url":"https://api.github.com/users/hyperspy/repos","events_url":"https://api.github.com/users/hyperspy/events{/privacy}","received_events_url":"https://api.github.com/users/hyperspy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperspy/hyperspy","description":"Multidimensional data analysis","fork":false,"url":"https://api.github.com/repos/hyperspy/hyperspy","forks_url":"https://api.github.com/repos/hyperspy/hyperspy/forks","keys_url":"https://api.github.com/repos/hyperspy/hyperspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperspy/hyperspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperspy/hyperspy/teams","hooks_url":"https://api.github.com/repos/hyperspy/hyperspy/hooks","issue_events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/events{/number}","events_url":"https://api.github.com/repos/hyperspy/hyperspy/events","assignees_url":"https://api.github.com/repos/hyperspy/hyperspy/assignees{/user}","branches_url":"https://api.github.com/repos/hyperspy/hyperspy/branches{/branch}","tags_url":"https://api.github.com/repos/hyperspy/hyperspy/tags","blobs_url":"https://api.github.com/repos/hyperspy/hyperspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperspy/hyperspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperspy/hyperspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperspy/hyperspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperspy/hyperspy/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperspy/hyperspy/languages","stargazers_url":"https://api.github.com/repos/hyperspy/hyperspy/stargazers","contributors_url":"https://api.github.com/repos/hyperspy/hyperspy/contributors","subscribers_url":"https://api.github.com/repos/hyperspy/hyperspy/subscribers","subscription_url":"https://api.github.com/repos/hyperspy/hyperspy/subscription","commits_url":"https://api.github.com/repos/hyperspy/hyperspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperspy/hyperspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperspy/hyperspy/contents/{+path}","compare_url":"https://api.github.com/repos/hyperspy/hyperspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperspy/hyperspy/merges","archive_url":"https://api.github.com/repos/hyperspy/hyperspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperspy/hyperspy/downloads","issues_url":"https://api.github.com/repos/hyperspy/hyperspy/issues{/number}","pulls_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperspy/hyperspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/labels{/name}","releases_url":"https://api.github.com/repos/hyperspy/hyperspy/releases{/id}","deployments_url":"https://api.github.com/repos/hyperspy/hyperspy/deployments","created_at":"2011-08-19T13:14:36Z","updated_at":"2016-06-19T10:37:00Z","pushed_at":"2016-07-04T13:19:43Z","git_url":"git://github.com/hyperspy/hyperspy.git","ssh_url":"git@github.com:hyperspy/hyperspy.git","clone_url":"https://github.com/hyperspy/hyperspy.git","svn_url":"https://github.com/hyperspy/hyperspy","homepage":"http://www.hyperspy.org","size":102945,"stargazers_count":59,"watchers_count":59,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":182,"forks":49,"open_issues":182,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058"},"html":{"href":"https://github.com/hyperspy/hyperspy/pull/1058"},"issue":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/1058"},"comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/1058/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/1058/commits"},"statuses":{"href":"https://api.github.com/repos/hyperspy/hyperspy/statuses/8dbe4c3be1a760f5434c5e04bb4b4bf7a31af93b"}}}}
{"actor":{"display_login":"francisco-dlp"}}