Changeset c7ac15e in sasview for DataLoader
- Timestamp:
- Mar 24, 2009 2:38:52 PM (16 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 2140e68
- Parents:
- 6859338
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/qsmearing.py
rd594a81 rc7ac15e 46 46 if data1D.dx[0]>0.0: 47 47 _found_resolution = True 48 print "_found_resolution",_found_resolution 48 #print "_found_resolution",_found_resolution 49 #print "data1D.dx[0]",data1D.dx[0],data1D.dxl[0] 49 50 # If we found resolution smearing data, return a QSmearer 50 51 if _found_resolution == True: … … 70 71 _found_resolution = False 71 72 break 72 73 #print "_found_slit",_found_slit 74 #print "data1D.dx[0]",data1D.dx[0],data1D.dxl[0] 73 75 # If we found slit smearing data, return a slit smearer 74 76 if _found_slit == True: … … 104 106 iq_smeared = numpy.zeros(self.nbins) 105 107 # Loop over q-values 108 idwb=[] 109 106 110 for q_i in range(self.nbins): 107 111 sum = 0.0 108 counts = 0.0 109 112 counts = 0.0 113 110 114 for i in range(self.nbins): 111 if iq[i]!=0 and self._weights[q_i][i]!=0: 115 if iq[i]==0 or self._weights[q_i][i]==0: 116 continue 117 else: 112 118 sum += iq[i] * self._weights[q_i][i] 113 119 counts += self._weights[q_i][i] … … 147 153 self.nbins = nbins 148 154 ## Number of points used in the smearing computation 149 self.npts = 1000 155 self.npts = 10000 150 156 ## Smearing matrix 151 157 self._weights = None … … 163 169 # For each q-value, compute the weight of each other q-bin 164 170 # in the I(q) array 165 npts_h = self.n bins if self.height>0 else 1 #changed self.npts=>self.nbins166 npts_w = self.n bins if self.width>0 else 1 #changed self.npts=>self.nbins171 npts_h = self.npts if self.height>0 else 1 172 npts_w = self.npts if self.width>0 else 1 167 173 168 174 # If both height and width are great than zero, … … 191 197 if q_i<self.nbins: 192 198 weights[i][q_i] = weights[i][q_i]+1.0 193 print "nbin,npts",self.nbins,self.npts194 199 195 200 self._weights = weights … … 234 239 self.max = data1D.x[len(data1D.x)-1] 235 240 241 #print "nbin,npts",self.nbins,self.npts 236 242 237 243 class _QSmearer(_BaseSmearer):
Note: See TracChangeset
for help on using the changeset viewer.