-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1058 from CodeMonkeyJan/master
Added support for complex data
- Loading branch information
Showing
29 changed files
with
1,054 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2007-2016 The HyperSpy developers | ||
# | ||
# This file is part of HyperSpy. | ||
# | ||
# HyperSpy is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# HyperSpy is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with HyperSpy. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
from hyperspy.signal import BaseSignal | ||
from hyperspy.exceptions import DataDimensionError | ||
|
||
|
||
class CommonSignal1D(object): | ||
"""Common functions for 1-dimensional signals.""" | ||
|
||
def to_signal2D(self): | ||
"""Returns the one dimensional signal as a two dimensional signal. | ||
See Also | ||
-------- | ||
as_signal2D : a method for the same purpose with more options. | ||
signals.Signal1D.to_signal2D : performs the inverse operation on images. | ||
Raises | ||
------ | ||
DataDimensionError: when data.ndim < 2 | ||
""" | ||
if self.data.ndim < 2: | ||
raise DataDimensionError( | ||
"A Signal dimension must be >= 2 to be converted to Signal2D") | ||
im = self.rollaxis(-1 + 3j, 0 + 3j) | ||
im.metadata.Signal.record_by = "image" | ||
im._assign_subclass() | ||
return im |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2007-2016 The HyperSpy developers | ||
# | ||
# This file is part of HyperSpy. | ||
# | ||
# HyperSpy is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# HyperSpy is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with HyperSpy. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
from hyperspy.signal import BaseSignal | ||
|
||
|
||
class CommonSignal2D(object): | ||
"""Common functions for 2-dimensional signals.""" | ||
|
||
def to_signal1D(self): | ||
"""Returns the image as a spectrum. | ||
See Also | ||
-------- | ||
as_signal1D : a method for the same purpose with more options. | ||
signals.Signal1D.to_signal1D : performs the inverse operation on one | ||
dimensional signals. | ||
""" | ||
return self.as_signal1D(0 + 3j) |
Oops, something went wrong.