Changeset 0794ce3 in sasview


Ignore:
Timestamp:
Sep 11, 2017 4:10:58 AM (7 years ago)
Author:
lewis
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, d07f863
Parents:
ccf58fb (diff), e2b2473 (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.
Message:

Merge branch 'master' into corfunc3d

Files:
7 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/data_info.py

    r5a8cdbb r17e257b5  
    11611161    final_dataset = None 
    11621162    if isinstance(data, plottable_1D): 
    1163         final_dataset = Data1D(data.x, data.y) 
     1163        final_dataset = Data1D(data.x, data.y, isSesans=datainfo.isSesans) 
    11641164        final_dataset.dx = data.dx 
    11651165        final_dataset.dy = data.dy 
    11661166        final_dataset.dxl = data.dxl 
    11671167        final_dataset.dxw = data.dxw 
     1168        final_dataset.x_unit = data._xunit 
     1169        final_dataset.y_unit = data._yunit 
    11681170        final_dataset.xaxis(data._xaxis, data._xunit) 
    11691171        final_dataset.yaxis(data._yaxis, data._yunit) 
  • src/sas/sascalc/dataloader/file_reader_base_class.py

    rdcb91cf ra78a02f  
    66 
    77import os 
     8import re 
    89import logging 
    910import numpy as np 
     
    106107        for data in self.output: 
    107108            if isinstance(data, Data1D): 
     109                # Normalize the units for 
     110                data.x_unit = self.format_unit(data.x_unit) 
     111                data.y_unit = self.format_unit(data.y_unit) 
    108112                # Sort data by increasing x and remove 1st point 
    109113                ind = np.lexsort((data.y, data.x)) 
     
    131135        for dataset in self.output: 
    132136            if isinstance(dataset, Data2D): 
     137                # Normalize the units for 
     138                dataset.x_unit = self.format_unit(dataset.Q_unit) 
     139                dataset.y_unit = self.format_unit(dataset.I_unit) 
    133140                dataset.data = dataset.data.astype(np.float64) 
    134141                dataset.qx_data = dataset.qx_data.astype(np.float64) 
     
    155162                dataset.data = dataset.data.flatten() 
    156163 
     164    def format_unit(self, unit=None): 
     165        """ 
     166        Format units a common way 
     167        :param unit: 
     168        :return: 
     169        """ 
     170        if unit: 
     171            split = unit.split("/") 
     172            if len(split) == 1: 
     173                return unit 
     174            elif split[0] == '1': 
     175                return "{0}^".format(split[1]) + "{-1}" 
     176            else: 
     177                return "{0}*{1}^".format(split[0], split[1]) + "{-1}" 
     178 
    157179    def set_all_to_none(self): 
    158180        """ 
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    rdcb91cf ra78a02f  
    299299                    self.current_dataset.dx = np.append(self.current_dataset.dx, data_point) 
    300300                elif tagname == 'dQw': 
    301                     if self.current_dataset.dqw is None: self.current_dataset.dqw = np.empty(0) 
     301                    if self.current_dataset.dxw is None: 
     302                        self.current_dataset.dxw = np.empty(0) 
    302303                    self.current_dataset.dxw = np.append(self.current_dataset.dxw, data_point) 
    303304                elif tagname == 'dQl': 
    304                     if self.current_dataset.dxl is None: self.current_dataset.dxl = np.empty(0) 
     305                    if self.current_dataset.dxl is None: 
     306                        self.current_dataset.dxl = np.empty(0) 
    305307                    self.current_dataset.dxl = np.append(self.current_dataset.dxl, data_point) 
    306308                elif tagname == 'Qmean': 
  • src/sas/sascalc/dataloader/readers/danse_reader.py

    r713a047 ra78a02f  
    189189        x_vals = np.tile(x_vals, (size_y, 1)).flatten() 
    190190        y_vals = np.tile(y_vals, (size_x, 1)).T.flatten() 
    191         if self.current_dataset.err_data == np.all(np.array(None)) or np.any(self.current_dataset.err_data <= 0): 
     191        if (np.all(self.current_dataset.err_data == None) 
     192                or np.any(self.current_dataset.err_data <= 0)): 
    192193            new_err_data = np.sqrt(np.abs(self.current_dataset.data)) 
    193194        else: 
  • test/sasdataloader/test/utest_abs_reader.py

    rce8c7bd ra78a02f  
    2020    def setUp(self): 
    2121        reader = AbsReader() 
    22         self.data = reader.read("jan08002.ABS") 
     22        data = reader.read("jan08002.ABS") 
     23        self.data= data[0] 
    2324 
    2425    def test_abs_checkdata(self): 
     
    4748        self.assertEqual(self.data.detector[0].beam_center.y, center_y) 
    4849 
    49         self.assertEqual(self.data.y_unit, '1/cm') 
     50        self.assertEqual(self.data.y_unit, 'cm^{-1}') 
    5051        self.assertEqual(self.data.x[0], 0.002618) 
    5152        self.assertEqual(self.data.x[1], 0.007854) 
     
    6970        # the generic loader should work as well 
    7071        data = Loader().load("jan08002.ABS") 
    71         self.assertEqual(data.meta_data['loader'], "IGOR 1D") 
     72        self.assertEqual(data[0].meta_data['loader'], "IGOR 1D") 
    7273 
    7374class DanseReaderTests(unittest.TestCase): 
     
    7576    def setUp(self): 
    7677        reader = DANSEReader() 
    77         self.data = reader.read("MP_New.sans") 
     78        data = reader.read("MP_New.sans") 
     79        self.data = data[0] 
    7880 
    7981    def test_checkdata(self): 
     
    112114        # the generic loader should work as well 
    113115        data = Loader().load("MP_New.sans") 
    114         self.assertEqual(data.meta_data['loader'], "DANSE") 
     116        self.assertEqual(data[0].meta_data['loader'], "DANSE") 
    115117 
    116118 
     
    144146        # Data 
    145147        self.assertEqual(len(self.data.x), 2) 
    146         self.assertEqual(self.data.x_unit, '1/A') 
    147         self.assertEqual(self.data.y_unit, '1/cm') 
     148        self.assertEqual(self.data.x_unit, 'A^{-1}') 
     149        self.assertEqual(self.data.y_unit, 'cm^{-1}') 
    148150        self.assertAlmostEqual(self.data.x[0], 0.02, 6) 
    149151        self.assertAlmostEqual(self.data.y[0], 1000, 6) 
     
    257259            self.assertTrue(item.date in ['04-Sep-2007 18:35:02', 
    258260                                          '03-SEP-2006 11:42:47']) 
    259             print(item.term) 
    260261            for t in item.term: 
    261262                if (t['name'] == "ABS:DSTAND" 
     
    309310 
    310311        self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") 
    311         print(self.data.errors) 
    312         self.assertEqual(len(self.data.errors), 1) 
     312        self.assertEqual(len(self.data.errors), 0) 
    313313 
    314314    def test_slits(self): 
     
    324324        # Data 
    325325        self.assertEqual(len(self.data.x), 2) 
    326         self.assertEqual(self.data.x_unit, '1/A') 
    327         self.assertEqual(self.data.y_unit, '1/cm') 
     326        self.assertEqual(self.data.x_unit, 'A^{-1}') 
     327        self.assertEqual(self.data.y_unit, 'cm^{-1}') 
    328328        self.assertEqual(self.data.x[0], 0.02) 
    329329        self.assertEqual(self.data.y[0], 1000) 
     
    333333        self.assertEqual(self.data.x[1], 0.03) 
    334334        self.assertAlmostEquals(self.data.y[1], 1001.0) 
    335         self.assertEqual(self.data.dx, None) 
     335        self.assertEqual(self.data.dx[0], 0.0) 
    336336        self.assertEqual(self.data.dxl[1], 0.005) 
    337337        self.assertEqual(self.data.dxw[1], 0.001) 
  • test/sasdataloader/test/utest_ascii.py

    rad92c5a ra78a02f  
    3232        self.assertEqual(self.f1.x[0],0.002618) 
    3333        self.assertEqual(self.f1.x[9],0.0497) 
    34         self.assertEqual(self.f1.x_unit, '1/A') 
    35         self.assertEqual(self.f1.y_unit, '1/cm') 
     34        self.assertTrue(self.f1.x_unit == 'A^{-1}') 
     35        self.assertTrue(self.f1.y_unit == 'cm^{-1}') 
    3636         
    3737        self.assertEqual(self.f1.meta_data['loader'],"ASCII") 
  • test/sasdataloader/test/utest_cansas.py

    r1fc50fb2 r17e257b5  
    2020 
    2121from lxml import etree 
     22from lxml.etree import XMLSyntaxError 
    2223from xml.dom import minidom 
    2324 
     
    6263        """ 
    6364        invalid = StringIO.StringIO('<a><c></b></a>') 
    64         XMLreader(invalid) 
     65        self.assertRaises(XMLSyntaxError, lambda: XMLreader(invalid)) 
    6566 
    6667    def test_xml_validate(self): 
     
    302303        self.assertTrue(data._yunit == "cm^{-1}") 
    303304        self.assertTrue(data.y.size == 100) 
    304         self.assertAlmostEqual(data.y[9], 0.952749011516985) 
    305         self.assertAlmostEqual(data.x[9], 0.3834415188257777) 
     305        self.assertAlmostEqual(data.y[40], 0.952749011516985) 
     306        self.assertAlmostEqual(data.x[40], 0.3834415188257777) 
    306307        self.assertAlmostEqual(len(data.meta_data), 0) 
    307308 
  • test/sasdataloader/test/utest_sesans.py

    ra67c494 ra78a02f  
    44 
    55import unittest 
     6from sas.sascalc.dataloader.loader_exceptions import FileContentsException,\ 
     7    DefaultReaderException 
    68from sas.sascalc.dataloader.readers.sesans_reader import Reader 
    79from sas.sascalc.dataloader.loader import  Loader 
     
    1719            Test .SES in the full loader to make sure that the file type is correctly accepted 
    1820        """ 
    19         f = Loader().load("sesans_examples/sphere2micron.ses") 
     21        file = Loader().load("sesans_examples/sphere2micron.ses") 
     22        f = file[0] 
    2023        # self.assertEqual(f, 5) 
    2124        self.assertEqual(len(f.x), 40) 
     
    3437            Test .SES loading on a TOF dataset 
    3538        """ 
    36         f = self.loader("sesans_examples/sphere_isis.ses") 
     39        file = self.loader("sesans_examples/sphere_isis.ses") 
     40        f = file[0] 
    3741        self.assertEqual(len(f.x), 57) 
    3842        self.assertEqual(f.x[-1], 19303.4) 
     
    4852        """ 
    4953        self.assertRaises( 
    50             RuntimeError, 
     54            FileContentsException, 
    5155            self.loader, 
    5256            "sesans_examples/sesans_no_data.ses") 
     
    5761        """ 
    5862        self.assertRaises( 
    59             RuntimeError, 
     63            FileContentsException, 
    6064            self.loader, 
    6165            "sesans_examples/no_spin_echo_unit.ses") 
    62  
    63     def test_sesans_no_version(self): 
    64         """ 
    65             Confirm that sesans files with no file format version raise an appropriate error 
    66         """ 
    67         self.assertRaises( 
    68             RuntimeError, 
    69             self.loader, 
    70             "sesans_examples/no_version.ses") 
    7166 
    7267    def test_sesans_future_version(self): 
     
    7570        """ 
    7671        self.assertRaises( 
    77             RuntimeError, 
     72            FileContentsException, 
    7873            self.loader, 
    7974            "sesans_examples/next_gen.ses") 
     
    8479        """ 
    8580        self.assertRaises( 
    86             RuntimeError, 
     81            FileContentsException, 
    8782            self.loader, 
    8883            "sesans_examples/no_wavelength.ses") 
     
    9388        """ 
    9489        self.assertRaises( 
    95             RuntimeError, 
     90            FileContentsException, 
    9691            self.loader, 
    9792            "sesans_examples/too_many_headers.ses") 
  • test/utest_sasview.py

    raaf5e49 rb54440d  
    4444    n_errors = 0 
    4545    n_failures = 0 
    46      
     46 
    4747    for d in (dirs if dirs else os.listdir(test_root)): 
    48          
     48 
    4949        # Check for modules to be skipped 
    5050        if d in SKIPPED_DIRS: 
    5151            continue 
    52          
     52 
    5353 
    5454        # Go through modules looking for unit tests 
     
    6464                    #print std_out 
    6565                    #sys.exit() 
    66                     has_failed = True 
    6766                    m = re.search("Ran ([0-9]+) test", std_out) 
    6867                    if m is not None: 
    69                         has_failed = False 
    7068                        n_tests += int(m.group(1)) 
     69                        has_tests = True 
     70                    else: 
     71                        has_tests = False 
    7172 
    72                     m = re.search("FAILED \(errors=([0-9]+)\)", std_out) 
     73                    has_failed = "FAILED (" in std_out 
     74                    m = re.search("FAILED \(.*errors=([0-9]+)", std_out) 
    7375                    if m is not None: 
    74                         has_failed = True 
    7576                        n_errors += int(m.group(1)) 
    76                      
    77                     m = re.search("FAILED \(failures=([0-9]+)\)", std_out) 
     77                    m = re.search("FAILED \(.*failures=([0-9]+)", std_out) 
    7878                    if m is not None: 
    79                         has_failed = True 
    8079                        n_failures += int(m.group(1)) 
    81                      
    82                     if has_failed: 
     80 
     81                    if has_failed or not has_tests: 
    8382                        failed += 1 
    8483                        print("Result for %s (%s): FAILED" % (module_name, module_dir)) 
     
    102101        print("    Test errors:  %d" % n_errors) 
    103102    print("----------------------------------------------") 
    104      
     103 
    105104    return failed 
    106105 
     
    110109    if run_tests(dirs=dirs, all=all)>0: 
    111110        sys.exit(1) 
    112      
     111 
  • src/sas/sascalc/corfunc/corfunc_calculator.py

    rff11b21 rc728295  
    3434 
    3535        def __call__(self, x): 
    36             if self._lastx == [] or x.tolist() != self._lastx.tolist(): 
     36            # If input is a single number, evaluate the function at that number 
     37            # and return a single number 
     38            if type(x) == float or type(x) == int: 
     39                return self._smoothed_function(np.array([x]))[0] 
     40            # If input is a list, and is different to the last input, evaluate 
     41            # the function at each point. If the input is the same as last time 
     42            # the function was called, return the result that was calculated 
     43            # last time instead of explicity evaluating the function again. 
     44            elif self._lastx == [] or x.tolist() != self._lastx.tolist(): 
    3745                self._lasty = self._smoothed_function(x) 
    3846                self._lastx = x 
     
    121129        extrapolation = Data1D(qs, iqs) 
    122130 
    123         return params, extrapolation 
     131        return params, extrapolation, s2 
    124132 
    125133    def compute_transform(self, extrapolation, trans_type, background=None, 
     
    131139        :param background: The background value (if not provided, previously 
    132140            calculated value will be used) 
     141        :param extrap_fn: A callable function representing the extraoplated data 
    133142        :param completefn: The function to call when the transform calculation 
    134143            is complete` 
     
    144153        if trans_type == 'fourier': 
    145154            self._transform_thread = FourierThread(self._data, extrapolation, 
    146             background, completefn=completefn, updatefn=updatefn) 
     155            background, completefn=completefn, 
     156            updatefn=updatefn) 
    147157        elif trans_type == 'hilbert': 
    148158            self._transform_thread = HilbertThread(self._data, extrapolation, 
  • src/sas/sascalc/corfunc/transform_thread.py

    rd03228e ra309667  
    22from sas.sascalc.dataloader.data_info import Data1D 
    33from scipy.fftpack import dct 
     4from scipy.integrate import trapz 
    45import numpy as np 
    56from time import sleep 
     
    1314        self.extrapolation = extrapolated_data 
    1415 
     16    def check_if_cancelled(self): 
     17        if self.isquit(): 
     18            self.update("Fourier transform cancelled.") 
     19            self.complete(transforms=None) 
     20            return True 
     21        return False 
     22 
    1523    def compute(self): 
    1624        qs = self.extrapolation.x 
     
    1927        background = self.background 
    2028 
     29        xs = np.pi*np.arange(len(qs),dtype=np.float32)/(q[1]-q[0])/len(qs) 
     30 
    2131        self.ready(delay=0.0) 
    22         self.update(msg="Starting Fourier transform.") 
     32        self.update(msg="Fourier transform in progress.") 
    2333        self.ready(delay=0.0) 
    24         if self.isquit(): 
    25             return 
     34 
     35        if self.check_if_cancelled(): return 
    2636        try: 
    27             gamma = dct((iqs-background)*qs**2) 
    28             gamma = gamma / gamma.max() 
    29         except: 
     37            # ----- 1D Correlation Function ----- 
     38            gamma1 = dct((iqs-background)*qs**2) 
     39            Q = gamma1.max() 
     40            gamma1 /= Q 
     41 
     42            if self.check_if_cancelled(): return 
     43 
     44            # ----- 3D Correlation Function ----- 
     45            # gamma3(R) = 1/R int_{0}^{R} gamma1(x) dx 
     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            gamma3 = [trapz(gamma1[:n], xs[:n])/xs[n-1] for n in range(2, len(xs[mask]) + 1)] 
     49            gamma3.insert(0, 1.0) # Gamma_3(0) is defined as 1 
     50            gamma3 = np.array(gamma3) 
     51 
     52            if self.check_if_cancelled(): return 
     53 
     54            # ----- Interface Distribution function ----- 
     55            idf = dct(-qs**4 * (iqs-background)) 
     56 
     57            if self.check_if_cancelled(): return 
     58 
     59            # Manually calculate IDF(0.0), since scipy DCT tends to give us a 
     60            # very large negative value. 
     61            # IDF(x) = int_0^inf q^4 * I(q) * cos(q*x) * dq 
     62            # => IDF(0) = int_0^inf q^4 * I(q) * dq 
     63            idf[0] = trapz(-qs**4 * (iqs-background), qs) 
     64            idf /= Q # Normalise using scattering invariant 
     65 
     66        except Exception as e: 
     67            import logging 
     68            logger = logging.getLogger(__name__) 
     69            logger.error(e) 
     70 
    3071            self.update(msg="Fourier transform failed.") 
    31             self.complete(transform=None) 
     72            self.complete(transforms=None) 
    3273            return 
    3374        if self.isquit(): 
     
    3576        self.update(msg="Fourier transform completed.") 
    3677 
    37         xs = np.pi*np.arange(len(qs),dtype=np.float32)/(q[1]-q[0])/len(qs) 
    38         transform = Data1D(xs, gamma) 
     78        transform1 = Data1D(xs, gamma1) 
     79        transform3 = Data1D(xs[xs <= 200], gamma3) 
     80        idf = Data1D(xs, idf) 
    3981 
    40         self.complete(transform=transform) 
     82        transforms = (transform1, transform3, idf) 
     83 
     84        self.complete(transforms=transforms) 
    4185 
    4286class HilbertThread(CalcThread): 
     
    64108        self.update(msg="Hilbert transform completed.") 
    65109 
    66         self.complete(transform=None) 
     110        self.complete(transforms=None) 
  • src/sas/sasgui/perspectives/corfunc/corfunc.py

    r463e7ffc r9b90bf8  
    189189            # Show the transformation as a curve instead of points 
    190190            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 
    191200        new_plot.id = label 
    192201        new_plot.name = label 
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    r7432acb r9b90bf8  
    5555        self._data = data # The data to be analysed (corrected fr background) 
    5656        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 
    5760        self._transformed_data = None # Fourier trans. of the extrapolated data 
    5861        self._calculator = CorfuncCalculator() 
     
    218221 
    219222        try: 
    220             params, self._extrapolated_data = self._calculator.compute_extrapolation() 
     223            params, self._extrapolated_data, self._extrapolated_fn = \ 
     224                self._calculator.compute_extrapolation() 
    221225        except Exception as e: 
    222226            msg = "Error extrapolating data:\n" 
     
    257261            StatusEvent(status=msg)) 
    258262 
    259     def transform_complete(self, transform=None): 
     263    def transform_complete(self, transforms=None): 
    260264        """ 
    261265        Called from FourierThread when calculation has completed 
    262266        """ 
    263267        self._transform_btn.SetLabel("Transform") 
    264         if transform is None: 
     268        if transforms is None: 
    265269            msg = "Error calculating Transform." 
    266270            if self.transform_type == 'hilbert': 
     
    270274            self._extract_btn.Disable() 
    271275            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] 
    276281        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 
    277289        # Only enable extract params button if a fourier trans. has been done 
    278290        if self.transform_type == 'fourier': 
     
    286298        """ 
    287299        try: 
    288             params = self._calculator.extract_parameters(self._transformed_data) 
     300            params = self._calculator.extract_parameters(self._transformed_data[0]) 
    289301        except: 
    290302            params = None 
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    r7432acb r457f735  
    5959        self.q = None 
    6060        self.iq = None 
    61         # TODO: Add extrapolated data and transformed data (when implemented) 
    6261 
    6362    def __str__(self): 
  • src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst

    r1404cce rd78b5cb  
    1010 
    1111This performs a correlation function analysis of one-dimensional 
    12 SAXS/SANS data, or generates a model-independent volume fraction  
     12SAXS/SANS data, or generates a model-independent volume fraction 
    1313profile from the SANS from an adsorbed polymer/surfactant layer. 
    1414 
    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  
     15A correlation function may be interpreted in terms of an imaginary rod moving 
     16through the structure of the material. Γ\ :sub:`1D`\ (R) is the probability that 
     17a rod of length R moving through the material has equal electron/neutron scattering 
     18length density at either end. Hence a frequently occurring spacing within a structure 
    1919manifests itself as a peak. 
    2020 
     
    3030*  Fourier / Hilbert Transform of the smoothed data to give the correlation 
    3131   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 
    3333   lamellar morphology 
    3434 
     
    7474   :align: center 
    7575 
    76     
     76 
    7777Smoothing 
    7878--------- 
    7979 
    80 The extrapolated data set consists of the Guinier back-extrapolation from Q~0  
     80The extrapolated data set consists of the Guinier back-extrapolation from Q~0 
    8181up 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. 
    8282 
     
    9393    h_i = \frac{1}{1 + \frac{(x_i-b)^2}{(x_i-a)^2}} 
    9494 
    95          
     95 
    9696Transform 
    9797--------- 
     
    102102If "Fourier" is selected for the transform type, the analysis will perform a 
    103103discrete cosine transform on the extrapolated data in order to calculate the 
    104 correlation function 
     1041D correlation function: 
    105105 
    106106.. math:: 
     
    115115    \left(n + \frac{1}{2} \right) k \right] } \text{ for } k = 0, 1, \ldots, 
    116116    N-1, N 
     117 
     118The 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 
    117123 
    118124Hilbert 
     
    165171.. figure:: profile1.png 
    166172   :align: center 
    167   
     173 
    168174.. figure:: profile2.png 
    169175   :align: center 
    170     
     176 
    171177 
    172178References 
     
    191197----- 
    192198Upon 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  
     199the background value), along with a *red* bar indicating the *upper end of the 
    194200low-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 
    195201dragging, or by entering appropriate values in the Q range input boxes. 
     
    221227    :align: center 
    222228 
    223          
     229 
    224230.. note:: 
    225231    This help document was last changed by Steve King, 08Oct2016 
  • src/sas/sasgui/perspectives/corfunc/plot_labels.py

    r1dc8ec9 r7dda833  
    44 
    55GROUP_ID_TRANSFORM = r"$\Gamma(x)$" 
    6 TRANSFORM_LABEL1 = r"$\Gamma1(x)$" 
    7 TRANSFORM_LABEL3 = r"$\Gamma3(x)$" 
     6TRANSFORM_LABEL1 = r"$\Gamma_1(x)$" 
     7TRANSFORM_LABEL3 = r"$\Gamma_3(x)$" 
     8 
     9GROUP_ID_IDF = r"$g_1(x)$" 
     10IDF_LABEL = r"$g_1(x)$" 
Note: See TracChangeset for help on using the changeset viewer.