You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "", line 1, in
File "/Users/johnschneeloch/anaconda/lib/python2.7/site-packages/neutronpy-0.1.1-py2.7-macosx-10.5-x86_64.egg/neutronpy/form_facs.py", line 142, in calc_str_fac
FQ = np.zeros(h.shape) * 1j
AttributeError: 'int' object has no attribute 'shape'
Second, if h and k are created with meshgrid with sparse=True, then I get this error after attempting str_fac = FeTe.calc_str_fac((h,k,0)):
Traceback (most recent call last):
File "", line 1, in
File "/Users/johnschneeloch/anaconda/lib/python2.7/site-packages/neutronpy-0.1.1-py2.7-macosx-10.5-x86_64.egg/neutronpy/form_facs.py", line 147, in calc_str_fac
np.exp(-(2. * np.pi * (h * atom.dpos[0] + k * atom.dpos[1] + l * atom.dpos[2])) ** 2)
ValueError: non-broadcastable output operand with shape (1,41) doesn't match the broadcast shape (41,41)
If sparse is not specified, then everything works.
The text was updated successfully, but these errors were encountered:
--Submitted by user:
When I try to run the form factor calculation example shown at http://neutronpy.github.io/reference/examples/material.html, I get a couple of errors, though the source code you provided at the end works fine. First,
str_fac = FeTe.calc_str_fac((1,1,0))
gives me the error
Traceback (most recent call last):
File "", line 1, in
File "/Users/johnschneeloch/anaconda/lib/python2.7/site-packages/neutronpy-0.1.1-py2.7-macosx-10.5-x86_64.egg/neutronpy/form_facs.py", line 142, in calc_str_fac
FQ = np.zeros(h.shape) * 1j
AttributeError: 'int' object has no attribute 'shape'
Second, if h and k are created with meshgrid with sparse=True, then I get this error after attempting str_fac = FeTe.calc_str_fac((h,k,0)):
Traceback (most recent call last):
File "", line 1, in
File "/Users/johnschneeloch/anaconda/lib/python2.7/site-packages/neutronpy-0.1.1-py2.7-macosx-10.5-x86_64.egg/neutronpy/form_facs.py", line 147, in calc_str_fac
np.exp(-(2. * np.pi * (h * atom.dpos[0] + k * atom.dpos[1] + l * atom.dpos[2])) ** 2)
ValueError: non-broadcastable output operand with shape (1,41) doesn't match the broadcast shape (41,41)
If sparse is not specified, then everything works.
The text was updated successfully, but these errors were encountered: