Changes in / [5123512:9f3db13] in sasview
- Location:
- src/sas
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
r3beadede rdee9e5f 7 7 from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg \ 8 8 as FigureCanvas 9 from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT10 9 from matplotlib.figure import Figure 11 10 from numpy.linalg.linalg import LinAlgError … … 36 35 self.data = None 37 36 self.extrap = None 38 self.setMinimumSize(300, 300)39 37 40 38 def draw_q_space(self): … … 51 49 self.axes.set_xscale("log") 52 50 self.axes.set_yscale("log") 53 self.axes.set_xlabel("Q [$\AA^{-1}$]")54 self.axes.set_ylabel("I(Q) [cm$^{-1}$]")55 self.axes.set_title("Scattering data")56 self.fig.tight_layout()57 51 58 52 qmin = float(self.model.item(W.W_QMIN).text()) … … 61 55 62 56 if self.data: 63 # self.axes.plot(self.data.x, self.data.y, label="Experimental Data") 64 self.axes.errorbar(self.data.x, self.data.y, yerr=self.data.dy, label="Experimental Data") 57 self.axes.plot(self.data.x, self.data.y) 65 58 self.axes.axvline(qmin) 66 59 self.axes.axvline(qmax1) … … 68 61 self.axes.set_xlim(min(self.data.x) / 2, 69 62 max(self.data.x) * 1.5 - 0.5 * min(self.data.x)) 70 self.axes.set_ylim(min(self.data.y) / 2,71 max(self.data.y) * 1.5 - 0.5 * min(self.data.y))72 73 63 if self.extrap: 74 self.axes.plot(self.extrap.x, self.extrap.y, label="Extrapolation") 75 76 if self.data or self.extrap: 77 self.axes.legend() 64 self.axes.plot(self.extrap.x, self.extrap.y) 78 65 79 66 self.draw() … … 91 78 self.axes.set_xscale("linear") 92 79 self.axes.set_yscale("linear") 93 self.axes.set_xlabel("Z [$\AA$]")94 self.axes.set_ylabel("Correlation")95 self.axes.set_title("Real Space Correlations")96 self.fig.tight_layout()97 80 98 81 if self.data: … … 102 85 self.axes.plot(data_idf.x, data_idf.y, 103 86 label="Interface Distribution Function") 104 self.axes.set_xlim( 0, max(data1.x) / 4)87 self.axes.set_xlim(min(data1.x), max(data1.x) / 4) 105 88 self.axes.legend() 106 89 … … 132 115 133 116 self._canvas = MyMplCanvas(self.model) 134 self.plotLayout.insertWidget(0, self._canvas) 135 self.plotLayout.insertWidget(1, NavigationToolbar2QT(self._canvas, self)) 136 self._realplot = MyMplCanvas(self.model) 137 self.plotLayout.insertWidget(2, self._realplot) 138 self.plotLayout.insertWidget(3, NavigationToolbar2QT(self._realplot, self)) 139 140 self.gridLayout_8.setColumnStretch(0, 1) 141 self.gridLayout_8.setColumnStretch(1, 3) 117 self.mainVerticalLayout.insertWidget(0, self._canvas) 142 118 143 119 # Connect buttons to slots. … … 262 238 self.model.setItem(W.W_POLY, QtGui.QStandardItem("{:.3g}".format(params['A']))) 263 239 self.model.setItem(W.W_PERIOD, QtGui.QStandardItem("{:.3g}".format(params['max']))) 264 self._realplot.data = transforms240 #self._realplot.data = transforms 265 241 266 242 self.update_real_space_plot(transforms) 267 243 268 self._realplot.draw_real_space()244 #self._realplot.draw_real_space() 269 245 270 246 def update_real_space_plot(self, datas): … … 382 358 self.cmdTransform.setEnabled(False) 383 359 384 self._realplot.data = None385 self._realplot.draw_real_space()360 #self._realplot.data = None 361 #self._realplot.draw_real_space() 386 362 387 363 def setClosable(self, value=True): -
src/sas/qtgui/Perspectives/Corfunc/UI/CorfuncPanel.ui
r85503bc rcb4d219 18 18 <layout class="QVBoxLayout" name="mainVerticalLayout"> 19 19 <item> 20 <spacer name="verticalSpacer"> 21 <property name="orientation"> 22 <enum>Qt::Vertical</enum> 23 </property> 24 <property name="sizeHint" stdset="0"> 25 <size> 26 <width>20</width> 27 <height>38</height> 28 </size> 29 </property> 30 </spacer> 31 </item> 32 <item> 20 33 <widget class="QGroupBox" name="groupBox"> 21 34 <property name="title"> … … 309 322 </item> 310 323 <item row="0" column="1"> 311 <widget class="QLineEdit" name="txtLongPeriod" width="50"> 312 <property name="minimumSize" stdset="0"> 313 <size> 314 <width>60</width> 315 <height>20</height> 316 </size> 317 </property> 318 </widget> 324 <widget class="QLineEdit" name="txtLongPeriod"/> 319 325 </item> 320 326 <item row="0" column="2"> … … 326 332 </item> 327 333 <item row="0" column="3"> 328 <widget class="QLineEdit" name="txtAvgIntThick"> 329 <property name="minimumSize" stdset="0"> 330 <size> 331 <width>60</width> 332 <height>20</height> 333 </size> 334 </property> 335 </widget> 334 <widget class="QLineEdit" name="txtAvgIntThick"/> 336 335 </item> 337 336 <item row="1" column="0"> … … 418 417 </layout> 419 418 </item> 420 <item>421 <spacer name="verticalSpacer">422 <property name="orientation">423 <enum>Qt::Vertical</enum>424 </property>425 <property name="sizeHint" stdset="0">426 <size>427 <width>20</width>428 <height>38</height>429 </size>430 </property>431 </spacer>432 </item>433 </layout>434 </item>435 <item row="0" column="1">436 <layout class="QVBoxLayout" name="plotLayout">437 419 </layout> 438 420 </item> -
src/sas/sascalc/corfunc/transform_thread.py
rf7e6b30 ra859f99 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) 47 48 # gamma3 = [trapz(gamma1[:n], xs[:n])/xs[n-1] for n in range(2, len(xs[mask]) + 1)]j 48 49 # gamma3.insert(0, 1.0) # Gamma_3(0) is defined as 1 49 n = len(xs )50 n = len(xs[mask]) 50 51 gamma3 = cumtrapz(gamma1[:n], xs[:n])/xs[1:n] 51 52 gamma3 = np.hstack((1.0, gamma3)) # Gamma_3(0) is defined as 1 … … 78 79 79 80 transform1 = Data1D(xs, gamma1) 80 transform3 = Data1D(xs , gamma3)81 transform3 = Data1D(xs[xs <= 200], gamma3) 81 82 idf = Data1D(xs, idf) 82 83
Note: See TracChangeset
for help on using the changeset viewer.