Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

03 Reference Standards - 2. Determine Lens Distortions #68

Open
que-vector opened this issue Apr 21, 2021 · 1 comment
Open

03 Reference Standards - 2. Determine Lens Distortions #68

que-vector opened this issue Apr 21, 2021 · 1 comment

Comments

@que-vector
Copy link

que-vector commented Apr 21, 2021

Hi,
I am trying to work through section 2 in example notebook 3 in version 0.13.2. but I am getting this AttributeError, see below. Could you please help me to solve this?

Thanks!


In [9]: cal.get_elliptical_distortion(mask_radius=10, scale=100, amplitude=1000, asymmetry=0.9,spread=2)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-13-27e3dbe10698> in <module>
----> 1 cal.get_elliptical_distortion(mask_radius=10,
      2                               scale=100, amplitude=1000,
      3                               asymmetry=0.9,spread=2)

D:\Python\Anaconda\envs\pyxem\lib\site-packages\pyxem\generators\calibration_generator.py in get_elliptical_distortion(self, mask_radius, scale, amplitude, spread, direct_beam_amplitude, asymmetry, rotation, center)
    167             )
    168         standard_dp = self.diffraction_pattern
--> 169         image_size = standard_dp.data.shape[0]
    170         if center is None:
    171             center = [(image_size - 1) / 2, (image_size - 1) / 2]

AttributeError: 'CalibrationDataLibrary' object has no attribute 'data'

@pc494
Copy link
Member

pc494 commented Apr 29, 2021

Hi,

Sorry about the delay on getting back to you. It seems this demo is still running on 0.12, in the version you are using the generator is initialised with diffraction_pattern. So the line:

cal_lib = CalibrationDataLibrary(au_x_grating_dp=au_dpeg,
                                 au_x_grating_im=au_im,
                                 moo3_dp=moo3_dpeg,
                                 moo3_im=moo3_im)

Will need adjusting (probably by replacing au_x_grating with diffraction_pattern)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants