Changeset 13374be in sasview for src/sas/sasgui/perspectives/corfunc
- Timestamp:
- Sep 20, 2017 7:55:53 AM (7 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- fca1f50
- Parents:
- 6d62b7f (diff), 2a399ca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sasgui/perspectives/corfunc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/corfunc/corfunc.py
r463e7ffc r9b90bf8 189 189 # Show the transformation as a curve instead of points 190 190 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 191 elif label == IDF_LABEL: 192 new_plot.xaxis("{x}", 'A') 193 new_plot.yaxis("{g_1}", '') 194 # Linear scale 195 new_plot.xtransform = 'x' 196 new_plot.ytransform = 'y' 197 group_id = GROUP_ID_IDF 198 # Show IDF as a curve instead of points 199 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 191 200 new_plot.id = label 192 201 new_plot.name = label -
src/sas/sasgui/perspectives/corfunc/corfunc_panel.py
r7432acb r2a399ca 20 20 21 21 OUTPUT_STRINGS = { 22 'max': "Long Period (A): ",22 'max': "Long Period / 2 (A): ", 23 23 'Lc': "Average Hard Block Thickness (A): ", 24 24 'dtr': "Average Interface Thickness (A): ", … … 55 55 self._data = data # The data to be analysed (corrected fr background) 56 56 self._extrapolated_data = None # The extrapolated data set 57 # Callable object of class CorfuncCalculator._Interpolator representing 58 # the extrapolated and interpolated data 59 self._extrapolated_fn = None 57 60 self._transformed_data = None # Fourier trans. of the extrapolated data 58 61 self._calculator = CorfuncCalculator() … … 218 221 219 222 try: 220 params, self._extrapolated_data = self._calculator.compute_extrapolation() 223 params, self._extrapolated_data, self._extrapolated_fn = \ 224 self._calculator.compute_extrapolation() 221 225 except Exception as e: 222 226 msg = "Error extrapolating data:\n" … … 257 261 StatusEvent(status=msg)) 258 262 259 def transform_complete(self, transform =None):263 def transform_complete(self, transforms=None): 260 264 """ 261 265 Called from FourierThread when calculation has completed 262 266 """ 263 267 self._transform_btn.SetLabel("Transform") 264 if transform is None:268 if transforms is None: 265 269 msg = "Error calculating Transform." 266 270 if self.transform_type == 'hilbert': … … 270 274 self._extract_btn.Disable() 271 275 return 272 self._transformed_data = transform 273 import numpy as np 274 plot_x = transform.x[np.where(transform.x <= 200)] 275 plot_y = transform.y[np.where(transform.x <= 200)] 276 277 self._transformed_data = transforms 278 (transform1, transform3, idf) = transforms 279 plot_x = transform1.x[transform1.x <= 200] 280 plot_y = transform1.y[transform1.x <= 200] 276 281 self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL1) 282 # No need to shorten gamma3 as it's only calculated up to x=200 283 self._manager.show_data(transform3, TRANSFORM_LABEL3) 284 285 plot_x = idf.x[idf.x <= 200] 286 plot_y = idf.y[idf.x <= 200] 287 self._manager.show_data(Data1D(plot_x, plot_y), IDF_LABEL) 288 277 289 # Only enable extract params button if a fourier trans. has been done 278 290 if self.transform_type == 'fourier': … … 286 298 """ 287 299 try: 288 params = self._calculator.extract_parameters(self._transformed_data )300 params = self._calculator.extract_parameters(self._transformed_data[0]) 289 301 except: 290 302 params = None -
src/sas/sasgui/perspectives/corfunc/corfunc_state.py
r7432acb r2a399ca 28 28 # List of output parameters, used by __str__ 29 29 output_list = [ 30 ['max', "Long Period (A): "],30 ['max', "Long Period / 2 (A): "], 31 31 ['Lc', "Average Hard Block Thickness (A): "], 32 32 ['dtr', "Average Interface Thickness (A): "], … … 59 59 self.q = None 60 60 self.iq = None 61 # TODO: Add extrapolated data and transformed data (when implemented)62 61 63 62 def __str__(self): -
src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst
r1404cce rd78b5cb 10 10 11 11 This performs a correlation function analysis of one-dimensional 12 SAXS/SANS data, or generates a model-independent volume fraction 12 SAXS/SANS data, or generates a model-independent volume fraction 13 13 profile from the SANS from an adsorbed polymer/surfactant layer. 14 14 15 A correlation function may be interpreted in terms of an imaginary rod moving 16 through the structure of the material. Î\ :sub:`1D`\ (R) is the probability that 17 a rod of length R moving through the material has equal electron/neutron scattering 18 length density at either end. Hence a frequently occurring spacing within a structure 15 A correlation function may be interpreted in terms of an imaginary rod moving 16 through the structure of the material. Î\ :sub:`1D`\ (R) is the probability that 17 a rod of length R moving through the material has equal electron/neutron scattering 18 length density at either end. Hence a frequently occurring spacing within a structure 19 19 manifests itself as a peak. 20 20 … … 30 30 * Fourier / Hilbert Transform of the smoothed data to give the correlation 31 31 function / volume fraction profile, respectively 32 * (Optional) Interpretation of the 1D correlation function based on an ideal 32 * (Optional) Interpretation of the 1D correlation function based on an ideal 33 33 lamellar morphology 34 34 … … 74 74 :align: center 75 75 76 76 77 77 Smoothing 78 78 --------- 79 79 80 The extrapolated data set consists of the Guinier back-extrapolation from Q~0 80 The extrapolated data set consists of the Guinier back-extrapolation from Q~0 81 81 up to the lowest Q value in the original data, then the original scattering data, and the Porod tail-fit beyond this. The joins between the original data and the Guinier/Porod fits are smoothed using the algorithm below to avoid the formation of ripples in the transformed data. 82 82 … … 93 93 h_i = \frac{1}{1 + \frac{(x_i-b)^2}{(x_i-a)^2}} 94 94 95 95 96 96 Transform 97 97 --------- … … 102 102 If "Fourier" is selected for the transform type, the analysis will perform a 103 103 discrete cosine transform on the extrapolated data in order to calculate the 104 correlation function 104 1D correlation function: 105 105 106 106 .. math:: … … 115 115 \left(n + \frac{1}{2} \right) k \right] } \text{ for } k = 0, 1, \ldots, 116 116 N-1, N 117 118 The 3D correlation function is also calculated: 119 120 .. math:: 121 \Gamma _{3D}(R) = \frac{1}{Q^{*}} \int_{0}^{\infty}I(q) q^{2} 122 \frac{sin(qR)}{qR} dq 117 123 118 124 Hilbert … … 165 171 .. figure:: profile1.png 166 172 :align: center 167 173 168 174 .. figure:: profile2.png 169 175 :align: center 170 176 171 177 172 178 References … … 191 197 ----- 192 198 Upon sending data for correlation function analysis, it will be plotted (minus 193 the background value), along with a *red* bar indicating the *upper end of the 199 the background value), along with a *red* bar indicating the *upper end of the 194 200 low-Q range* (used for back-extrapolation), and 2 *purple* bars indicating the range to be used for forward-extrapolation. These bars may be moved my clicking and 195 201 dragging, or by entering appropriate values in the Q range input boxes. … … 221 227 :align: center 222 228 223 229 224 230 .. note:: 225 231 This help document was last changed by Steve King, 08Oct2016 -
src/sas/sasgui/perspectives/corfunc/plot_labels.py
r1dc8ec9 r7dda833 4 4 5 5 GROUP_ID_TRANSFORM = r"$\Gamma(x)$" 6 TRANSFORM_LABEL1 = r"$\Gamma1(x)$" 7 TRANSFORM_LABEL3 = r"$\Gamma3(x)$" 6 TRANSFORM_LABEL1 = r"$\Gamma_1(x)$" 7 TRANSFORM_LABEL3 = r"$\Gamma_3(x)$" 8 9 GROUP_ID_IDF = r"$g_1(x)$" 10 IDF_LABEL = r"$g_1(x)$"
Note: See TracChangeset
for help on using the changeset viewer.