This file contains hidden or 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
SAM = m.create_samfire() | |
--------------------------------------------------------------------------- | |
KeyError Traceback (most recent call last) | |
<ipython-input-21-edd4774a10cd> in <module>() | |
----> 1 SAM = m.create_samfire() | |
/Users/thomas/Dropbox/0_Git/GitHub/hyperspy_aar/hyperspy/model.py in create_samfire(self, workers, setup, **kwargs) | |
1780 from hyperspy.samfire import Samfire | |
1781 return Samfire(self, workers=workers, | |
-> 1782 setup=setup, **kwargs) |
This file contains hidden or 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
def fit_Zr_L(sZr, ll=None): | |
"Fits the Zr L lines, return a hyperspy model. Input is a Zr spectrum image, and optionally, the accompanying low loss SI." | |
print("Will produce 10 progress bars") | |
mZr = sZr.create_model(ll = ll, GOS="Hartree-Slater", auto_add_edges=False) | |
# Fit Background | |
mZr.fit_component(mZr["PowerLaw"], bounded=True, signal_range=[2150.,2210.], fit_independent=True, only_current=True) | |
mZr.assign_current_values_to_all() | |
mZr.fit_component(mZr["PowerLaw"], bounded=True, signal_range=[2150.,2210.], fit_independent=True, only_current=False) |
This file contains hidden or 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
m = Zr.create_model(ll, GOS="Hartree-Slater") | |
Zr_L3_white = hs.model.components1D.Gaussian() | |
Zr_L3_white.name = "Zr L3 White Line" | |
Zr_L3_white.centre.bmin = 2218.0 | |
Zr_L3_white.centre.bmax = 2240.0 | |
Zr_L3_white.sigma.bmax=3 | |
Zr_L3_white.A.bmin = 0 | |
Zr_L2_white = hs.model.components1D.Gaussian() |
This file contains hidden or 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
>>> m.fit(fitter="L-BFGS-B", bounded=True, grad=True) | |
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-118-e2c35f346c6e> in <module>() | |
50 | |
51 #m.fit(fitter="leastsq", bounded=True, grad=True) | |
---> 52 m.fit(fitter="L-BFGS-B", bounded=True, grad=True) | |
53 | |
54 |
This file contains hidden or 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
(C:\ProgramData\Miniconda3) C:\Users\thomasaar>pip install -e M:\pc\Dokumenter\GitHub\hyperspy | |
Obtaining file:///M:/pc/Dokumenter/GitHub/hyperspy | |
Complete output from command python setup.py egg_info: | |
test_compilers.c | |
Traceback (most recent call last): | |
File "<string>", line 1, in <module> | |
File "M:\pc\Dokumenter\GitHub\hyperspy\setup.py", line 295, in <module> | |
with update_version_when_dev() as version: | |
File "M:\pc\Dokumenter\GitHub\hyperspy\setup.py", line 273, in __enter__ |
This file contains hidden or 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
PS C:\Users\thomasaar\Downloads\hyperspy> pip install -e ./ | |
Obtaining file:///C:/Users/thomasaar/Downloads/hyperspy | |
Complete output from command python setup.py egg_info: | |
test_compilers.c | |
Traceback (most recent call last): | |
File "<string>", line 1, in <module> | |
File "C:\Users\thomasaar\Downloads\hyperspy\setup.py", line 294, in <module> | |
with update_version_when_dev() as version: | |
File "C:\Users\thomasaar\Downloads\hyperspy\setup.py", line 272, in __enter__ | |
stdout=subprocess.PIPE) |
This file contains hidden or 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
# When stepping through the signal looking for spikes, suddenly: | |
Exception occurred in traits notification handler for object: <hyperspy.signal_tools.SpikesRemoval object at 0x12835e048>, trait: ss_right_value, old value: nan, new value: 0.0 | |
Traceback (most recent call last): | |
File "/Users/thomas/miniconda3/envs/hs/lib/python3.5/site-packages/traits/trait_notifiers.py", line 340, in __call__ | |
self.handler( *args ) | |
File "/Users/thomas/hyperspy/hyperspy/signal_tools.py", line 968, in _ss_right_value_changed | |
self.span_selector_changed() | |
File "/Users/thomas/hyperspy/hyperspy/signal_tools.py", line 1047, in span_selector_changed | |
self.interpolated_line.update() |
This file contains hidden or 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
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
/Users/thomas/hyperspy/hyperspy/gui_ipywidgets/tools.py in on_remove_clicked(b) | |
416 | |
417 def on_remove_clicked(b): | |
--> 418 obj.apply() | |
419 remove.on_click(on_remove_clicked) | |
420 labeled_spline_order = labelme("Spline order", spline_order) | |
/Users/thomas/hyperspy/hyperspy/signal_tools.py in apply(self) |
This file contains hidden or 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
def create_Line_on_DF(s, lineROI=[], hide=False): | |
""" | |
Plots a hyperspy signal and draws an interactive ROI on it on the top left tenth of the image. | |
Can take a list of [x1, y1, x2, y2, linewidth] to set a known intial ROI. | |
Returns a tuple of (roi, roi_signal). Use hide=True to not show the plot. | |
Please report bugs/improvements to [email protected] | |
""" | |
import hyperspy.api as hs | |
if s.axes_manager.navigation_dimension < 2: |
This file contains hidden or 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
import os | |
import ipywidgets as widgets | |
class FileBrowser(object): | |
def __init__(self): | |
self.path = os.getcwd() | |
self._update_files() | |