Changes in / [60e20d8:4acca8c] in sasview
- Location:
- src/sas
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
rdee9e5f rf7e6b30 7 7 from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg \ 8 8 as FigureCanvas 9 from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT 9 10 from matplotlib.figure import Figure 10 11 from numpy.linalg.linalg import LinAlgError … … 35 36 self.data = None 36 37 self.extrap = None 38 self.setMinimumSize(300, 300) 37 39 38 40 def draw_q_space(self): … … 49 51 self.axes.set_xscale("log") 50 52 self.axes.set_yscale("log") 53 self.axes.set_xlabel("Q [$\AA^{-1}$]") 54 self.axes.set_ylabel("I(Q) [cm$^{-1}$]") 55 self.fig.tight_layout() 51 56 52 57 qmin = float(self.model.item(W.W_QMIN).text()) … … 61 66 self.axes.set_xlim(min(self.data.x) / 2, 62 67 max(self.data.x) * 1.5 - 0.5 * min(self.data.x)) 68 self.axes.set_ylim(min(self.data.y) / 2, 69 max(self.data.y) * 1.5 - 0.5 * min(self.data.y)) 63 70 if self.extrap: 64 71 self.axes.plot(self.extrap.x, self.extrap.y) … … 78 85 self.axes.set_xscale("linear") 79 86 self.axes.set_yscale("linear") 87 self.axes.set_xlabel("Z [$\AA$]") 88 self.axes.set_ylabel("Correlation") 89 self.fig.tight_layout() 80 90 81 91 if self.data: … … 85 95 self.axes.plot(data_idf.x, data_idf.y, 86 96 label="Interface Distribution Function") 87 self.axes.set_xlim( min(data1.x), max(data1.x) / 4)97 self.axes.set_xlim(0, max(data1.x) / 4) 88 98 self.axes.legend() 89 99 … … 115 125 116 126 self._canvas = MyMplCanvas(self.model) 117 self.mainVerticalLayout.insertWidget(0, self._canvas) 127 self.plotLayout.insertWidget(0, self._canvas) 128 self.plotLayout.insertWidget(1, NavigationToolbar2QT(self._canvas, self)) 129 self._realplot = MyMplCanvas(self.model) 130 self.plotLayout.insertWidget(2, self._realplot) 131 self.plotLayout.insertWidget(3, NavigationToolbar2QT(self._realplot, self)) 132 133 self.gridLayout_8.setColumnStretch(0, 1) 134 self.gridLayout_8.setColumnStretch(1, 3) 118 135 119 136 # Connect buttons to slots. … … 238 255 self.model.setItem(W.W_POLY, QtGui.QStandardItem("{:.3g}".format(params['A']))) 239 256 self.model.setItem(W.W_PERIOD, QtGui.QStandardItem("{:.3g}".format(params['max']))) 240 #self._realplot.data = transforms257 self._realplot.data = transforms 241 258 242 259 self.update_real_space_plot(transforms) 243 260 244 #self._realplot.draw_real_space()261 self._realplot.draw_real_space() 245 262 246 263 def update_real_space_plot(self, datas): … … 358 375 self.cmdTransform.setEnabled(False) 359 376 360 #self._realplot.data = None361 #self._realplot.draw_real_space()377 self._realplot.data = None 378 self._realplot.draw_real_space() 362 379 363 380 def setClosable(self, value=True): -
src/sas/qtgui/Perspectives/Corfunc/UI/CorfuncPanel.ui
rcb4d219 rf6c3f01 322 322 </item> 323 323 <item row="0" column="1"> 324 <widget class="QLineEdit" name="txtLongPeriod"/> 324 <widget class="QLineEdit" name="txtLongPeriod" width="50"> 325 <property name="minimumSize" stdset="0"> 326 <size> 327 <width>60</width> 328 <height>20</height> 329 </size> 330 </property> 331 </widget> 325 332 </item> 326 333 <item row="0" column="2"> … … 332 339 </item> 333 340 <item row="0" column="3"> 334 <widget class="QLineEdit" name="txtAvgIntThick"/> 341 <widget class="QLineEdit" name="txtAvgIntThick"> 342 <property name="minimumSize" stdset="0"> 343 <size> 344 <width>60</width> 345 <height>20</height> 346 </size> 347 </property> 348 </widget> 335 349 </item> 336 350 <item row="1" column="0"> … … 419 433 </layout> 420 434 </item> 435 <item row="0" column="1"> 436 <layout class="QVBoxLayout" name="plotLayout"> 437 </layout> 438 </item> 421 439 </layout> 422 440 </widget> -
src/sas/sascalc/corfunc/transform_thread.py
ra859f99 rf7e6b30 45 45 # gamma3(R) = 1/R int_{0}^{R} gamma1(x) dx 46 46 # trapz uses the trapezium rule to calculate the integral 47 mask = xs <= 200.0 # Only calculate gamma3 up to x=200 (as this is all that's plotted)48 47 # gamma3 = [trapz(gamma1[:n], xs[:n])/xs[n-1] for n in range(2, len(xs[mask]) + 1)]j 49 48 # gamma3.insert(0, 1.0) # Gamma_3(0) is defined as 1 50 n = len(xs [mask])49 n = len(xs) 51 50 gamma3 = cumtrapz(gamma1[:n], xs[:n])/xs[1:n] 52 51 gamma3 = np.hstack((1.0, gamma3)) # Gamma_3(0) is defined as 1 … … 79 78 80 79 transform1 = Data1D(xs, gamma1) 81 transform3 = Data1D(xs [xs <= 200], gamma3)80 transform3 = Data1D(xs, gamma3) 82 81 idf = Data1D(xs, idf) 83 82
Note: See TracChangeset
for help on using the changeset viewer.