Changeset a86e249 in sasmodels
 Timestamp:
 Apr 8, 2017 11:11:29 AM (16 months ago)
 Branches:
 costrafo411
 Children:
 7c1cce3
 Parents:
 e4e5e29
 Files:

 8 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/sesans.py
re4e5e29 ra86e249 45 45 #import logging; logging.info("creating SESANS transform") 46 46 self.q = z 47 # isoriented flag determines whether data is from an oriented sample or not, should be in the data or selectable in GUI.48 #if self.isoriented==False49 self._set_hankel(SElength, zaccept, Rmax)50 #if self.isoriented==True51 self._set_cosmat(SElength, zaccept, Rmax)47 # isoriented flag determines whether data is from an oriented sample or not, should be a selection variable upon entering SESANS data. 48 if self.isoriented==False: 49 self._set_hankel(SElength, zaccept, Rmax) 50 if self.isoriented==True: 51 self._set_cosmat(SElength, zaccept, Rmax) 52 52 53 53 def apply(self, Iq): 54 if len(Iq.size) == 1: # if isotropic, do Hankel transform 55 # type: (np.ndarray) > np.ndarray 54 try: 56 55 G0 = np.dot(self._H0, Iq) 57 56 G = np.dot(self._H.T, Iq) 58 57 P = G  G0 59 elif len(Iq.size) == 2: 60 dq=self.q_calc[0] 61 G0 = sum(np.dot(self._cos0, Iq)*dq) 62 G = sum(np.dot(self._cosmat.T, Iq)*dq) 63 P = G  G0 58 except: 59 try: 60 dq = self.q_calc[0] 61 G0 = sum(np.dot(self._cos0, Iq) * dq) 62 G = sum(np.dot(self._cosmat.T, Iq) * dq) 63 P = G  G0 64 except: 65 raise ValueError('Sesanstransform.apply cannot generate either a Hankel transform or a cosine transform of you SESANS data') 64 66 return P 65 67 … … 88 90 # Force float32 arrays, otherwise run into memory problems on some machines 89 91 SElength = np.asarray(SElength, dtype='float32') 90 #qymax and qzmax depend on detector shape 91 qzmax= 92 92 93 # Rmax = #value in text box somewhere in FitPage? 93 94 q_max = 2 * pi / (SElength[1]  SElength[0])
Note: See TracChangeset
for help on using the changeset viewer.