jat255 / hyperspy_tools

Python modules providing useful tools for use in HyperSpy
GNU General Public License v3.0
3 stars 2 forks source link

Spatial Drift Correction Application #3

Closed rwhwebster closed 4 years ago

rwhwebster commented 7 years ago

Hi there,

I've been following the Spatial Drift Correction tutorial and find an issue when attempting to execute shift_area_stem(). I've copied the output below.

> shifted_stem = hts.shift_area_stem(stem,stem_list=stem_linescans, shifts=shifts)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-22-bc220f441f33> in <module>()
----> 1 shifted_stem = hts.shift_area_stem(stem,stem_list=stem_linescans, shifts=shifts)

C:\Anaconda3\hyperspy_tools\hyperspy_tools\shifting_lines.py in shift_area_stem(stem_s, stem_list, shifts, crop_scan, do_smoothing, reset_origin, smoothing_parameter)
    259                      range(stem_s.data.shape[0])]
    260
--> 261     shifted_stem_list = shift_lines(stem_list, shifts)
    262
    263     # Copy signal so calibration is right

C:\Anaconda3\hyperspy_tools\hyperspy_tools\shifting_lines.py in shift_lines(lines, shifts, show_progressbar, progress_label)
    185     # if the length of lines and shifts do not match, raise an error
    186     if len(lines) is not len(shifts):
--> 187         raise ValueError("Length of lines and shifts did not match.")
    188
    189     if show_progressbar:

ValueError: Length of lines and shifts did not match.
jat255 commented 7 years ago

Sorry it's not working for you. I won't be able to take a look at this for about a week or so, but I'll get back to you about it.

jat255 commented 4 years ago

Just revisiting this... apologies I never got back to you. Presumably by now you've either figured it out or given up, so closing this.