Changeset 1b5e020 in sasmodels
- Timestamp:
- Aug 27, 2017 11:11:41 AM (7 years ago)
- Children:
- 41917b8
- Parents:
- df30106
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/tabulated.py
rdf30106 r1b5e020 73 73 74 74 75 def numpyze(calc_I): 76 """ 77 Transform positional arguments into numpy arrays 78 :param calc_I: Intensities calculator 79 :return: function acting on the transformed positional arguments 80 """ 81 def wrapper(*args, **kwargs): 82 numpy_args = [np.array(arg, dtype=np.float) for arg in args] 83 return calc_I(*numpy_args, **kwargs) 84 85 86 @numpyze 75 87 def Iq(q, scale=1.0): 76 88 """ … … 79 91 :return: calculated intensities 80 92 """ 81 q_a = np.array(q, dtype='float') 82 return scale * _attr['itp'](q_a) 93 return scale * _attr['itp'](q) 83 94 84 95 Iq.vectorized = True # Iq accepts an array of q values 85 96 86 97 98 @numpyze 87 99 def Iqxy(qx, qy, scale=1.0): 88 100 """ … … 92 104 :return: calculated intensities 93 105 """ 94 qx_a = np.array(qx, dtype='float') 95 qy_a = np.array(qy, dtype='float') 96 return scale * _attr['itp'](qx_a, qy_a) 106 return scale * _attr['itp'](qx, qy) 97 107 pass 98 108
Note: See TracChangeset
for help on using the changeset viewer.