Changeset f80b416e in sasview


Ignore:
Timestamp:
Sep 20, 2017 12:21:41 PM (22 months ago)
Author:
Paul Kienzle <pkienzle@…>
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:
2746eab (diff), ce0a245 (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 ticket-639-katex

Files:
83 added
77 deleted
52 edited

Legend:

Unmodified
Added
Removed
  • docs/sphinx-docs/source/conf.py

    r96f00a0 rf80b416e  
    8080version = '4.1' 
    8181# The full version, including alpha/beta/rc tags. 
    82 release = '4.1.0' 
     82release = '4.1.2' 
    8383 
    8484# The language for content autogenerated by Sphinx. Refer to documentation 
  • sasview/README.txt

    r9146ed9 r6394851  
    441- Features 
    55=========== 
     6    - New in Version 4.1.2 
     7      -------------------- 
     8      This point release is a bug-fix release addressing: 
     9 
     10       - Fixes #984: PDF Reports Generate Empty PDFs 
     11       - Fixes a path typo 
     12       - 64 bit and 32 bit Windows executables now available 
     13 
     14      It is recommended that all users upgrade to this version 
     15 
     16    - New in Version 4.1.1 
     17      -------------------- 
     18      This point release is a bug-fix release addressing: 
     19 
     20       - Fixes #948: Mathjax CDN is going away 
     21       - Fixes #938: Cannot read canSAS1D file output by SasView 
     22       - Fixes #960: Save project throws error if empty fit page 
     23       - Fixes #929: Problem deleting data in first fit page 
     24       - Fixes #918: Test folders not bundled with release 
     25       - Fixes an issue with the live discovery of plugin models 
     26       - Fixes an issue with the NXcanSAS data loader 
     27       - Updated tutorials for SasView 4.x.y 
     28 
    629    - New in Version 4.1.0 
    730      ------------------ 
  • sasview/__init__.py

    r463e7ffc rce2819b  
    1 __version__ = "4.1" 
     1__version__ = "4.1.2" 
    22__build__ = "GIT_COMMIT" 
    33 
  • sasview/local_config.py

    ra1b8fee rce2819b  
    4747'''This work benefited from the use of the SasView application, originally developed under NSF Award DMR-0520547. SasView also contains code developed with funding from the EU Horizon 2020 programme under the SINE2020 project Grant No 654000.''' 
    4848_acknowledgement_citation = \ 
    49 '''M. Doucet et al. SasView Version 4.1, Zenodo, 10.5281/zenodo.438138''' 
     49'''M. Doucet et al. SasView Version 4.1.2, Zenodo, 10.5281/zenodo.825675''' 
    5050 
    5151_acknowledgement =  \ 
  • sasview/sasview.spec

    re42c8e9d r945f45d  
    138138 'sasmodels.core', 
    139139 'pyopencl', 
    140  'tinycc' 
     140 'tinycc', 
     141 'xhtml2pdf' 
    141142] 
    142143 
  • sasview/setup_exe.py

    r5a8cdbb rcd57c7d4  
    179179test_1d_dir = os.path.join(path, "test\\1d_data") 
    180180test_2d_dir = os.path.join(path, "test\\2d_data") 
     181test_sesans_dir = os.path.join(path, "test\\sesans_data") 
     182test_convertible_dir = os.path.join(path, "test\\convertible_files") 
    181183test_save_dir = os.path.join(path, "test\\save_states") 
    182 test_upcoming_dir = os.path.join(path, "test\\upcoming_formats") 
     184test_coord_dir = os.path.join(path, "test\\coordinate_data") 
     185test_image_dir = os.path.join(path, "test\\image_data") 
     186test_other_dir = os.path.join(path, "test\\other_files") 
    183187 
    184188matplotlibdatadir = matplotlib.get_data_path() 
     
    269273# Copying the images directory to the distribution directory. 
    270274for f in findall(images_dir): 
    271     if not ".svn" in f: 
    272         data_files.append(("images", [f])) 
     275    data_files.append(("images", [f])) 
    273276 
    274277# Copying the HTML help docs 
    275278for f in findall(media_dir): 
    276     if not ".svn" in f: 
    277         data_files.append(("media", [f])) 
     279    data_files.append(("media", [f])) 
    278280 
    279281# Copying the sample data user data 
    280282for f in findall(test_1d_dir): 
    281     if not ".svn" in f: 
    282         data_files.append(("test\\1d_data", [f])) 
    283  
    284 # Copying the sample data user data 
     283    data_files.append(("test\\1d_data", [f])) 
    285284for f in findall(test_2d_dir): 
    286     if not ".svn" in f: 
    287         data_files.append(("test\\2d_data", [f])) 
    288  
    289 # Copying the sample data user data 
     285    data_files.append(("test\\2d_data", [f])) 
    290286for f in findall(test_save_dir): 
    291     if not ".svn" in f: 
    292         data_files.append(("test\\save_states", [f])) 
    293  
    294 # Copying the sample data user data 
    295 for f in findall(test_upcoming_dir): 
    296     if not ".svn" in f: 
    297         data_files.append(("test\\upcoming_formats", [f])) 
     287    data_files.append(("test\\save_states", [f])) 
     288for f in findall(test_sesans_dir): 
     289    data_files.append(("test\\sesans_data", [f])) 
     290for f in findall(test_convertible_dir): 
     291    data_files.append(("test\\convertible_files", [f])) 
     292for f in findall(test_coord_dir): 
     293    data_files.append(("test\\coordinate_data", [f])) 
     294for f in findall(test_image_dir): 
     295    data_files.append(("test\\image_data", [f])) 
     296for f in findall(test_other_dir): 
     297    data_files.append(("test\\other_files", [f])) 
    298298 
    299299# Copying opencl include files 
  • src/sas/sascalc/corfunc/corfunc_calculator.py

    rff11b21 ra859f99  
    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 
    134             is complete` 
     143            is complete 
    135144        :param updatefn: The function to call to update the GUI with the status 
    136145            of the transform calculation 
     
    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 ra859f99  
    22from sas.sascalc.dataloader.data_info import Data1D 
    33from scipy.fftpack import dct 
     4from scipy.integrate import trapz, cumtrapz 
    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)]j 
     49            # gamma3.insert(0, 1.0) # Gamma_3(0) is defined as 1 
     50            n = len(xs[mask]) 
     51            gamma3 = cumtrapz(gamma1[:n], xs[:n])/xs[1:n] 
     52            gamma3 = np.hstack((1.0, gamma3)) # Gamma_3(0) is defined as 1 
     53 
     54            if self.check_if_cancelled(): return 
     55 
     56            # ----- Interface Distribution function ----- 
     57            idf = dct(-qs**4 * (iqs-background)) 
     58 
     59            if self.check_if_cancelled(): return 
     60 
     61            # Manually calculate IDF(0.0), since scipy DCT tends to give us a 
     62            # very large negative value. 
     63            # IDF(x) = int_0^inf q^4 * I(q) * cos(q*x) * dq 
     64            # => IDF(0) = int_0^inf q^4 * I(q) * dq 
     65            idf[0] = trapz(-qs**4 * (iqs-background), qs) 
     66            idf /= Q # Normalise using scattering invariant 
     67 
     68        except Exception as e: 
     69            import logging 
     70            logger = logging.getLogger(__name__) 
     71            logger.error(e) 
     72 
    3073            self.update(msg="Fourier transform failed.") 
    31             self.complete(transform=None) 
     74            self.complete(transforms=None) 
    3275            return 
    3376        if self.isquit(): 
     
    3578        self.update(msg="Fourier transform completed.") 
    3679 
    37         xs = np.pi*np.arange(len(qs),dtype=np.float32)/(q[1]-q[0])/len(qs) 
    38         transform = Data1D(xs, gamma) 
     80        transform1 = Data1D(xs, gamma1) 
     81        transform3 = Data1D(xs[xs <= 200], gamma3) 
     82        idf = Data1D(xs, idf) 
    3983 
    40         self.complete(transform=transform) 
     84        transforms = (transform1, transform3, idf) 
     85 
     86        self.complete(transforms=transforms) 
    4187 
    4288class HilbertThread(CalcThread): 
     
    64110        self.update(msg="Hilbert transform completed.") 
    65111 
    66         self.complete(transform=None) 
     112        self.complete(transforms=None) 
  • src/sas/sascalc/dataloader/file_reader_base_class.py

    ra78a02f rae69c690  
    115115                data.y = np.asarray([data.y[i] for i in ind]).astype(np.float64) 
    116116                if data.dx is not None: 
     117                    if len(data.dx) == 0: 
     118                        data.dx = None 
     119                        continue 
    117120                    data.dx = np.asarray([data.dx[i] for i in ind]).astype(np.float64) 
    118121                if data.dxl is not None: 
     
    121124                    data.dxw = np.asarray([data.dxw[i] for i in ind]).astype(np.float64) 
    122125                if data.dy is not None: 
     126                    if len(data.dy) == 0: 
     127                        data.dy = None 
     128                        continue 
    123129                    data.dy = np.asarray([data.dy[i] for i in ind]).astype(np.float64) 
    124130                if data.lam is not None: 
     
    185191        self.output = [] 
    186192 
    187     def remove_empty_q_values(self, has_error_dx=False, has_error_dy=False): 
     193    def remove_empty_q_values(self, has_error_dx=False, has_error_dy=False, 
     194                              has_error_dxl=False, has_error_dxw=False): 
    188195        """ 
    189196        Remove any point where Q == 0 
     
    192199        self.current_dataset.x = self.current_dataset.x[x != 0] 
    193200        self.current_dataset.y = self.current_dataset.y[x != 0] 
    194         self.current_dataset.dy = self.current_dataset.dy[x != 0] if \ 
    195             has_error_dy else np.zeros(len(self.current_dataset.y)) 
    196         self.current_dataset.dx = self.current_dataset.dx[x != 0] if \ 
    197             has_error_dx else np.zeros(len(self.current_dataset.x)) 
     201        if has_error_dy: 
     202            self.current_dataset.dy = self.current_dataset.dy[x != 0] 
     203        if has_error_dx: 
     204            self.current_dataset.dx = self.current_dataset.dx[x != 0] 
     205        if has_error_dxl: 
     206            self.current_dataset.dxl = self.current_dataset.dxl[x != 0] 
     207        if has_error_dxw: 
     208            self.current_dataset.dxw = self.current_dataset.dxw[x != 0] 
    198209 
    199210    def reset_data_list(self, no_lines=0): 
     
    204215        x = np.zeros(no_lines) 
    205216        y = np.zeros(no_lines) 
     217        dx = np.zeros(no_lines) 
    206218        dy = np.zeros(no_lines) 
    207         dx = np.zeros(no_lines) 
    208219        self.current_dataset = plottable_1D(x, y, dx, dy) 
    209220 
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    ra78a02f rae69c690  
    130130                self.current_datainfo.meta_data[PREPROCESS] = self.processing_instructions 
    131131                self._parse_entry(entry) 
    132                 has_error_dx = self.current_dataset.dx is not None 
    133                 has_error_dy = self.current_dataset.dy is not None 
    134                 self.remove_empty_q_values(has_error_dx=has_error_dx, 
    135                     has_error_dy=has_error_dy) 
    136                 self.send_to_output() # Combine datasets with DataInfo 
    137                 self.current_datainfo = DataInfo() # Reset DataInfo 
     132                self.data_cleanup() 
    138133        except FileContentsException as fc_exc: 
    139134            # File doesn't meet schema - try loading with a less strict schema 
     
    154149                    self.load_file_and_schema(xml_file) # Reload strict schema so we can find where error are in file 
    155150                    invalid_xml = self.find_invalid_xml() 
    156                     invalid_xml = INVALID_XML.format(basename + self.extension) + invalid_xml 
    157                     raise DataReaderException(invalid_xml) # Handled by base class 
     151                    if invalid_xml != "": 
     152                        invalid_xml = INVALID_XML.format(basename + self.extension) + invalid_xml 
     153                        raise DataReaderException(invalid_xml) # Handled by base class 
    158154                except FileContentsException as fc_exc: 
    159155                    msg = "CanSAS Reader could not load the file {}".format(xml_file) 
     
    279275                # I and Q points 
    280276                elif tagname == 'I' and isinstance(self.current_dataset, plottable_1D): 
    281                     unit_list = unit.split("|") 
    282                     if len(unit_list) > 1: 
    283                         self.current_dataset.yaxis(unit_list[0].strip(), 
    284                                                    unit_list[1].strip()) 
    285                     else: 
    286                         self.current_dataset.yaxis("Intensity", unit) 
     277                    self.current_dataset.yaxis("Intensity", unit) 
    287278                    self.current_dataset.y = np.append(self.current_dataset.y, data_point) 
    288279                elif tagname == 'Idev' and isinstance(self.current_dataset, plottable_1D): 
    289280                    self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 
    290281                elif tagname == 'Q': 
    291                     unit_list = unit.split("|") 
    292                     if len(unit_list) > 1: 
    293                         self.current_dataset.xaxis(unit_list[0].strip(), 
    294                                                    unit_list[1].strip()) 
    295                     else: 
    296                         self.current_dataset.xaxis("Q", unit) 
     282                    self.current_dataset.xaxis("Q", unit) 
    297283                    self.current_dataset.x = np.append(self.current_dataset.x, data_point) 
    298284                elif tagname == 'Qdev': 
    299285                    self.current_dataset.dx = np.append(self.current_dataset.dx, data_point) 
    300286                elif tagname == 'dQw': 
    301                     if self.current_dataset.dxw is None: 
    302                         self.current_dataset.dxw = np.empty(0) 
    303                     self.current_dataset.dxw = np.append(self.current_dataset.dxw, data_point) 
     287                   self.current_dataset.dxw = np.append(self.current_dataset.dxw, data_point) 
    304288                elif tagname == 'dQl': 
    305                     if self.current_dataset.dxl is None: 
    306                         self.current_dataset.dxl = np.empty(0) 
    307289                    self.current_dataset.dxl = np.append(self.current_dataset.dxl, data_point) 
    308290                elif tagname == 'Qmean': 
     
    312294                elif tagname == 'Sesans': 
    313295                    self.current_datainfo.isSesans = bool(data_point) 
     296                    self.current_dataset.xaxis(attr.get('x_axis'), 
     297                                                attr.get('x_unit')) 
     298                    self.current_dataset.yaxis(attr.get('y_axis'), 
     299                                                attr.get('y_unit')) 
    314300                elif tagname == 'yacceptance': 
    315301                    self.current_datainfo.sample.yacceptance = (data_point, unit) 
     
    512498            for error in self.errors: 
    513499                self.current_datainfo.errors.add(error) 
    514             self.errors.clear() 
    515             self.send_to_output() 
     500            self.data_cleanup() 
     501            self.sort_one_d_data() 
     502            self.sort_two_d_data() 
     503            self.reset_data_list() 
    516504            empty = None 
    517505            return self.output[0], empty 
     506 
     507    def data_cleanup(self): 
     508        """ 
     509        Clean up the data sets and refresh everything 
     510        :return: None 
     511        """ 
     512        has_error_dx = self.current_dataset.dx is not None 
     513        has_error_dxl = self.current_dataset.dxl is not None 
     514        has_error_dxw = self.current_dataset.dxw is not None 
     515        has_error_dy = self.current_dataset.dy is not None 
     516        self.remove_empty_q_values(has_error_dx=has_error_dx, 
     517                                   has_error_dxl=has_error_dxl, 
     518                                   has_error_dxw=has_error_dxw, 
     519                                   has_error_dy=has_error_dy) 
     520        self.send_to_output()  # Combine datasets with DataInfo 
     521        self.current_datainfo = DataInfo()  # Reset DataInfo 
    518522 
    519523    def _is_call_local(self): 
     
    642646                    value_unit = local_unit 
    643647            except KeyError: 
    644                 err_msg = "CanSAS reader: unexpected " 
    645                 err_msg += "\"{0}\" unit [{1}]; " 
    646                 err_msg = err_msg.format(tagname, local_unit) 
    647                 err_msg += "expecting [{0}]".format(default_unit) 
     648                # Do not throw an error for loading Sesans data in cansas xml 
     649                # This is a temporary fix. 
     650                if local_unit != "A" and local_unit != 'pol': 
     651                    err_msg = "CanSAS reader: unexpected " 
     652                    err_msg += "\"{0}\" unit [{1}]; " 
     653                    err_msg = err_msg.format(tagname, local_unit) 
     654                    err_msg += "expecting [{0}]".format(default_unit) 
    648655                value_unit = local_unit 
    649656            except: 
     
    675682            di_exists = True 
    676683        if dqw_exists and not dql_exists: 
    677             array_size = self.current_dataset.dxw.size - 1 
    678             self.current_dataset.dxl = np.append(self.current_dataset.dxl, 
    679                                                  np.zeros([array_size])) 
     684            array_size = self.current_dataset.dxw.size 
     685            self.current_dataset.dxl = np.zeros(array_size) 
    680686        elif dql_exists and not dqw_exists: 
    681             array_size = self.current_dataset.dxl.size - 1 
    682             self.current_dataset.dxw = np.append(self.current_dataset.dxw, 
    683                                                  np.zeros([array_size])) 
     687            array_size = self.current_dataset.dxl.size 
     688            self.current_dataset.dxw = np.zeros(array_size) 
    684689        elif not dql_exists and not dqw_exists and not dq_exists: 
    685             array_size = self.current_dataset.x.size - 1 
     690            array_size = self.current_dataset.x.size 
    686691            self.current_dataset.dx = np.append(self.current_dataset.dx, 
    687692                                                np.zeros([array_size])) 
    688693        if not di_exists: 
    689             array_size = self.current_dataset.y.size - 1 
     694            array_size = self.current_dataset.y.size 
    690695            self.current_dataset.dy = np.append(self.current_dataset.dy, 
    691696                                                np.zeros([array_size])) 
     
    857862            node.append(point) 
    858863            self.write_node(point, "Q", datainfo.x[i], 
    859                             {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
     864                            {'unit': datainfo.x_unit}) 
    860865            if len(datainfo.y) >= i: 
    861866                self.write_node(point, "I", datainfo.y[i], 
    862                                 {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 
     867                                {'unit': datainfo.y_unit}) 
    863868            if datainfo.dy is not None and len(datainfo.dy) > i: 
    864869                self.write_node(point, "Idev", datainfo.dy[i], 
    865                                 {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 
     870                                {'unit': datainfo.y_unit}) 
    866871            if datainfo.dx is not None and len(datainfo.dx) > i: 
    867872                self.write_node(point, "Qdev", datainfo.dx[i], 
    868                                 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
     873                                {'unit': datainfo.x_unit}) 
    869874            if datainfo.dxw is not None and len(datainfo.dxw) > i: 
    870875                self.write_node(point, "dQw", datainfo.dxw[i], 
    871                                 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
     876                                {'unit': datainfo.x_unit}) 
    872877            if datainfo.dxl is not None and len(datainfo.dxl) > i: 
    873878                self.write_node(point, "dQl", datainfo.dxl[i], 
    874                                 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 
     879                                {'unit': datainfo.x_unit}) 
    875880        if datainfo.isSesans: 
    876             sesans = self.create_element("Sesans") 
     881            sesans_attrib = {'x_axis': datainfo._xaxis, 
     882                             'y_axis': datainfo._yaxis, 
     883                             'x_unit': datainfo.x_unit, 
     884                             'y_unit': datainfo.y_unit} 
     885            sesans = self.create_element("Sesans", attrib=sesans_attrib) 
    877886            sesans.text = str(datainfo.isSesans) 
    878             node.append(sesans) 
    879             self.write_node(node, "yacceptance", datainfo.sample.yacceptance[0], 
     887            entry_node.append(sesans) 
     888            self.write_node(entry_node, "yacceptance", datainfo.sample.yacceptance[0], 
    880889                             {'unit': datainfo.sample.yacceptance[1]}) 
    881             self.write_node(node, "zacceptance", datainfo.sample.zacceptance[0], 
     890            self.write_node(entry_node, "zacceptance", datainfo.sample.zacceptance[0], 
    882891                             {'unit': datainfo.sample.zacceptance[1]}) 
    883892 
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    rdcb91cf rcd57c7d4  
    140140 
    141141            if isinstance(value, h5py.Group): 
     142                # Set parent class before recursion 
    142143                self.parent_class = class_name 
    143144                parent_list.append(key) 
     
    150151                # Recursion step to access data within the group 
    151152                self.read_children(value, parent_list) 
     153                # Reset parent class when returning from recursive method 
     154                self.parent_class = class_name 
    152155                self.add_intermediate() 
    153156                parent_list.remove(key) 
  • src/sas/sascalc/dataloader/readers/xml_reader.py

    rfafe52a rcd57c7d4  
    134134            first_error = schema.assertValid(self.xmldoc) 
    135135        except etree.DocumentInvalid as err: 
     136            # Suppress errors for <'any'> elements 
     137            if "##other" in str(err): 
     138                return first_error 
    136139            first_error = str(err) 
    137140        return first_error 
  • src/sas/sascalc/invariant/invariant.py

    r7432acb rb1f20d1  
    610610        # Data boundaries for fitting 
    611611        qmin = self._data.x[0] 
    612         qmax = self._data.x[self._low_extrapolation_npts - 1] 
     612        qmax = self._data.x[int(self._low_extrapolation_npts - 1)] 
    613613 
    614614        # Extrapolate the low-Q data 
     
    649649        # Data boundaries for fitting 
    650650        x_len = len(self._data.x) - 1 
    651         qmin = self._data.x[x_len - (self._high_extrapolation_npts - 1)] 
    652         qmax = self._data.x[x_len] 
     651        qmin = self._data.x[int(x_len - (self._high_extrapolation_npts - 1))] 
     652        qmax = self._data.x[int(x_len)] 
    653653 
    654654        # fit the data with a model to get the appropriate parameters 
     
    688688        if npts_in is None: 
    689689            npts_in = self._low_extrapolation_npts 
    690         q_end = self._data.x[max(0, npts_in - 1)] 
     690        q_end = self._data.x[max(0, int(npts_in - 1))] 
    691691 
    692692        if q_start >= q_end: 
     
    714714        # Get extrapolation range 
    715715        if npts_in is None: 
    716             npts_in = self._high_extrapolation_npts 
     716            npts_in = int(self._high_extrapolation_npts) 
    717717        _npts = len(self._data.x) 
    718         q_start = self._data.x[min(_npts, _npts - npts_in)] 
     718        q_start = self._data.x[min(_npts, int(_npts - npts_in))] 
    719719 
    720720        if q_start >= q_end: 
  • src/sas/sasgui/guiframe/config.py

    rf2ea95a rf80b416e  
    4848'''This work benefited from the use of the SasView application, originally developed under NSF Award DMR-0520547. SasView also contains code developed with funding from the EU Horizon 2020 programme under the SINE2020 project Grant No 654000.''' 
    4949_acknowledgement_citation = \ 
    50 '''M. Doucet et al. SasView Version 4.1, Zenodo, 10.5281/zenodo.438138''' 
     50'''M. Doucet et al. SasView Version 4.1.2, Zenodo, 10.5281/zenodo.825675''' 
    5151 
    5252_acknowledgement =  \ 
  • src/sas/sasgui/guiframe/documentation_window.py

    r2746eab rf80b416e  
    9999        elif not os.path.exists(file_path): 
    100100            url = "index.html" 
    101             logger.error("Could not find Sphinx documentation at %s \ 
    102             -- has it been built?", file_path) 
     101            logger.error("Could not find Sphinx documentation at %s -- has it been built?", 
     102                        file_path) 
    103103        elif False: 
    104104            start_documentation_server(docs_path, port=7999) 
     
    107107            url = "file:///" + urllib.quote(file_path, r'/\:')+ url_instruction 
    108108 
    109         logger.info("showing url " + url) 
     109        #logger.info("showing url " + url) 
    110110        if WX_SUPPORTS_HTML2: 
    111111            # Complete HTML/CSS support! 
  • 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 r2a399ca  
    2020 
    2121OUTPUT_STRINGS = { 
    22     'max': "Long Period (A): ", 
     22    'max': "Long Period / 2 (A): ", 
    2323    'Lc': "Average Hard Block Thickness (A): ", 
    2424    'dtr': "Average Interface Thickness (A): ", 
     
    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 r2a399ca  
    2828# List of output parameters, used by __str__ 
    2929output_list = [ 
    30     ['max', "Long Period (A): "], 
     30    ['max', "Long Period / 2 (A): "], 
    3131    ['Lc', "Average Hard Block Thickness (A): "], 
    3232    ['dtr', "Average Interface Thickness (A): "], 
     
    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

    r6aad2e8 rf80b416e  
    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)$" 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    rdfc9604 rf80b416e  
    18411841            if models.name != "NoStructure": 
    18421842                mlist.append((models.name, models)) 
    1843  
    18441843        # Sort the models 
    18451844        mlist_sorted = sorted(mlist) 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    r0b6f83c r13374be  
    11561156                copy_flag = self.get_copy_params() 
    11571157                is_poly_enabled = self.enable_disp.GetValue() 
    1158  
    1159         self._on_select_model_helper() 
     1158        try: 
     1159            self._on_select_model_helper() 
     1160        except Exception as e: 
     1161            evt = StatusEvent(status=e.message, info="error") 
     1162            wx.PostEvent(self._manager.parent, evt) 
     1163            # Set S(Q) to None 
     1164            self.structurebox.SetSelection(0) 
     1165            self._on_select_model() 
     1166            return 
    11601167        self.set_model_param_sizer(self.model) 
    11611168        if self.model is None: 
     
    12361243            wx.PostEvent(self.parent, new_event) 
    12371244            # update list of plugins if new plugin is available 
    1238             custom_model = CUSTOM_MODEL 
    12391245            mod_cat = self.categorybox.GetStringSelection() 
    1240             if mod_cat == custom_model: 
     1246            if mod_cat == CUSTOM_MODEL: 
     1247                temp_id = self.model.id 
    12411248                temp = self.parent.update_model_list() 
     1249                for v in self.parent.model_dictionary.values(): 
     1250                    if v.id == temp_id: 
     1251                        self.model = v() 
     1252                        break 
    12421253                if temp: 
    12431254                    self.model_list_box = temp 
  • src/sas/sasgui/perspectives/fitting/fitpanel.py

    r6f9abd3 r13374be  
    9292            # state must be cloned 
    9393            state = page.get_state().clone() 
    94             if data is not None or page.model is not None: 
     94            # data_list only populated with real data 
     95            # Fake object in data from page.get_data() if model is selected 
     96            if len(page.data_list) is not 0 and page.model is not None: 
    9597                new_doc = self._manager.state_reader.write_toXML(data, 
    9698                                                                 state, 
    9799                                                                 batch_state) 
     100                # Fit #2 through #n are append to first fit 
    98101                if doc is not None and hasattr(doc, "firstChild"): 
    99                     child = new_doc.firstChild.firstChild 
    100                     doc.firstChild.appendChild(child) 
     102                    # Only append if properly formed new_doc 
     103                    if new_doc is not None and hasattr(new_doc, "firstChild"): 
     104                        child = new_doc.firstChild.firstChild 
     105                        doc.firstChild.appendChild(child) 
     106                # First fit defines the main document 
    101107                else: 
    102108                    doc = new_doc 
     
    395401                temp_data = page.get_data() 
    396402                if temp_data is not None and temp_data.id in data: 
    397                     self.SetSelection(pos) 
    398                     self.on_close_page(event=None) 
    399                     temp = self.GetSelection() 
    400                     self.DeletePage(temp) 
     403                    self.close_page_with_data(temp_data) 
    401404            if self.sim_page is not None: 
    402405                if len(self.sim_page.model_list) == 0: 
     
    404407                    self.SetSelection(pos) 
    405408                    self.on_close_page(event=None) 
    406                     temp = self.GetSelection() 
    407                     self.DeletePage(temp) 
     409                    self.DeletePage(pos) 
    408410                    self.sim_page = None 
    409411                    self.batch_on = False 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r5c1c486 r66acafe  
    357357                            else: 
    358358                                page.formfactorbox.SetLabel(current_val) 
     359                        if hasattr(page, 'structurebox'): 
     360                            selected_name = page.structurebox.GetStringSelection() 
     361 
     362                            page.structurebox.Clear() 
     363                            page.initialize_combox() 
     364 
     365                            index = page.structurebox.FindString(selected_name) 
     366                            if index == -1: 
     367                                index = 0 
     368                            page.structurebox.SetSelection(index) 
     369                            page._on_select_model() 
    359370        except: 
    360371            logger.error("update_custom_combo: %s", sys.exc_value) 
  • src/sas/sasgui/perspectives/fitting/models.py

    rb1c2011 r13374be  
    1414import py_compile 
    1515import shutil 
     16from copy import copy 
    1617# Explicitly import from the pluginmodel module so that py2exe 
    1718# places it in the distribution. The Model1DPlugin class is used 
     
    2021from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    2122from sasmodels.sasview_model import load_custom_model, load_standard_models 
     23from sas.sasgui.perspectives.fitting.fitpage import CUSTOM_MODEL 
    2224 
    2325logger = logging.getLogger(__name__) 
     
    265267        temp = {} 
    266268        if self.is_changed(): 
    267             return  _find_models() 
     269            temp =  _find_models() 
     270            self.last_time_dir_modified = time.time() 
     271            return temp 
    268272        logger.info("plugin model : %s" % str(temp)) 
    269273        return temp 
     
    278282        """ 
    279283 
    280         # regular model names only 
     284        # Regular model names only 
    281285        self.model_name_list = [] 
    282286 
    283         #Build list automagically from sasmodels package 
     287        # Build list automagically from sasmodels package 
    284288        for model in load_standard_models(): 
    285289            self.model_dictionary[model.name] = model 
     
    293297                self.model_name_list.append(model.name) 
    294298 
    295         #Looking for plugins 
     299        # Looking for plugins 
    296300        self.stored_plugins = self.findModels() 
    297301        self.plugins = self.stored_plugins.values() 
    298302        for name, plug in self.stored_plugins.iteritems(): 
    299303            self.model_dictionary[name] = plug 
     304            # TODO: Remove 'hasattr' statements when old style plugin models 
     305            # are no longer supported. All sasmodels models will have 
     306            # the required attributes. 
     307            if hasattr(plug, 'is_structure_factor') and plug.is_structure_factor: 
     308                self.struct_list.append(plug) 
     309                self.plugins.remove(plug) 
     310            elif hasattr(plug, 'is_form_factor') and plug.is_form_factor: 
     311                self.multiplication_factor.append(plug) 
     312            if hasattr(plug, 'is_multiplicity_model') and plug.is_multiplicity_model: 
     313                self.multi_func_list.append(plug) 
    300314 
    301315        self._get_multifunc_models() 
     
    312326        if os.path.isdir(plugin_dir): 
    313327            temp = os.path.getmtime(plugin_dir) 
    314             if  self.last_time_dir_modified != temp: 
     328            if  self.last_time_dir_modified < temp: 
    315329                is_modified = True 
    316330                self.last_time_dir_modified = temp 
     
    323337        new models were added else return empty dictionary 
    324338        """ 
     339        self.plugins = [] 
    325340        new_plugins = self.findModels() 
    326         if len(new_plugins) > 0: 
    327             for name, plug in  new_plugins.iteritems(): 
    328                 if name not in self.stored_plugins.keys(): 
    329                     self.stored_plugins[name] = plug 
    330                     self.plugins.append(plug) 
    331                     self.model_dictionary[name] = plug 
    332             self.model_combobox.set_list("Plugin Models", self.plugins) 
     341        if new_plugins: 
     342            for name, plug in  new_plugins.items(): 
     343                self.stored_plugins[name] = plug 
     344                self.plugins.append(plug) 
     345                self.model_dictionary[name] = plug 
     346            self.model_combobox.set_list(CUSTOM_MODEL, self.plugins) 
    333347            return self.model_combobox.get_list() 
    334348        else: 
     
    340354        """ 
    341355        self.plugins = [] 
    342         new_plugins = _find_models() 
    343         for name, plug in  new_plugins.iteritems(): 
    344             for stored_name, stored_plug in self.stored_plugins.iteritems(): 
    345                 if name == stored_name: 
    346                     del self.stored_plugins[name] 
    347                     del self.model_dictionary[name] 
    348                     break 
     356        self.stored_plugins = _find_models() 
     357        structure_names = [model.name for model in self.struct_list] 
     358        form_names = [model.name for model in self.multiplication_factor] 
     359 
     360        # Remove all plugin structure factors and form factors 
     361        for name in copy(structure_names): 
     362            if '[plug-in]' in name: 
     363                i = structure_names.index(name) 
     364                del self.struct_list[i] 
     365                structure_names.remove(name) 
     366        for name in copy(form_names): 
     367            if '[plug-in]' in name: 
     368                i = form_names.index(name) 
     369                del self.multiplication_factor[i] 
     370                form_names.remove(name) 
     371 
     372        # Add new plugin structure factors and form factors 
     373        for name, plug in self.stored_plugins.iteritems(): 
     374            if plug.is_structure_factor: 
     375                if name in structure_names: 
     376                    # Delete the old model from self.struct list 
     377                    i = structure_names.index(name) 
     378                    del self.struct_list[i] 
     379                # Add the new model to self.struct_list 
     380                self.struct_list.append(plug) 
     381            elif plug.is_form_factor: 
     382                if name in form_names: 
     383                    # Delete the old model from self.multiplication_factor 
     384                    i = form_names.index(name) 
     385                    del self.multiplication_factor[i] 
     386                # Add the new model to self.multiplication_factor 
     387                self.multiplication_factor.append(plug) 
     388 
     389            # Add references to the updated model 
    349390            self.stored_plugins[name] = plug 
    350             self.plugins.append(plug) 
     391            if not plug.is_structure_factor: 
     392                # Don't show S(Q) models in the 'Plugin Models' dropdown 
     393                self.plugins.append(plug) 
    351394            self.model_dictionary[name] = plug 
    352395 
    353396        self.model_combobox.reset_list("Plugin Models", self.plugins) 
     397        self.model_combobox.reset_list("Structure Factors", self.struct_list) 
     398        self.model_combobox.reset_list("P(Q)*S(Q)", self.multiplication_factor) 
     399 
    354400        return self.model_combobox.get_list() 
    355401 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    r959eb01 rda9b239  
    617617            value = "" 
    618618            content = line.split(":") 
     619            if line == '' or len(content) == 1: 
     620                continue 
    619621            name = content[0] 
    620622            try: 
  • test/corfunc/test/utest_corfunc.py

    r968d67e r86ba9d6  
    22Unit Tests for CorfuncCalculator class 
    33""" 
     4from __future__ import division, print_function 
    45 
    56import unittest 
    67import time 
     8 
    79import numpy as np 
     10 
    811from sas.sascalc.corfunc.corfunc_calculator import CorfuncCalculator 
    912from sas.sascalc.dataloader.data_info import Data1D 
     
    1417    def setUp(self): 
    1518        self.data = load_data() 
     19        # Note: to generate target values from the GUI: 
     20        # * load the data from test/corfunc/test/98929.txt 
     21        # * set qrange to (0, 0.013), (0.15, 0.24) 
     22        # * select fourier transform type 
     23        # * click Calculate Bg 
     24        # * click Extrapolate 
     25        # * click Compute Parameters 
     26        # * copy the Guinier and Porod values to the extrapolate function 
     27        # * for each graph, grab the data from DataInfo and store it in _out.txt 
    1628        self.calculator = CorfuncCalculator(data=self.data, lowerq=0.013, 
    1729            upperq=(0.15, 0.24)) 
     30        self.calculator.background = 0.3 
    1831        self.extrapolation = None 
    1932        self.transformation = None 
     33        self.results = [np.loadtxt(filename+"_out.txt").T[2] 
     34                        for filename in ("gamma1", "gamma3", "idf")] 
    2035 
    2136    def extrapolate(self): 
    22         params, extrapolation = self.calculator.compute_extrapolation() 
    23  
     37        params, extrapolation, s2 = self.calculator.compute_extrapolation() 
    2438        # Check the extrapolation parameters 
    25         self.assertAlmostEqual(params['A'], 4.19, places=2) 
    26         self.assertAlmostEqual(params['B'], -25470, places=0) 
    27         self.assertAlmostEqual(params['K'], 4.5e-5, places=2) 
    28         self.assertAlmostEqual(params['sigma'], 2.2e-10, places=2) 
     39        self.assertAlmostEqual(params['A'], 4.18970, places=5) 
     40        self.assertAlmostEqual(params['B'], -25469.9, places=1) 
     41        self.assertAlmostEqual(params['K'], 4.44660e-5, places=10) 
     42        #self.assertAlmostEqual(params['sigma'], 1.70181e-10, places=15) 
    2943 
    3044        # Ensure the extraplation tends to the background value 
     
    5872                break 
    5973 
    60     def transform_callback(self, transform): 
    61         self.assertIsNotNone(transform) 
    62         self.assertAlmostEqual(transform.y[0], 1) 
    63         self.assertAlmostEqual(transform.y[-1], 0, 5) 
    64         self.transformation = transform 
     74    def transform_callback(self, transforms): 
     75        transform1, transform3, idf = transforms 
     76        self.assertIsNotNone(transform1) 
     77        self.assertAlmostEqual(transform1.y[0], 1) 
     78        self.assertAlmostEqual(transform1.y[-1], 0, 5) 
     79        self.transformation = transforms 
    6580 
    6681    def extract_params(self): 
    67         params = self.calculator.extract_parameters(self.transformation) 
     82        params = self.calculator.extract_parameters(self.transformation[0]) 
    6883        self.assertIsNotNone(params) 
    6984        self.assertEqual(len(params), 6) 
    7085        self.assertLess(abs(params['max']-75), 2.5) # L_p ~= 75 
    7186 
     87    def check_transforms(self): 
     88        gamma1, gamma3, idf = self.transformation 
     89        gamma1_out, gamma3_out, idf_out = self.results 
     90        def compare(a, b): 
     91            return max(abs((a-b)/b)) 
     92        #print("gamma1 diff", compare(gamma1.y[gamma1.x<=200.], gamma1_out)) 
     93        #print("gamma3 diff", compare(gamma3.y[gamma3.x<=200.], gamma3_out)) 
     94        #print("idf diff", compare(idf.y[idf.x<=200.], idf_out)) 
     95        #self.assertLess(compare(gamma1.y[gamma1.x<=200.], gamma1_out), 1e-10) 
     96        #self.assertLess(compare(gamma3.y[gamma3.x<=200.], gamma3_out), 1e-10) 
     97        #self.assertLess(compare(idf.y[idf.x<=200.], idf_out), 1e-10) 
     98 
    7299    # Ensure tests are ran in correct order; 
    73100    # Each test depends on the one before it 
    74101    def test_calculator(self): 
    75         steps = [self.extrapolate, self.transform, self.extract_params] 
     102        steps = [self.extrapolate, self.transform, self.extract_params, self.check_transforms] 
    76103        for test in steps: 
    77104            try: 
    78105                test() 
    79106            except Exception as e: 
     107                raise 
    80108                self.fail("{} failed ({}: {})".format(test, type(e), e)) 
    81109 
    82110 
    83111def load_data(filename="98929.txt"): 
    84     data = np.loadtxt(filename, dtype=np.float32) 
     112    data = np.loadtxt(filename, dtype=np.float64) 
    85113    q = data[:,0] 
    86114    iq = data[:,1] 
  • test/sasdataloader/test/utest_abs_reader.py

    ra78a02f rae69c690  
    333333        self.assertEqual(self.data.x[1], 0.03) 
    334334        self.assertAlmostEquals(self.data.y[1], 1001.0) 
    335         self.assertEqual(self.data.dx[0], 0.0) 
    336335        self.assertEqual(self.data.dxl[1], 0.005) 
    337336        self.assertEqual(self.data.dxw[1], 0.001) 
  • test/utest_sasview.py

    rb54440d rbe51cf6  
    6262                    proc = subprocess.Popen(code, shell=True, stdout=subprocess.PIPE, stderr = subprocess.STDOUT) 
    6363                    std_out, std_err = proc.communicate() 
    64                     #print std_out 
     64                    #print(">>>>>> standard out", file_path, "\n", std_out, "\n>>>>>>>>> end stdout", file_path) 
    6565                    #sys.exit() 
    6666                    m = re.search("Ran ([0-9]+) test", std_out) 
     
    8282                        failed += 1 
    8383                        print("Result for %s (%s): FAILED" % (module_name, module_dir)) 
    84                         print(std_out) 
     84                        #print(std_out) 
    8585                    else: 
    8686                        passed += 1 
  • .gitignore

    recdd132 re9df8a5  
    4949/docs/sphinx-docs/source/user/perspectives 
    5050/docs/sphinx-docs/source/user/sasgui 
     51/docs/sphinx-docs/katex*.zip 
    5152 
    5253 
  • build_tools/jenkins_linux_build.sh

    r128c287 r1573220  
    6363$PYTHON setup.py build docs bdist_egg 
    6464 
     65# CREATE PDF FROM LATEX 
     66#cd $WORKSPACE 
     67#cd sasview/docs/sphinx-docs/build/latex 
     68#pdflatex SasView.tex 
    6569 
    6670# INSTALL SASVIEW 
  • docs/sphinx-docs/Makefile

    r1d5f5c2 r3194371  
    1616PAPEROPT_a4     = -D latex_paper_size=a4 
    1717PAPEROPT_letter = -D latex_paper_size=letter 
    18 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 
     18ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source-temp 
    1919# the i18n builder cannot share the environment and doctrees with the others 
    2020I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 
     
    5353        rm -rf source/dev/api 
    5454        sphinx-apidoc -o source/dev/api -d 8 ../../src 
    55          
     55 
    5656html: stubs 
    5757        $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 
  • docs/sphinx-docs/build_sphinx.py

    r4abc05d8 r6e546f8  
    1818from distutils.dir_util import copy_tree 
    1919from distutils.util import get_platform 
     20from distutils.spawn import find_executable 
     21 
    2022from shutil import copy 
    2123from os import listdir 
     
    324326        print("!!!!NO MODEL DOCS WILL BE BUILT!!!!") 
    325327 
    326  
    327328def retrieve_bumps_docs(): 
    328329    """ 
     
    360361                     SASVIEW_BUILD]) 
    361362 
     363def build_pdf(): 
     364    """ 
     365    Runs sphinx-build for pdf.  Reads in all .rst files and spits out the final html. 
     366    """ 
     367    print("=== Build PDF Docs from ReST Files ===") 
     368    subprocess.call(["sphinx-build", 
     369                     "-b", "latex", # Builder name. TODO: accept as arg to setup.py. 
     370                     "-d", os.path.join(SPHINX_BUILD, "doctrees"), 
     371                     SPHINX_SOURCE, 
     372                     os.path.join(SPHINX_BUILD, "latex")]) 
     373 
     374    LATEXDIR = os.path.join(SPHINX_BUILD, "latex") 
     375    #TODO: Does it need to be done so many time? 
     376    def pdflatex(): 
     377        subprocess.call(["pdflatex", "SasView.tex"], cwd=LATEXDIR) 
     378    pdflatex() 
     379    pdflatex() 
     380    pdflatex() 
     381    subprocess.call(["makeindex", "-s", "python.ist", "SasView.idx"], cwd=LATEXDIR) 
     382    pdflatex() 
     383    pdflatex() 
     384 
     385    print("=== Copy PDF to HTML Directory ===") 
     386    source = os.path.join(LATEXDIR, "SasView.pdf") 
     387    target = os.path.join(SASVIEW_DOCS, "SasView.pdf") 
     388    shutil.copyfile(source, target) 
     389 
    362390def build(): 
    363391    """ 
    364392    Runs sphinx-build.  Reads in all .rst files and spits out the final html. 
    365393    """ 
    366     print("=== Build HTML Docs from Rest Files ===") 
     394    print("=== Build HTML Docs from ReST Files ===") 
    367395    subprocess.call(["sphinx-build", 
    368396                     "-b", "html", # Builder name. TODO: accept as arg to setup.py. 
     
    375403    copy_tree(html, SASVIEW_DOCS) 
    376404 
     405def fetch_katex(version, destination="_static"): 
     406    from zipfile import ZipFile 
     407    import urllib2 
     408    url = "https://github.com/Khan/KaTeX/releases/download/%s/katex.zip" % version 
     409    cache_path = "katex_%s.zip" % version 
     410    if not os.path.exists(cache_path): 
     411        try: 
     412            fd_in = urllib2.urlopen(url) 
     413            with open(cache_path, "wb") as fd_out: 
     414                fd_out.write(fd_in.read()) 
     415        finally: 
     416            fd_in.close() 
     417    with ZipFile(cache_path) as zip: 
     418        zip.extractall(destination) 
     419 
     420def convert_katex(): 
     421    print("=== Preprocess HTML, converting latex to html ===") 
     422    subprocess.call(["node", "convertKaTex.js", SASVIEW_DOCS]) 
     423 
     424def convert_mathjax(): 
     425    print("=== Preprocess HTML, converting latex to html ===") 
     426    subprocess.call(["node", "convertMathJax.js", SASVIEW_DOCS]) 
     427 
     428def fetch_mathjax(): 
     429    subprocess.call(["npm", "install", "mathjax-node-page"]) 
     430    # TODO: copy fonts from node_modules/mathjax/fonts/HTML-CSS/Tex into static 
     431 
    377432def rebuild(): 
    378433    clean() 
     
    380435    retrieve_user_docs() 
    381436    retrieve_bumps_docs() 
     437    #fetch_katex(version=KATEX_VERSION, destination=KATEX_PARENT) 
     438    #fetch_mathjax() 
    382439    apidoc() 
    383440    build() 
     441    if find_executable('latex'): 
     442        build_pdf() 
     443    #convert_katex() 
     444    #convert_mathjax() 
    384445 
    385446    print("=== Done ===") 
  • docs/sphinx-docs/source/rst_prolog

    ra45185c r1659f54  
    11.. Set up some substitutions to make life easier... 
    2 .. Remove |biggamma|, etc. when they are no longer needed. 
    32 
    4  
    5 .. |alpha| unicode:: U+03B1 
    6 .. |beta| unicode:: U+03B2 
    7 .. |gamma| unicode:: U+03B3 
    8 .. |delta| unicode:: U+03B4 
    9 .. |epsilon| unicode:: U+03B5 
    10 .. |zeta| unicode:: U+03B6 
    11 .. |eta| unicode:: U+03B7 
    12 .. |theta| unicode:: U+03B8 
    13 .. |iota| unicode:: U+03B9 
    14 .. |kappa| unicode:: U+03BA 
    15 .. |lambda| unicode:: U+03BB 
    16 .. |mu| unicode:: U+03BC 
    17 .. |nu| unicode:: U+03BD 
    18 .. |xi| unicode:: U+03BE 
    19 .. |omicron| unicode:: U+03BF 
    20 .. |pi| unicode:: U+03C0 
    21 .. |rho| unicode:: U+03C1 
    22 .. |sigma| unicode:: U+03C3 
    23 .. |tau| unicode:: U+03C4 
    24 .. |upsilon| unicode:: U+03C5 
    25 .. |phi| unicode:: U+03C6 
    26 .. |chi| unicode:: U+03C7 
    27 .. |psi| unicode:: U+03C8 
    28 .. |omega| unicode:: U+03C9 
    29  
    30  
    31 .. |biggamma| unicode:: U+0393 
    32 .. |bigdelta| unicode:: U+0394 
    33 .. |bigzeta| unicode:: U+039E 
    34 .. |bigpsi| unicode:: U+03A8 
    35 .. |bigphi| unicode:: U+03A6 
    36 .. |bigsigma| unicode:: U+03A3 
    37 .. |Gamma| unicode:: U+0393 
    38 .. |Delta| unicode:: U+0394 
    39 .. |Zeta| unicode:: U+039E 
    40 .. |Psi| unicode:: U+03A8 
    41  
    42  
    43 .. |drho| replace:: |Delta|\ |rho| 
    443.. |Ang| unicode:: U+212B 
    454.. |Ang^-1| replace:: |Ang|\ :sup:`-1` 
     
    5716.. |cm^-3| replace:: cm\ :sup:`-3` 
    5817.. |sr^-1| replace:: sr\ :sup:`-1` 
    59 .. |P0| replace:: P\ :sub:`0`\ 
    60 .. |A2| replace:: A\ :sub:`2`\ 
    61  
    62  
    63 .. |equiv| unicode:: U+2261 
    64 .. |noteql| unicode:: U+2260 
    65 .. |TM| unicode:: U+2122 
    66  
    6718 
    6819.. |cdot| unicode:: U+00B7 
  • src/sas/sascalc/calculator/sas_gen.py

    ra1b8fee rf2ea95a  
    913913    def set_sldms(self, sld_mx, sld_my, sld_mz): 
    914914        r""" 
    915         Sets (\|m\|, m_theta, m_phi) 
    916         """ 
     915        Sets mx, my, mz and abs(m). 
     916        """ # Note: escaping 
    917917        if sld_mx.__class__.__name__ == 'float': 
    918918            self.sld_mx = np.ones(len(self.pos_x)) * sld_mx 
  • src/sas/sascalc/realspace/__init__.py

    r959eb01 rf2ea95a  
    11""" 
    22    Real-Space Modeling for SAS 
    3 """  
     3""" 
    44## \mainpage Real-Space Modeling for SAS 
    55# 
    66# \section intro_sec Introduction 
    7 # This module provides SAS scattering intensity simulation  
     7# This module provides SAS scattering intensity simulation 
    88# based on real-space modeling. 
    99# 
    10 # Documentation can be found here:  
     10# Documentation can be found here: 
    1111#    http://danse.us/trac/sas/wiki/RealSpaceModeling 
    1212# 
     
    3737# 
    3838# \section overview_sec Package Overview 
    39 #  
     39# 
    4040# \subsection class Class Diagram: 
    4141# \image html real-space-class-diagram.png 
    4242# 
    4343# \subsection behav Behavior Enumeration: 
    44 # \image html enum.gif 
     44# \image html enum.png 
    4545# 
    4646# \subsection Tutorial 
     
    7878# \section help_sec Contact Info 
    7979# Code and Documentation by Jing Zhou as part of the DANSE project. 
    80  
  • src/sas/sasgui/guiframe/aboutbox.py

    r959eb01 rf2ea95a  
    3131      (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))): 
    3232        fObj, path, descr = imp.find_module('local_config', [path]) 
    33         config = imp.load_module('local_config', fObj, path, descr)   
     33        config = imp.load_module('local_config', fObj, path, descr) 
    3434    else: 
    3535        # Try simply importing local_config 
    3636        import local_config as config 
    3737except: 
    38     # Didn't find local config, load the default  
     38    # Didn't find local config, load the default 
    3939    import config 
    4040 
     
    4242    """ 
    4343    Launches browser and opens specified url 
    44      
     44 
    4545    In some cases may require BROWSER environment variable to be set up. 
    46      
     46 
    4747    :param url: URL to open 
    48      
     48 
    4949    """ 
    5050    import webbrowser 
     
    5555    """ 
    5656    "About" Dialog 
    57      
     57 
    5858    Shows product name, current version, authors, and link to the product page. 
    5959    Current version is taken from version.py 
    60      
    61     """ 
    62      
     60 
     61    """ 
     62 
    6363    def __init__(self, *args, **kwds): 
    6464 
     
    6666        kwds["style"] = wx.DEFAULT_DIALOG_STYLE 
    6767        wx.Dialog.__init__(self, *args, **kwds) 
    68          
     68 
    6969        file_dir = os.path.dirname(__file__) 
    70          
     70 
    7171        # Mac doesn't display images with transparent background so well, 
    7272        # keep it for Windows 
    7373        image = file_dir + "/images/angles_flat.png" 
    74          
     74 
    7575        if os.path.isfile(config._corner_image): 
    7676            image = config._corner_image 
     
    8080        else: 
    8181            self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image)) 
    82          
     82 
    8383        self.label_title = wx.StaticText(self, -1, config.__appname__) 
    8484        self.label_version = wx.StaticText(self, -1, "") 
     
    112112        #self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap) 
    113113        self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap) 
    114          
     114 
    115115        self.bitmap_button_isis = wx.BitmapButton(self, -1, wx.NullBitmap) 
    116116        self.bitmap_button_ess = wx.BitmapButton(self, -1, wx.NullBitmap) 
     
    119119        self.bitmap_button_tudelft = wx.BitmapButton(self, -1, wx.NullBitmap) 
    120120        self.bitmap_button_dls = wx.BitmapButton(self, -1, wx.NullBitmap) 
    121          
     121 
    122122        self.static_line_3 = wx.StaticLine(self, -1) 
    123123        self.button_OK = wx.Button(self, wx.ID_OK, "OK") 
     
    125125        self.__set_properties() 
    126126        self.__do_layout() 
    127          
     127 
    128128        self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist) 
    129129        self.Bind(wx.EVT_BUTTON, self.onUmdLogo, self.bitmap_button_umd) 
     
    145145        random.shuffle(config._authors) 
    146146        strLabel = ", ".join(config._authors) 
    147          
     147 
    148148        # display version and svn revison numbers 
    149149        verwords = config.__version__.split('.') 
     
    157157        self.label_version.SetLabel(config.__version__)#(version) 
    158158        self.label_svnrevision.SetLabel(build_num) 
    159          
     159 
    160160        # set bitmaps for logo buttons 
    161161        image = file_dir + "/images/nist_logo.png" 
    162162        if os.path.isfile(config._nist_logo): 
    163163            image = config._nist_logo 
    164         logo = wx.Bitmap(image)         
     164        logo = wx.Bitmap(image) 
    165165        self.bitmap_button_nist.SetBitmapLabel(logo) 
    166          
     166 
    167167        image = file_dir + "/images/umd_logo.png" 
    168168        if os.path.isfile(config._umd_logo): 
    169169            image = config._umd_logo 
    170         logo = wx.Bitmap(image)         
     170        logo = wx.Bitmap(image) 
    171171        self.bitmap_button_umd.SetBitmapLabel(logo) 
    172172 
     
    174174        if os.path.isfile(config._ornl_logo): 
    175175            image = config._ornl_logo 
    176         logo = wx.Bitmap(image)         
     176        logo = wx.Bitmap(image) 
    177177        self.bitmap_button_ornl.SetBitmapLabel(logo) 
    178178 
     
    181181        if os.path.isfile(config._sns_logo): 
    182182            image = config._sns_logo 
    183         logo = wx.Bitmap(image)         
     183        logo = wx.Bitmap(image) 
    184184        self.bitmap_button_sns.SetBitmapLabel(logo) 
    185          
     185 
    186186        image = file_dir + "/images/nsf_logo.png" 
    187187        if os.path.isfile(config._nsf_logo): 
    188188            image = config._nsf_logo 
    189         logo = wx.Bitmap(image)         
     189        logo = wx.Bitmap(image) 
    190190        self.bitmap_button_nsf.SetBitmapLabel(logo) 
    191191 
     
    196196        self.bitmap_button_danse.SetBitmapLabel(logo) 
    197197        """ 
    198         image = file_dir + "/images/utlogo.gif" 
     198        image = file_dir + "/images/utlogo.png" 
    199199        if os.path.isfile(config._inst_logo): 
    200200            image = config._inst_logo 
    201201        logo = wx.Bitmap(image) 
    202202        self.bitmap_button_msu.SetBitmapLabel(logo) 
    203          
     203 
    204204        image = file_dir + "/images/isis_logo.png" 
    205205        if os.path.isfile(config._isis_logo): 
    206206            image = config._isis_logo 
    207         logo = wx.Bitmap(image)         
     207        logo = wx.Bitmap(image) 
    208208        self.bitmap_button_isis.SetBitmapLabel(logo) 
    209209 
     
    213213        logo = wx.Bitmap(image) 
    214214        self.bitmap_button_ess.SetBitmapLabel(logo) 
    215          
     215 
    216216        image = file_dir + "/images/ill_logo.png" 
    217217        if os.path.isfile(config._ill_logo): 
     
    219219        logo = wx.Bitmap(image) 
    220220        self.bitmap_button_ill.SetBitmapLabel(logo) 
    221          
     221 
    222222        image = file_dir + "/images/ansto_logo.png" 
    223223        if os.path.isfile(config._ansto_logo): 
     
    225225        logo = wx.Bitmap(image) 
    226226        self.bitmap_button_ansto.SetBitmapLabel(logo) 
    227          
     227 
    228228        image = file_dir + "/images/tudelft_logo.png" 
    229229        if os.path.isfile(config._tudelft_logo): 
     
    231231        logo = wx.Bitmap(image) 
    232232        self.bitmap_button_tudelft.SetBitmapLabel(logo) 
    233          
     233 
    234234        image = file_dir + "/images/dls_logo.png" 
    235235        if os.path.isfile(config._dls_logo): 
     
    237237        logo = wx.Bitmap(image) 
    238238        self.bitmap_button_dls.SetBitmapLabel(logo) 
    239                  
     239 
    240240        # resize dialog window to fit version number nicely 
    241241        if wx.VERSION >= (2, 7, 2, 0): 
     
    244244            size = [self.GetBestFittingSize()[0], self.GetSize()[1]] 
    245245        self.Fit() 
    246          
     246 
    247247    def __set_properties(self): 
    248248        """ 
     
    310310        sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0) 
    311311 
    312         sizer_logos.Add(self.bitmap_button_msu, 0,  
     312        sizer_logos.Add(self.bitmap_button_msu, 0, 
    313313                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    314314        #sizer_logos.Add(self.bitmap_button_danse, 0, 
    315315        #                wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    316         #sizer_logos.Add(self.bitmap_button_nsf, 0,  
     316        #sizer_logos.Add(self.bitmap_button_nsf, 0, 
    317317        #                wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    318         sizer_logos.Add(self.bitmap_button_umd, 0,  
    319                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    320         sizer_logos.Add(self.bitmap_button_nist, 0,  
    321                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    322         #sizer_logos.Add(self.bitmap_button_sns, 0,  
     318        sizer_logos.Add(self.bitmap_button_umd, 0, 
     319                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     320        sizer_logos.Add(self.bitmap_button_nist, 0, 
     321                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     322        #sizer_logos.Add(self.bitmap_button_sns, 0, 
    323323        #                wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    324         sizer_logos.Add(self.bitmap_button_ornl, 0,  
    325                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    326         sizer_logos.Add(self.bitmap_button_isis, 0,  
    327                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    328         sizer_logos.Add(self.bitmap_button_ess, 0,  
    329                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    330         sizer_logos.Add(self.bitmap_button_ill, 0,  
    331                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    332         sizer_logos.Add(self.bitmap_button_ansto, 0,  
    333                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    334         sizer_logos.Add(self.bitmap_button_tudelft, 0,  
    335                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    336         sizer_logos.Add(self.bitmap_button_dls, 0,  
    337                         wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    338                  
     324        sizer_logos.Add(self.bitmap_button_ornl, 0, 
     325                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     326        sizer_logos.Add(self.bitmap_button_isis, 0, 
     327                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     328        sizer_logos.Add(self.bitmap_button_ess, 0, 
     329                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     330        sizer_logos.Add(self.bitmap_button_ill, 0, 
     331                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     332        sizer_logos.Add(self.bitmap_button_ansto, 0, 
     333                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     334        sizer_logos.Add(self.bitmap_button_tudelft, 0, 
     335                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     336        sizer_logos.Add(self.bitmap_button_dls, 0, 
     337                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     338 
    339339        sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0) 
    340340        sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0) 
    341341        sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0) 
    342342        sizer_button.Add((20, 40), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    343         sizer_button.Add(self.button_OK, 0,  
     343        sizer_button.Add(self.button_OK, 0, 
    344344                         wx.RIGHT|wx.ADJUST_MINSIZE|wx.CENTER, 10) 
    345345        sizer_main.Add(sizer_button, 0, wx.EXPAND, 0) 
     
    350350        # end wxGlade 
    351351 
    352     def onNistLogo(self, event):  
     352    def onNistLogo(self, event): 
    353353        """ 
    354354        """ 
     
    356356        launchBrowser(config._nist_url) 
    357357        event.Skip() 
    358          
    359     def onUmdLogo(self, event):  
     358 
     359    def onUmdLogo(self, event): 
    360360        """ 
    361361        """ 
     
    363363        launchBrowser(config._umd_url) 
    364364        event.Skip() 
    365          
    366     def onOrnlLogo(self, event):  
     365 
     366    def onOrnlLogo(self, event): 
    367367        """ 
    368368        """ 
     
    370370        launchBrowser(config._ornl_url) 
    371371        event.Skip() 
    372          
    373     def onSnsLogo(self, event):  
     372 
     373    def onSnsLogo(self, event): 
    374374        """ 
    375375        """ 
     
    377377        launchBrowser(config._sns_url) 
    378378        event.Skip() 
    379                  
    380     def onNsfLogo(self, event):  
     379 
     380    def onNsfLogo(self, event): 
    381381        """ 
    382382        """ 
     
    394394    def onUTLogo(self, event): 
    395395        """ 
    396         """  
     396        """ 
    397397        # wxGlade: DialogAbout.<event_handler> 
    398398        launchBrowser(config._inst_url) 
    399399        event.Skip() 
    400400 
    401     def onIsisLogo(self, event):  
     401    def onIsisLogo(self, event): 
    402402        """ 
    403403        """ 
     
    415415    def onIllLogo(self, event): 
    416416        """ 
    417         """  
     417        """ 
    418418        # wxGlade: DialogAbout.<event_handler> 
    419419        launchBrowser(config._ill_url) 
     
    422422    def onAnstoLogo(self, event): 
    423423        """ 
    424         """  
     424        """ 
    425425        # wxGlade: DialogAbout.<event_handler> 
    426426        launchBrowser(config._ansto_url) 
     
    429429    def onTudelftLogo(self, event): 
    430430        """ 
    431         """  
     431        """ 
    432432        # wxGlade: DialogAbout.<event_handler> 
    433433        launchBrowser(config._tudelft_url) 
     
    436436    def onDlsLogo(self, event): 
    437437        """ 
    438         """  
     438        """ 
    439439        # wxGlade: DialogAbout.<event_handler> 
    440440        launchBrowser(config._dls_url) 
     
    462462    app = MyApp(0) 
    463463    app.MainLoop() 
    464      
    465 ##### end of testing code #####################################################     
     464 
     465##### end of testing code ##################################################### 
  • src/sas/sasgui/guiframe/media/graph_help.rst

    rf9b0c81 r5ed76f8  
    99 
    1010SasView generates three different types of graph window: one that displays *1D data* 
    11 (ie, I(Q) vs Q), one that displays *1D residuals* (ie, the difference between the 
    12 experimental data and the theory at the same Q values), and *2D color maps*. 
     11(i.e., $I(Q)$ vs $Q$), one that displays *1D residuals* (ie, the difference between the 
     12experimental data and the theory at the same $Q$ values), and *2D color maps*. 
    1313 
    1414Graph window options 
     
    4242plot window. 
    4343 
    44 .. note::  
     44.. note:: 
    4545    *If a residuals graph (when fitting data) is hidden, it will not show up 
    4646    after computation.* 
     
    138138style and size. *Remove Text* will remove the last annotation added. To change 
    139139the legend. *Window Title* allows a custom title to be entered instead of Graph 
    140 x.  
     140x. 
    141141 
    142142Changing scales 
     
    226226^^^^^^^^^^^^^^^^^^^ 
    227227 
    228 Linear fit performs a simple ( y(x)=ax+b ) linear fit within the plot window. 
     228Linear fit performs a simple $y(x)=ax+b$ linear fit within the plot window. 
    229229 
    230230In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Linear Fit*. A 
     
    234234 
    235235This option is most useful for performing simple Guinier, XS Guinier, and 
    236 Porod type analyses, for example, to estimate Rg, a rod diameter, or incoherent 
     236Porod type analyses, for example, to estimate $R_g$, a rod diameter, or incoherent 
    237237background level, respectively. 
    238238 
     
    319319^^^^^^^^^^^^^^^^^^^^^^^^^ 
    320320 
    321 This operation will perform an average in constant Q-rings around the (x,y) 
     321This operation will perform an average in constant $Q$ rings around the (x,y) 
    322322pixel location of the beam center. 
    323323 
     
    331331^^^^^^^^^^^^^^^^^^^^^^^ 
    332332 
    333 This operation averages in constant Q-arcs. 
    334  
    335 The width of the sector is specified in degrees (+/- |delta|\|phi|\) each side 
    336 of the central angle (|phi|\). 
    337  
    338 Annular average [|phi| View] 
    339 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    340  
    341 This operation performs an average between two Q-values centered on (0,0), 
     333This operation averages in constant $Q$ arcs. 
     334 
     335The width of the sector is specified in degrees ($\pm\delta|\phi|$) each side 
     336of the central angle $\phi$. 
     337 
     338Annular average [:math:`\phi`] 
     339^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
     340 
     341This operation performs an average between two $Q$ values centered on (0,0), 
    342342and averaged over a specified number of pixels. 
    343343 
    344 The data is returned as a function of angle (|phi|\) in degrees with zero 
     344The data is returned as a function of angle $\phi$ in degrees with zero 
    345345degrees at the 3 O'clock position. 
    346346 
     
    356356^^^^^^^^^^^^^^^^^^^ 
    357357 
    358 This operation computes an average I(Qx) for the region of interest. 
     358This operation computes an average $I(Q_x)$ for the region of interest. 
    359359 
    360360When editing the slicer parameters, the user can control the length and the 
    361361width the rectangular slicer. The averaged output is calculated from constant 
    362 bins with rectangular shape. The resultant Q values are nominal values, that 
     362bins with rectangular shape. The resultant $Q$ values are nominal values, that 
    363363is, the central value of each bin on the x-axis. 
    364364 
     
    366366^^^^^^^^^^^^^^^^^^^ 
    367367 
    368 This operation computes an average I(Qy) for the region of interest. 
     368This operation computes an average $I(Q_y)$ for the region of interest. 
    369369 
    370370When editing the slicer parameters, the user can control the length and the 
    371371width the rectangular slicer. The averaged output is calculated from constant 
    372 bins with rectangular shape. The resultant Q values are nominal values, that 
     372bins with rectangular shape. The resultant $Q$ values are nominal values, that 
    373373is, the central value of each bin on the x-axis. 
    374374 
  • src/sas/sasgui/perspectives/calculator/media/density_calculator_help.rst

    rd85c194 r6aad2e8  
    29294) Click the 'Calculate' button to perform the calculation. 
    3030 
    31 .. image:: density_tutor.gif 
     31.. image:: density_tutor.png 
    3232 
    3333.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
  • src/sas/sasgui/perspectives/calculator/media/gen_sas_help.html

    rd85c194 r6aad2e8  
    1919by the particle  
    2020<p> 
    21 <img src="gen_i.gif"/> 
     21<img src="gen_i.png"/> 
    2222</p> 
    2323<br> 
     
    2626of the j'th pixel respectively. And the total volume 
    2727<p> 
    28 <img src="v_j.gif"/> 
     28<img src="v_j.png"/> 
    2929</p> 
    3030<br> 
     
    4444scattering length. (Figure below). 
    4545<p> 
    46 <img src="mag_vector.bmp"/> 
     46<img src="mag_vector.png"/> 
    4747</p> 
    4848<br> 
    4949The magnetic scattering length density is then 
    5050<p> 
    51 <img src="dm_eq.gif"/> 
     51<img src="dm_eq.png"/> 
    5252</p> 
    5353<br> 
     
    6666<br> 
    6767<p> 
    68 <img src="gen_mag_pic.bmp"/> 
     68<img src="gen_mag_pic.png"/> 
    6969</p> 
    7070<br> 
     
    7575densities , including the nuclear scattering length density (&#946; <sub>N</sub>) are given as, for non-spin-flips, 
    7676<p> 
    77 <img src="sld1.gif"/> 
     77<img src="sld1.png"/> 
    7878</p> 
    7979<br> 
     
    8181for spin-flips, 
    8282<p> 
    83 <img src="sld2.gif"/> 
     83<img src="sld2.png"/> 
    8484</p> 
    8585<br> 
     
    8787where 
    8888<p> 
    89 <img src="mxp.gif"/> 
     89<img src="mxp.png"/> 
    9090</p> 
    9191<p> 
    92 <img src="myp.gif"/> 
     92<img src="myp.png"/> 
    9393</p> 
    9494<p> 
    95 <img src="mzp.gif"/> 
     95<img src="mzp.png"/> 
    9696</p> 
    9797<p> 
    98 <img src="mqx.gif"/> 
     98<img src="mqx.png"/> 
    9999</p> 
    100100<p> 
    101 <img src="mqy.gif"/> 
     101<img src="mqy.png"/> 
    102102</p> 
    103103<br> 
     
    110110<br> 
    111111<p> 
    112 <img src="gen_gui_help.bmp"/> 
     112<img src="gen_gui_help.png"/> 
    113113</p> 
    114114<br> 
     
    136136in a 2D output, whileas the scattering calculation averaged over all the orientations uses the Debye equation providing a 1D output: 
    137137 <p> 
    138 <img src="gen_debye_eq.gif"/> 
     138<img src="gen_debye_eq.png"/> 
    139139</p> 
    140140<br> 
  • src/sas/sasgui/perspectives/calculator/media/kiessig_calculator_help.rst

    r7805458 r5ed76f8  
    1010----------- 
    1111 
    12 This tool is approximately estimates the thickness of a layer or the diameter  
    13 of particles from the position of the Kiessig fringe/Bragg peak in NR/SAS data  
    14 using the relation 
     12This tool estimates real space dimensions from the position or spacing of 
     13features in recipricol space.  In particular a particle of size $d$ will 
     14give rise to Bragg peaks with spacing $\Delta q$ according to the relation 
    1515 
    16 (thickness *or* size) = 2 * |pi| / (fringe_width *or* peak position) 
    17    
     16.. math:: 
     17 
     18    d = 2\pi / \Delta q 
     19 
     20Similarly, the spacing between the peaks in Kiessig fringes in reflectometry 
     21data arise from layers of thickness $d$. 
     22 
    1823.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    1924 
     
    2126-------------- 
    2227 
    23 To get a rough thickness or particle size, simply type the fringe or peak  
     28To get a rough thickness or particle size, simply type the fringe or peak 
    2429position (in units of 1/|Ang|\) and click on the *Compute* button. 
    2530 
    2631.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    2732 
    28 .. note::  This help document was last changed by Steve King, 01May2015 
    29  
     33.. note::  This help document was last changed by Paul Kienzle, 05Apr2017 
  • src/sas/sasgui/perspectives/calculator/media/resolution_calculator_help.rst

    r7805458 r5ed76f8  
    1010----------- 
    1111 
    12 This tool is approximately estimates the resolution of Q from SAS instrumental  
    13 parameter values assuming that the detector is flat and normal to the  
     12This tool is approximately estimates the resolution of $Q$ from SAS instrumental 
     13parameter values assuming that the detector is flat and normal to the 
    1414incident beam. 
    1515 
     
    23232) Select the source (Neutron or Photon) and source type (Monochromatic or TOF). 
    2424 
    25    *NOTE! The computational difference between the sources is only the  
     25   *NOTE! The computational difference between the sources is only the 
    2626   gravitational contribution due to the mass of the particles.* 
    2727 
    28 3) Change the default values of the instrumental parameters as required. Be  
     283) Change the default values of the instrumental parameters as required. Be 
    2929   careful to note that distances are specified in cm! 
    3030 
    31 4) Enter values for the source wavelength(s), |lambda|\ , and its spread (= FWHM/|lambda|\ ). 
    32     
    33    For monochromatic sources, the inputs are just one value. For TOF sources,  
    34    the minimum and maximum values should be separated by a '-' to specify a  
     314) Enter values for the source wavelength(s), $\lambda$, and its spread (= $\text{FWHM}/\lambda$). 
     32 
     33   For monochromatic sources, the inputs are just one value. For TOF sources, 
     34   the minimum and maximum values should be separated by a '-' to specify a 
    3535   range. 
    36     
    37    Optionally, the wavelength (BUT NOT of the wavelength spread) can be extended  
    38    by adding '; nn' where the 'nn' specifies the number of the bins for the  
    39    numerical integration. The default value is nn = 10. The same number of bins  
     36 
     37   Optionally, the wavelength (BUT NOT of the wavelength spread) can be extended 
     38   by adding '; nn' where the 'nn' specifies the number of the bins for the 
     39   numerical integration. The default value is nn = 10. The same number of bins 
    4040   will be used for the corresponding wavelength spread. 
    4141 
    42 5) For TOF, the default wavelength spectrum is flat. A custom spectral  
    43    distribution file (2-column text: wavelength (|Ang|\) vs Intensity) can also  
     425) For TOF, the default wavelength spectrum is flat. A custom spectral 
     43   distribution file (2-column text: wavelength (|Ang|\) vs Intensity) can also 
    4444   be loaded by selecting *Add new* in the combo box. 
    4545 
    46 6) When ready, click the *Compute* button. Depending on the computation the  
     466) When ready, click the *Compute* button. Depending on the computation the 
    4747   calculation time will vary. 
    4848 
    49 7) 1D and 2D dQ values will be displayed at the bottom of the panel, and a 2D  
    50    resolution weight distribution (a 2D elliptical Gaussian function) will also  
    51    be displayed in the plot panel even if the Q inputs are outside of the  
     497) 1D and 2D $dQ$ values will be displayed at the bottom of the panel, and a 2D 
     50   resolution weight distribution (a 2D elliptical Gaussian function) will also 
     51   be displayed in the plot panel even if the $Q$ inputs are outside of the 
    5252   detector limit (the red lines indicate the limits of the detector). 
    53     
    54    TOF only: green lines indicate the limits of the maximum Q range accessible  
     53 
     54   TOF only: green lines indicate the limits of the maximum $Q$ range accessible 
    5555   for the longest wavelength due to the size of the detector. 
    56      
    57    Note that the effect from the beam block/stop is ignored, so in the small Q  
    58    region near the beam block/stop  
    5956 
    60    [ie., Q < 2. |pi|\ .(beam block diameter) / (sample-to-detector distance) / |lambda|\_min]  
     57   Note that the effect from the beam block/stop is ignored, so in the small $Q$ 
     58   region near the beam block/stop 
     59 
     60   [i.e., $Q < (2 \pi \cdot \text{beam block diameter}) / (\text{sample-to-detector distance} \cdot \lambda_\text{min})$] 
    6161 
    6262   the variance is slightly under estimated. 
    6363 
    64 8) A summary of the calculation is written to the SasView *Console* at the  
     648) A summary of the calculation is written to the SasView *Console* at the 
    6565   bottom of the main SasView window. 
    6666 
    67 .. image:: resolution_tutor.gif 
     67.. image:: resolution_tutor.png 
    6868 
    6969.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    7474The scattering wave transfer vector is by definition 
    7575 
    76 .. image:: q.gif 
     76.. image:: q.png 
    7777 
    78 In the small-angle limit, the variance of Q is to a first-order  
     78In the small-angle limit, the variance of $Q$ is to a first-order 
    7979approximation 
    8080 
    81 .. image:: sigma_q.gif 
     81.. image:: sigma_q.png 
    8282 
    8383The geometric and gravitational contributions can then be summarised as 
    8484 
    85 .. image:: sigma_table.gif 
     85.. image:: sigma_table.png 
    8686 
    87 Finally, a Gaussian function is used to describe the 2D weighting distribution  
    88 of the uncertainty in Q. 
     87Finally, a Gaussian function is used to describe the 2D weighting distribution 
     88of the uncertainty in $Q$. 
    8989 
    9090.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    9393---------- 
    9494 
    95 D.F.R. Mildner and J.M. Carpenter  
     95D.F.R. Mildner and J.M. Carpenter 
    9696*J. Appl. Cryst.* 17 (1984) 249-256 
    9797 
    98 D.F.R. Mildner, J.M. Carpenter and D.L. Worcester  
     98D.F.R. Mildner, J.M. Carpenter and D.L. Worcester 
    9999*J. Appl. Cryst.* 19 (1986) 311-319 
    100100 
  • src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst

    rda456fb r5ed76f8  
    1919------ 
    2020 
    21 In general, a particle with a volume *V* can be described by an ensemble  
    22 containing *N* 3-dimensional rectangular pixels where each pixel is much  
    23 smaller than *V*. 
     21In general, a particle with a volume $V$ can be described by an ensemble 
     22containing $N$ 3-dimensional rectangular pixels where each pixel is much 
     23smaller than $V$. 
    2424 
    25 Assuming that all the pixel sizes are the same, the elastic scattering  
     25Assuming that all the pixel sizes are the same, the elastic scattering 
    2626intensity from the particle is 
    2727 
    28 .. image:: gen_i.gif 
     28.. image:: gen_i.png 
    2929 
    3030Equation 1. 
    3131 
    32 where |beta|\ :sub:`j` and *r*\ :sub:`j` are the scattering length density and  
    33 the position of the j'th pixel respectively. 
     32where $\beta_j$ and $r_j$ are the scattering length density and 
     33the position of the $j^\text{th}$ pixel respectively. 
    3434 
    35 The total volume *V* 
     35The total volume $V$ 
    3636 
    37 .. image:: v_j.gif 
     37.. math:: 
    3838 
    39 for |beta|\ :sub:`j` |noteql|\0 where *v*\ :sub:`j` is the volume of the j'th  
    40 pixel (or the j'th natural atomic volume (= atomic mass / (natural molar  
     39    V = \sum_j^N v_j 
     40 
     41for $\beta_j \ne 0$ where $v_j$ is the volume of the $j^\text{th}$ 
     42pixel (or the $j^\text{th}$ natural atomic volume (= atomic mass / (natural molar 
    4143density * Avogadro number) for the atomic structures). 
    4244 
    43 *V* can be corrected by users. This correction is useful especially for an  
    44 atomic structure (such as taken from a PDB file) to get the right normalization.  
     45$V$ can be corrected by users. This correction is useful especially for an 
     46atomic structure (such as taken from a PDB file) to get the right normalization. 
    4547 
    46 *NOTE!* |beta|\ :sub:`j` *displayed in the GUI may be incorrect but this will not  
     48*NOTE! $\beta_j$ displayed in the GUI may be incorrect but this will not 
    4749affect the scattering computation if the correction of the total volume V is made.* 
    4850 
    49 The scattering length density (SLD) of each pixel, where the SLD is uniform, is  
    50 a combination of the nuclear and magnetic SLDs and depends on the spin states  
     51The scattering length density (SLD) of each pixel, where the SLD is uniform, is 
     52a combination of the nuclear and magnetic SLDs and depends on the spin states 
    5153of the neutrons as follows. 
    5254 
     
    5456^^^^^^^^^^^^^^^^^^^ 
    5557 
    56 For magnetic scattering, only the magnetization component, *M*\ :sub:`perp`\ ,  
    57 perpendicular to the scattering vector *Q* contributes to the magnetic  
     58For magnetic scattering, only the magnetization component, $M_\perp$, 
     59perpendicular to the scattering vector $Q$ contributes to the magnetic 
    5860scattering length. 
    5961 
    60 .. image:: mag_vector.bmp 
     62.. image:: mag_vector.png 
    6163 
    6264The magnetic scattering length density is then 
    6365 
    64 .. image:: dm_eq.gif 
     66.. image:: dm_eq.png 
    6567 
    66 where the gyromagnetic ratio |gamma| = -1.913, |mu|\ :sub:`B` is the Bohr  
    67 magneton, *r*\ :sub:`0` is the classical radius of electron, and |sigma| is the  
     68where the gyromagnetic ratio is $\gamma = -1.913$, $\mu_B$ is the Bohr 
     69magneton, $r_0$ is the classical radius of electron, and $\sigma$ is the 
    6870Pauli spin. 
    6971 
    7072For a polarized neutron, the magnetic scattering is depending on the spin states. 
    7173 
    72 Let us consider that the incident neutrons are polarised both parallel (+) and   
    73 anti-parallel (-) to the x' axis (see below). The possible states after  
    74 scattering from the sample are then  
     74Let us consider that the incident neutrons are polarised both parallel (+) and 
     75anti-parallel (-) to the x' axis (see below). The possible states after 
     76scattering from the sample are then 
    7577 
    7678*  Non-spin flips: (+ +) and (- -) 
    7779*  Spin flips:     (+ -) and (- +) 
    7880 
    79 .. image:: gen_mag_pic.bmp 
     81.. image:: gen_mag_pic.png 
    8082 
    81 Now let us assume that the angles of the *Q* vector and the spin-axis (x')  
    82 to the x-axis are |phi| and |theta|\ :sub:`up` respectively (see above). Then,  
    83 depending upon the polarization (spin) state of neutrons, the scattering  
    84 length densities, including the nuclear scattering length density (|beta|\ :sub:`N`\ )  
     83Now let us assume that the angles of the *Q* vector and the spin-axis (x') 
     84to the x-axis are $\phi$ and $\theta_\text{up}$ respectively (see above). Then, 
     85depending upon the polarization (spin) state of neutrons, the scattering 
     86length densities, including the nuclear scattering length density ($\beta_N$) 
    8587are given as 
    8688 
    8789*  for non-spin-flips 
    8890 
    89    .. image:: sld1.gif 
     91   .. image:: sld1.png 
    9092 
    9193*  for spin-flips 
    9294 
    93    .. image:: sld2.gif 
     95   .. image:: sld2.png 
    9496 
    9597where 
    9698 
    97 .. image:: mxp.gif 
     99.. image:: mxp.png 
    98100 
    99 .. image:: myp.gif 
     101.. image:: myp.png 
    100102 
    101 .. image:: mzp.gif 
     103.. image:: mzp.png 
    102104 
    103 .. image:: mqx.gif 
     105.. image:: mqx.png 
    104106 
    105 .. image:: mqy.gif 
     107.. image:: mqy.png 
    106108 
    107 Here the *M0*\ :sub:`x`\ , *M0*\ :sub:`y` and *M0*\ :sub:`z` are the x, y and z  
    108 components of the magnetisation vector in the laboratory xyz frame.  
     109Here the $M0_x$, $M0_y$ and $M0_z$ are the $x$, $y$ and $z$ 
     110components of the magnetisation vector in the laboratory $xyz$ frame. 
    109111 
    110112.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    113115-------------- 
    114116 
    115 .. image:: gen_gui_help.bmp 
     117.. image:: gen_gui_help.png 
    116118 
    117 After computation the result will appear in the *Theory* box in the SasView   
     119After computation the result will appear in the *Theory* box in the SasView 
    118120*Data Explorer* panel. 
    119121 
    120 *Up_frac_in* and *Up_frac_out* are the ratio  
     122*Up_frac_in* and *Up_frac_out* are the ratio 
    121123 
    122124   (spin up) / (spin up + spin down) 
    123     
     125 
    124126of neutrons before the sample and at the analyzer, respectively. 
    125127 
    126 *NOTE 1. The values of* Up_frac_in *and* Up_frac_out *must be in the range  
     128*NOTE 1. The values of* Up_frac_in *and* Up_frac_out *must be in the range 
    1271290.0 to 1.0. Both values are 0.5 for unpolarized neutrons.* 
    128130 
    129 *NOTE 2. This computation is totally based on the pixel (or atomic) data fixed  
     131*NOTE 2. This computation is totally based on the pixel (or atomic) data fixed 
    130132in xyz coordinates. No angular orientational averaging is considered.* 
    131133 
    132 *NOTE 3. For the nuclear scattering length density, only the real component  
     134*NOTE 3. For the nuclear scattering length density, only the real component 
    133135is taken account.* 
    134136 
     
    139141 
    140142The SANS Calculator tool can read some PDB, OMF or SLD files but ignores 
    141 polarized/magnetic scattering when doing so, thus related parameters such as  
     143polarized/magnetic scattering when doing so, thus related parameters such as 
    142144*Up_frac_in*, etc, will be ignored. 
    143145 
    144 The calculation for fixed orientation uses Equation 1 above resulting in a 2D  
    145 output, whereas the scattering calculation averaged over all the orientations  
     146The calculation for fixed orientation uses Equation 1 above resulting in a 2D 
     147output, whereas the scattering calculation averaged over all the orientations 
    146148uses the Debye equation below providing a 1D output 
    147149 
    148 .. image:: gen_debye_eq.gif 
     150.. image:: gen_debye_eq.png 
    149151 
    150 where *v*\ :sub:`j` |beta|\ :sub:`j` |equiv| *b*\ :sub:`j` is the scattering  
    151 length of the j'th atom. The calculation output is passed to the *Data Explorer*  
     152where $v_j \beta_j \equiv b_j$ is the scattering 
     153length of the $j^\text{th}$ atom. The calculation output is passed to the *Data Explorer* 
    152154for further use. 
    153155 
  • src/sas/sasgui/perspectives/calculator/media/sld_calculator_help.rst

    rf93b473f r5ed76f8  
    1010----------- 
    1111 
    12 The neutron scattering length density (SLD) is defined as 
     12The neutron scattering length density (SLD, $\beta_N$) is defined as 
    1313 
    14   SLD = (b_c1 + b_c2 + ... + b_cn) / Vm 
     14.. math:: 
    1515 
    16 where b_ci is the bound coherent scattering length of ith of n atoms in a molecule 
    17 with the molecular volume Vm 
     16  \beta_N = (b_{c1} + b_{c2} + ... + b_{cn}) / V_m 
     17 
     18where $b_{ci}$ is the bound coherent scattering length of ith of n atoms in a molecule 
     19with the molecular volume $V_m$. 
    1820 
    1921.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    2224---------------------------- 
    2325 
    24 To calculate scattering length densities enter the empirical formula of a  
     26To calculate scattering length densities enter the empirical formula of a 
    2527compound and its mass density and click "Calculate". 
    2628 
    27 Entering a wavelength value is optional (a default value of 6.0 |Ang| will  
     29Entering a wavelength value is optional (a default value of 6.0 |Ang| will 
    2830be used). 
    2931 
     
    3840*  Parentheses can be nested, such as "(CaCO3(H2O)6)1". 
    3941 
    40 *  Isotopes are represented by their atomic number in *square brackets*, such  
     42*  Isotopes are represented by their atomic number in *square brackets*, such 
    4143   as "CaCO[18]3+6H2O", H[1], or H[2]. 
    4244 
    4345*  Numbers of atoms can be integer or decimal, such as "CaCO3+(3HO0.5)2". 
    4446 
    45 *  The SLD of mixtures can be calculated as well. For example, for a 70-30  
     47*  The SLD of mixtures can be calculated as well. For example, for a 70-30 
    4648   mixture of H2O/D2O write "H14O7+D6O3" or more simply "H7D3O5" (i.e. this says 
    4749   7 hydrogens, 3 deuteriums, and 5 oxygens) and enter a mass density calculated 
    4850   on the percentages of H2O and D2O. 
    4951 
    50 *  Type "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12  
     52*  Type "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12 
    5153   deuterium atoms, and 6 Oxygen-18 atoms). 
    52     
     54 
    5355.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    5456 
    55 .. note::  This help document was last changed by Steve King, 01May2015 
     57.. note::  This help document was last changed by Paul Kienzle, 05Apr2017 
    5658 
  • src/sas/sasgui/perspectives/calculator/media/slit_calculator_help.rst

    rf93b473f r5ed76f8  
    1111----------- 
    1212 
    13 This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing  
     13This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing 
    1414based on their half beam profile data. 
    1515 
    1616*NOTE! Whilst it may have some more generic applicability, the calculator has 
    17 only been tested with beam profile data from Anton-Paar SAXSess*\ |TM|\   
    18 *software.* 
     17only been tested with beam profile data from Anton-Paar SAXSess:sup:`TM` software.* 
    1918 
    2019.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    27262) Load a beam profile file in the *Data* field using the *Browse* button. 
    2827 
    29    *NOTE! To see an example of the beam profile file format, visit the file  
     28   *NOTE! To see an example of the beam profile file format, visit the file 
    3029   beam profile.DAT in your {installation_directory}/SasView/test folder.* 
    3130 
    32 3) Once a data is loaded, the slit size is automatically computed and displayed  
     313) Once a data is loaded, the slit size is automatically computed and displayed 
    3332   in the tool window. 
    3433 
    35 *NOTE! The beam profile file does not carry any information about the units of  
     34*NOTE! The beam profile file does not carry any information about the units of 
    3635the Q data. This calculator assumes the data has units of 1/\ |Ang|\ . If the 
    3736data is not in these units it must be manually converted beforehand.* 
  • src/sas/sasgui/perspectives/fitting/media/fitting_help.rst

    rca383a0 rc5cfb20  
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    55 
    6 .. |inlineimage004| image:: sm_image004.gif 
    7 .. |inlineimage005| image:: sm_image005.gif 
    8 .. |inlineimage008| image:: sm_image008.gif 
    9 .. |inlineimage009| image:: sm_image009.gif 
    10 .. |inlineimage010| image:: sm_image010.gif 
    11 .. |inlineimage011| image:: sm_image011.gif 
    12 .. |inlineimage012| image:: sm_image012.gif 
    13 .. |inlineimage018| image:: sm_image018.gif 
    14 .. |inlineimage019| image:: sm_image019.gif 
     6.. |inlineimage004| image:: sm_image004.png 
     7.. |inlineimage005| image:: sm_image005.png 
     8.. |inlineimage008| image:: sm_image008.png 
     9.. |inlineimage009| image:: sm_image009.png 
     10.. |inlineimage010| image:: sm_image010.png 
     11.. |inlineimage011| image:: sm_image011.png 
     12.. |inlineimage012| image:: sm_image012.png 
     13.. |inlineimage018| image:: sm_image018.png 
     14.. |inlineimage019| image:: sm_image019.png 
    1515 
    1616 
     
    9090*View* option on the menubar, or click on the *Modify* button on the *Fit Page*. 
    9191 
    92 .. image:: cat_fig0.bmp 
     92.. image:: cat_fig0.png 
    9393 
    9494The categorization of all models except the user supplied Plugin Models can be 
     
    9696hidden from view in the drop-down menus. 
    9797 
    98 .. image:: cat_fig1.bmp 
     98.. image:: cat_fig1.png 
    9999 
    100100Changing category 
     
    105105to make the required changes. 
    106106 
    107 .. image:: cat_fig2.bmp 
     107.. image:: cat_fig2.png 
    108108 
    109109To create a category for the selected model, click the *Add* button. In order 
     
    179179GUI using the *New Plugin Model Function*. 
    180180 
    181 .. image:: new_model.bmp 
     181.. image:: new_model.png 
    182182 
    183183When using this feature, be aware that even if your code has errors, including  
     
    228228^^^^^^^^^^^^^^^^ 
    229229 
    230 .. image:: sum_model.bmp 
     230.. image:: sum_model.png 
    231231 
    232232This option creates a custom Plugin Model of the form:: 
     
    449449 
    450450In the bottom left corner of the *Fit Page* is a box displaying the normalised value 
    451 of the statistical |chi|\  :sup:`2` parameter returned by the optimiser. 
     451of the statistical $\chi^2$ parameter returned by the optimiser. 
    452452 
    453453Now check the box for another model parameter and click *Fit* again. Repeat this 
     
    455455fit of the theory to the experimental data improves the value of 'chi2/Npts' will 
    456456decrease. A good model fit should easily produce values of 'chi2/Npts' that are 
    457 close to zero, and certainly <100. See :ref:`Assessing_Fit_Quality`. 
     457close to one, and certainly <100. See :ref:`Assessing_Fit_Quality`. 
    458458 
    459459SasView has a number of different optimisers (see the section :ref:`Fitting_Options`). 
     
    579579at the bottom of that panel and *Send To Fitting*. A *BatchPage* will be created. 
    580580 
    581 .. image:: batch_button_area.bmp 
     581.. image:: batch_button_area.png 
    582582 
    583583*NB: The Batch Page can also be created by checking the Batch Mode radio button* 
     
    601601will all appear on one graph. 
    602602 
    603 .. image:: view_button.bmp 
     603.. image:: view_button.png 
    604604 
    605605*NB: In theory, returning to the BatchPage and changing the name of the I(Q)* 
     
    637637bar. 
    638638 
    639 .. image:: restore_batch_window.bmp 
     639.. image:: restore_batch_window.png 
    640640 
    641641Once a batch fit is completed, all model parameters are displayed but *not* 
     
    653653label. 
    654654 
    655 .. image:: edit_menu.bmp 
     655.. image:: edit_menu.png 
    656656 
    657657*NB: If there is an existing Grid Window and another batch fit is performed,* 
     
    666666*Window* menu bar. The loaded parameters will appear in a new table tab. 
    667667 
    668 .. image:: file_menu.bmp 
     668.. image:: file_menu.png 
    669669 
    670670*NB: Saving the Grid Window does not save any experimental data, residuals* 
     
    684684but different labels and units can be entered manually. 
    685685 
    686 .. image:: plot_button.bmp 
     686.. image:: plot_button.png 
    687687 
    688688The *X/Y-axis Selection Range* can be edited manually. The text control box 
  • src/sas/sasgui/perspectives/fitting/media/mag_help.rst

    reca66a1 r5ed76f8  
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    55 
    6 .. |inlineimage004| image:: sm_image004.gif 
    7 .. |inlineimage005| image:: sm_image005.gif 
    8 .. |inlineimage008| image:: sm_image008.gif 
    9 .. |inlineimage009| image:: sm_image009.gif 
    10 .. |inlineimage010| image:: sm_image010.gif 
    11 .. |inlineimage011| image:: sm_image011.gif 
    12 .. |inlineimage012| image:: sm_image012.gif 
    13 .. |inlineimage018| image:: sm_image018.gif 
    14 .. |inlineimage019| image:: sm_image019.gif 
     6.. |inlineimage004| image:: sm_image004.png 
     7.. |inlineimage005| image:: sm_image005.png 
     8.. |inlineimage008| image:: sm_image008.png 
     9.. |inlineimage009| image:: sm_image009.png 
     10.. |inlineimage010| image:: sm_image010.png 
     11.. |inlineimage011| image:: sm_image011.png 
     12.. |inlineimage012| image:: sm_image012.png 
     13.. |inlineimage018| image:: sm_image018.png 
     14.. |inlineimage019| image:: sm_image019.png 
    1515 
    1616 
     
    2020-------------------------------- 
    2121 
    22 Magnetic scattering is implemented in five (2D) models  
     22Magnetic scattering is implemented in five (2D) models 
    2323 
    2424*  *sphere* 
     
    2828*  *parallelepiped* 
    2929 
    30 In general, the scattering length density (SLD, = |beta|) in each region where the 
     30In general, the scattering length density (SLD, = $\beta$) in each region where the 
    3131SLD is uniform, is a combination of the nuclear and magnetic SLDs and, for polarised 
    3232neutrons, also depends on the spin states of the neutrons. 
    3333 
    34 For magnetic scattering, only the magnetization component, *M*\ :sub:`perp`, 
    35 perpendicular to the scattering vector *Q* contributes to the the magnetic 
     34For magnetic scattering, only the magnetization component, $M_\perp$, 
     35perpendicular to the scattering vector $Q$ contributes to the the magnetic 
    3636scattering length. 
    3737 
    38 .. image:: mag_vector.bmp 
     38.. image:: mag_vector.png 
    3939 
    4040The magnetic scattering length density is then 
    4141 
    42 .. image:: dm_eq.gif 
     42.. image:: dm_eq.png 
    4343 
    44 where |gamma| = -1.913 is the gyromagnetic ratio, |mu|\ :sub:`B` is the 
    45 Bohr magneton, *r*\ :sub:`0` is the classical radius of electron, and |sigma| 
     44where $\gamma = -1.913$ is the gyromagnetic ratio, $\mu_B$ is the 
     45Bohr magneton, $r_0$ is the classical radius of electron, and $\sigma$ 
    4646is the Pauli spin. 
    4747 
     
    5353Spin-flips    (+ -) and (- +) 
    5454 
    55 .. image:: M_angles_pic.bmp 
     55.. image:: M_angles_pic.png 
    5656 
    57 If the angles of the *Q* vector and the spin-axis (*x'*) to the *x*-axis are |phi| 
    58 and |theta|\ :sub:`up`, respectively, then, depending on the spin state of the 
     57If the angles of the $Q$ vector and the spin-axis (*x'*) to the *x*-axis are $\phi$ 
     58and $\theta_\text{up}$, respectively, then, depending on the spin state of the 
    5959neutrons, the scattering length densities, including the nuclear scattering 
    60 length density (|beta|\ :sub:`N`) are 
     60length density ($\beta_N$) are 
    6161 
    62 .. image:: sld1.gif 
     62.. image:: sld1.png 
    6363 
    6464when there are no spin-flips, and 
    6565 
    66 .. image:: sld2.gif 
     66.. image:: sld2.png 
    6767 
    6868when there are, and 
    6969 
    70 .. image:: mxp.gif 
     70.. image:: mxp.png 
    7171 
    72 .. image:: myp.gif 
     72.. image:: myp.png 
    7373 
    74 .. image:: mzp.gif 
     74.. image:: mzp.png 
    7575 
    76 .. image:: mqx.gif 
     76.. image:: mqx.png 
    7777 
    78 .. image:: mqy.gif 
     78.. image:: mqy.png 
    7979 
    80 Here, *M*\ :sub:`0x`, *M*\ :sub:`0y` and *M*\ :sub:`0z` are the x, y and z components 
    81 of the magnetization vector given in the laboratory xyz frame given by 
     80Here, $M_{0x}$, $M_{0y}$ and $M_{0z}$ are the $x$, $y$ and $z$ components 
     81of the magnetization vector given in the laboratory $xyz$ frame given by 
    8282 
    83 .. image:: m0x_eq.gif 
     83.. image:: m0x_eq.png 
    8484 
    85 .. image:: m0y_eq.gif 
     85.. image:: m0y_eq.png 
    8686 
    87 .. image:: m0z_eq.gif 
     87.. image:: m0z_eq.png 
    8888 
    89 and the magnetization angles |theta|\ :sub:`M` and |phi|\ :sub:`M` are defined in 
     89and the magnetization angles $\theta_M$ and $\phi_M$ are defined in 
    9090the figure above. 
    9191 
     
    9393 
    9494===========   ================================================================ 
    95  M0_sld        = *D*\ :sub:`M` *M*\ :sub:`0` 
    96  Up_theta      = |theta|\ :sub:`up` 
    97  M_theta       = |theta|\ :sub:`M` 
    98  M_phi         = |phi|\ :sub:`M` 
     95 M0_sld        = $D_M M_0$ 
     96 Up_theta      = $\theta_\text{up}$ 
     97 M_theta       = $\theta_M$ 
     98 M_phi         = $\phi_M$ 
    9999 Up_frac_i     = (spin up)/(spin up + spin down) neutrons *before* the sample 
    100100 Up_frac_f     = (spin up)/(spin up + spin down) neutrons *after* the sample 
  • src/sas/sasgui/perspectives/fitting/media/pd_help.rst

    rb64b87c r5ed76f8  
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    55 
    6 .. |inlineimage004| image:: sm_image004.gif 
    7 .. |inlineimage005| image:: sm_image005.gif 
    8 .. |inlineimage008| image:: sm_image008.gif 
    9 .. |inlineimage009| image:: sm_image009.gif 
    10 .. |inlineimage010| image:: sm_image010.gif 
    11 .. |inlineimage011| image:: sm_image011.gif 
    12 .. |inlineimage012| image:: sm_image012.gif 
    13 .. |inlineimage018| image:: sm_image018.gif 
    14 .. |inlineimage019| image:: sm_image019.gif 
     6.. |inlineimage004| image:: sm_image004.png 
     7.. |inlineimage005| image:: sm_image005.png 
     8.. |inlineimage008| image:: sm_image008.png 
     9.. |inlineimage009| image:: sm_image009.png 
     10.. |inlineimage010| image:: sm_image010.png 
     11.. |inlineimage011| image:: sm_image011.png 
     12.. |inlineimage012| image:: sm_image012.png 
     13.. |inlineimage018| image:: sm_image018.png 
     14.. |inlineimage019| image:: sm_image019.png 
    1515 
    1616 
     
    2424form factor is normalized by the average particle volume such that 
    2525 
    26 *P(q) = scale* * \ <F*\F> / *V + bkg* 
     26.. math:: 
    2727 
    28 where F is the scattering amplitude and the \<\> denote an average over the size 
    29 distribution. 
     28    P(q) = \text{scale} \langle F^*F rangle V + \text{background} 
     29 
     30where $F$ is the scattering amplitude and $\langle\cdot\rangle$ denotes an average 
     31over the size distribution. 
    3032 
    3133Users should note that this computation is very intensive. Applying polydispersion 
     
    5759.. image:: pd_image001.png 
    5860 
    59 where *xmean* is the mean of the distribution, *w* is the half-width, and *Norm* is a 
    60 normalization factor which is determined during the numerical calculation. 
     61where $x_{mean}$ is the mean of the distribution, $w$ is the half-width, and $Norm$ 
     62is a normalization factor which is determined during the numerical calculation. 
    6163 
    62 Note that the standard deviation and the half width *w* are different! 
     64Note that the standard deviation and the half width $w$ are different! 
    6365 
    6466The standard deviation is 
     
    8183.. image:: pd_image005.png 
    8284 
    83 where *xmean* is the mean of the distribution and *Norm* is a normalization factor 
     85where $x_{mean}$ is the mean of the distribution and $Norm$ is a normalization factor 
    8486which is determined during the numerical calculation. 
    8587 
     
    100102.. image:: pd_image007.png 
    101103 
    102 where |mu|\ =ln(*xmed*), *xmed* is the median value of the distribution, and 
    103 *Norm* is a normalization factor which will be determined during the numerical 
     104where $\mu=\ln(x_{med})$, $x_{med}$ is the median value of the distribution, and 
     105$Norm$ is a normalization factor which will be determined during the numerical 
    104106calculation. 
    105107 
     
    107109size parameter in the *FitPage*, for example, radius = 60. 
    108110 
    109 The polydispersity is given by |sigma| 
     111The polydispersity is given by $\sigma$ 
    110112 
    111113.. image:: pd_image008.png 
     
    115117.. image:: pd_image009.png 
    116118 
    117 The mean value is given by *xmean*\ =exp(|mu|\ +p\ :sup:`2`\ /2). The peak value 
    118 is given by *xpeak*\ =exp(|mu|-p\ :sup:`2`\ ). 
     119The mean value is given by $x_{mean} =\exp(\mu + p^2 /2)$. The peak value 
     120is given by $x_{peak} =\exp(\mu-p^2)$. 
    119121 
    120122.. image:: pd_image010.jpg 
    121123 
    122 This distribution function spreads more, and the peak shifts to the left, as *p* 
     124This distribution function spreads more, and the peak shifts to the left, as $p$ 
    123125increases, requiring higher values of Nsigmas and Npts. 
    124126 
     
    132134.. image:: pd_image011.png 
    133135 
    134 where *xmean* is the mean of the distribution and *Norm* is a normalization factor 
    135 which is determined during the numerical calculation, and *z* is a measure of the 
     136where $x_{mean}$ is the mean of the distribution and $Norm$ is a normalization factor 
     137which is determined during the numerical calculation, and $z$ is a measure of the 
    136138width of the distribution such that 
    137139 
    138 z = (1-p\ :sup:`2`\ ) / p\ :sup:`2` 
     140.. math:: 
     141 
     142    z = (1-p^2 ) / p^2 
    139143 
    140144The polydispersity is 
     
    156160 
    157161This user-definable distribution should be given as as a simple ASCII text file 
    158 where the array is defined by two columns of numbers: *x* and *f(x)*. The *f(x)* 
     162where the array is defined by two columns of numbers: $x$ and $f(x)$. The $f(x)$ 
    159163will be normalized by SasView during the computation. 
    160164 
     
    172176 
    173177SasView only uses these array values during the computation, therefore any mean 
    174 value of the parameter represented by *x* present in the *FitPage* 
     178value of the parameter represented by $x$ present in the *FitPage* 
    175179will be ignored. 
    176180 
     
    181185 
    182186Many commercial Dynamic Light Scattering (DLS) instruments produce a size 
    183 polydispersity parameter, sometimes even given the symbol *p*! This parameter is 
     187polydispersity parameter, sometimes even given the symbol $p$! This parameter is 
    184188defined as the relative standard deviation coefficient of variation of the size 
    185189distribution and is NOT the same as the polydispersity parameters in the Lognormal 
  • src/sas/sasgui/perspectives/fitting/media/plugin.rst

    re081946 rc5cfb20  
    4949 
    5050Other models are available for download from our 
    51 `Model Marketplace <http://marketplace.sasview.org/>`_. You can contribute your own models to the  
     51`Model Marketplace <http://marketplace.sasview.org/>`_. You can contribute your own models to the 
    5252Marketplace aswell. 
    5353 
     
    8383    - without any capitalization or CamelCase 
    8484    - without incorporating the word "model" 
    85     - examples: *barbell* **not** *BarBell*; *broad_peak* **not** *BroadPeak*;  
     85    - examples: *barbell* **not** *BarBell*; *broad_peak* **not** *BroadPeak*; 
    8686      *barbell* **not** *BarBellModel* 
    8787 
     
    103103     at the top of the *.py* file 
    104104   - what you write here is abstracted into the SasView help documentation 
    105    - this is what other users will refer to when they want to know what your model does;  
     105   - this is what other users will refer to when they want to know what your model does; 
    106106     so please be helpful! 
    107107 
     
    128128     converted/created the model file 
    129129 
    130 Models that do not conform to these requirements will *never* be incorporated  
     130Models that do not conform to these requirements will *never* be incorporated 
    131131into the built-in library. 
    132132 
     
    309309defines the parameters that form the model. 
    310310 
    311 **Note: The order of the parameters in the definition will be the order of the  
    312 parameters in the user interface and the order of the parameters in Iq(),  
    313 Iqxy() and form_volume(). And** *scale* **and** *background* **parameters are  
     311**Note: The order of the parameters in the definition will be the order of the 
     312parameters in the user interface and the order of the parameters in Iq(), 
     313Iqxy() and form_volume(). And** *scale* **and** *background* **parameters are 
    314314implicit to all models, so they do not need to be included in the parameter table.** 
    315315 
     
    492492and it includes orientation parameters. 
    493493 
    494 *form_volume* defines the volume of the shape. As in python models, it  
     494*form_volume* defines the volume of the shape. As in python models, it 
    495495includes only the volume parameters. 
    496496 
     
    626626 
    627627    sas_gamma(x): 
    628         Gamma function $\text{sas_gamma}(x) = \Gamma(x)$. 
     628        Gamma function sas_gamma\ $(x) = \Gamma(x)$. 
    629629 
    630630        The standard math function, tgamma(x) is unstable for $x < 1$ 
     
    636636    sas_erf(x), sas_erfc(x): 
    637637        Error function 
    638         $\text{sas_erf}(x) = \frac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt$ 
     638        sas_erf\ $(x) = \frac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt$ 
    639639        and complementary error function 
    640         $\text{sas_erfc}(x) = \frac{2}{\sqrt\pi}\int_x^{\infty} e^{-t^2}\,dt$. 
     640        sas_erfc $(x) = \frac{2}{\sqrt\pi}\int_x^{\infty} e^{-t^2}\,dt$. 
    641641 
    642642        The standard math functions erf(x) and erfc(x) are slower and broken 
     
    647647 
    648648    sas_J0(x): 
    649         Bessel function of the first kind $\text{sas_J0}(x)=J_0(x)$ where 
     649        Bessel function of the first kind sas_J0\ $(x)=J_0(x)$ where 
    650650        $J_0(x) = \frac{1}{\pi}\int_0^\pi \cos(x\sin(\tau))\,d\tau$. 
    651651 
     
    656656 
    657657    sas_J1(x): 
    658         Bessel function of the first kind  $\text{sas_J1}(x)=J_1(x)$ where 
     658        Bessel function of the first kind  sas_J1\ $(x)=J_1(x)$ where 
    659659        $J_1(x) = \frac{1}{\pi}\int_0^\pi \cos(\tau - x\sin(\tau))\,d\tau$. 
    660660 
     
    666666    sas_JN(n, x): 
    667667        Bessel function of the first kind and integer order $n$: 
    668         $\text{sas_JN}(n, x)=J_n(x)$ where 
     668        sas_JN\ $(n, x)=J_n(x)$ where 
    669669        $J_n(x) = \frac{1}{\pi}\int_0^\pi \cos(n\tau - x\sin(\tau))\,d\tau$. 
    670670        If $n$ = 0 or 1, it uses sas_J0(x) or sas_J1(x), respectively. 
     
    676676 
    677677    sas_Si(x): 
    678         Sine integral $\text{Si}(x) = \int_0^x \tfrac{\sin t}{t}\,dt$. 
     678        Sine integral Si\ $(x) = \int_0^x \tfrac{\sin t}{t}\,dt$. 
    679679 
    680680        This function uses Taylor series for small and large arguments: 
     
    701701    sas_3j1x_x(x): 
    702702        Spherical Bessel form 
    703         $\text{sph_j1c}(x) = 3 j_1(x)/x = 3 (\sin(x) - x \cos(x))/x^3$, 
     703        sph_j1c\ $(x) = 3 j_1(x)/x = 3 (\sin(x) - x \cos(x))/x^3$, 
    704704        with a limiting value of 1 at $x=0$, where $j_1(x)$ is the spherical 
    705705        Bessel function of the first kind and first order. 
     
    712712 
    713713    sas_2J1x_x(x): 
    714         Bessel form $\text{sas_J1c}(x) = 2 J_1(x)/x$, with a limiting value 
     714        Bessel form sas_J1c\ $(x) = 2 J_1(x)/x$, with a limiting value 
    715715        of 1 at $x=0$, where $J_1(x)$ is the Bessel function of first kind 
    716716        and first order. 
     
    835835one return value for each point in the mesh grid. 
    836836 
    837 *NOTE: we may be removing or modifying this feature soon. As of the  
     837*NOTE: we may be removing or modifying this feature soon. As of the 
    838838time of writing, core-shell sphere returns (1., 1.) for VR, giving a volume 
    839839ratio of 1.0.* 
     
    881881............... 
    882882 
    883 Either open the :ref:`Python_shell` (*Tools* > *Python Shell/Editor*) or the :ref:`Advanced_Plugin_Editor` (*Fitting* > *Plugin Model Operations* > *Advanced  
    884 Plugin Editor*), load your model, and then select *Run > Check Model* from the  
     883Either open the :ref:`Python_shell` (*Tools* > *Python Shell/Editor*) or the :ref:`Advanced_Plugin_Editor` (*Fitting* > *Plugin Model Operations* > *Advanced 
     884Plugin Editor*), load your model, and then select *Run > Check Model* from the 
    885885menu bar. 
    886886 
    887 An *Info* box will appear with the results of the compilation and a check that  
     887An *Info* box will appear with the results of the compilation and a check that 
    888888the model runs. 
    889889 
     
    950950^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    951951 
    952 **NB: For now we are not providing pylint with the installer version of SasView;  
     952**NB: For now we are not providing pylint with the installer version of SasView; 
    953953so unless you have a SasView build environment available, you can ignore this section!** 
    954954 
  • src/sas/sasgui/perspectives/fitting/media/residuals_help.rst

    r7805458 r940d034  
    1818also provides two other measures of the quality of a fit: 
    1919 
    20 |chi|\  :sup:`2` (or 'Chi2'; pronounced 'chi-squared') 
     20$\chi^2$ (or 'Chi2'; pronounced 'chi-squared') 
    2121*  *Residuals* 
    2222 
     
    3232*Npts* such that 
    3333 
    34   *Chi2/Npts* = { SUM[(*Y_i* - *Y_theory_i*)^2 / (*Y_error_i*)^2] } / *Npts* 
     34.. math:: 
    3535 
    36 This differs slightly from what is sometimes called the 'reduced chi-squared' 
     36  \chi^2/N_{pts} =  \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] / N_{pts} 
     37 
     38This differs slightly from what is sometimes called the 'reduced $\chi^2$' 
    3739because it does not take into account the number of fitting parameters (to 
    38 calculate the number of 'degrees of freedom'), but the 'normalized chi-squared' 
    39 and the 'reduced chi-squared' are very close to each other when *Npts* >> number of 
    40 parameters. 
     40calculate the number of 'degrees of freedom'), but the 'normalized $\chi^2$ 
     41and the 'reduced $\chi^2$ are very close to each other when $N_{pts} \gg 
     42\text{number of parameters}. 
    4143 
    42 For a good fit, *Chi2/Npts* tends to 0. 
     44For a good fit, $\chi^2/N_{pts}$ tends to 1. 
    4345 
    44 *Chi2/Npts* is sometimes referred to as the 'goodness-of-fit' parameter. 
     46$\chi^2/N_{pts}$ is sometimes referred to as the 'goodness-of-fit' parameter. 
    4547 
    4648.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    5355value and its *true* value is its error). 
    5456 
    55 *SasView* calculates 'normalized residuals', *R_i*, for each data point in the 
     57*SasView* calculates 'normalized residuals', $R_i$, for each data point in the 
    5658fit: 
    5759 
    58   *R_i* = (*Y_i* - *Y_theory_i*) / (*Y_err_i*) 
     60.. math:: 
    5961 
    60 For a good fit, *R_i* ~ 0. 
     62  R_i = (Y_i - Y_theory_i) / (Y_err_i) 
     63 
     64For a good fit, $R_i \sim 0$. 
    6165 
    6266.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
  • src/sas/sasgui/perspectives/fitting/media/sm_help.rst

    r27aabc1 r5ed76f8  
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    55 
    6 .. |inlineimage004| image:: sm_image004.gif 
    7 .. |inlineimage005| image:: sm_image005.gif 
    8 .. |inlineimage008| image:: sm_image008.gif 
    9 .. |inlineimage009| image:: sm_image009.gif 
    10 .. |inlineimage010| image:: sm_image010.gif 
    11 .. |inlineimage011| image:: sm_image011.gif 
    12 .. |inlineimage012| image:: sm_image012.gif 
    13 .. |inlineimage018| image:: sm_image018.gif 
    14 .. |inlineimage019| image:: sm_image019.gif 
     6.. |inlineimage004| image:: sm_image004.png 
     7.. |inlineimage005| image:: sm_image005.png 
     8.. |inlineimage008| image:: sm_image008.png 
     9.. |inlineimage009| image:: sm_image009.png 
     10.. |inlineimage010| image:: sm_image010.png 
     11.. |inlineimage011| image:: sm_image011.png 
     12.. |inlineimage012| image:: sm_image012.png 
     13.. |inlineimage018| image:: sm_image018.png 
     14.. |inlineimage019| image:: sm_image019.png 
    1515 
    1616 
     
    2020================== 
    2121 
    22 Sometimes the instrumental geometry used to acquire the experimental data has  
    23 an impact on the clarity of features in the reduced scattering curve. For  
    24 example, peaks or fringes might be slightly broadened. This is known as  
    25 *Q resolution smearing*. To compensate for this effect one can either try and  
    26 remove the resolution contribution - a process called *desmearing* - or add the  
    27 resolution contribution into a model calculation/simulation (which by definition  
    28 will be exact) to make it more representative of what has been measured  
     22Sometimes the instrumental geometry used to acquire the experimental data has 
     23an impact on the clarity of features in the reduced scattering curve. For 
     24example, peaks or fringes might be slightly broadened. This is known as 
     25*Q resolution smearing*. To compensate for this effect one can either try and 
     26remove the resolution contribution - a process called *desmearing* - or add the 
     27resolution contribution into a model calculation/simulation (which by definition 
     28will be exact) to make it more representative of what has been measured 
    2929experimentally - a process called *smearing*. SasView will do the latter. 
    3030 
    31 Both smearing and desmearing rely on functions to describe the resolution  
     31Both smearing and desmearing rely on functions to describe the resolution 
    3232effect. SasView provides three smearing algorithms: 
    3333 
     
    3636*  *2D Smearing* 
    3737 
    38 SasView also has an option to use Q resolution data (estimated at the time of  
     38SasView also has an option to use $Q$ resolution data (estimated at the time of 
    3939data reduction) supplied in a reduced data file: the *Use dQ data* radio button. 
    4040 
     
    4343dQ Smearing 
    4444----------- 
    45   
    46 If this option is checked, SasView will assume that the supplied dQ values  
     45 
     46If this option is checked, SasView will assume that the supplied $dQ$ values 
    4747represent the standard deviations of Gaussian functions. 
    4848 
     
    5757The slit-smeared scattering intensity is defined by 
    5858 
    59 .. image:: sm_image002.gif 
     59.. image:: sm_image002.png 
    6060 
    6161where *Norm* is given by 
    6262 
    63 .. image:: sm_image003.gif 
     63.. image:: sm_image003.png 
    6464 
    6565**[Equation 1]** 
    6666 
    67 The functions |inlineimage004| and |inlineimage005| 
    68 refer to the slit width weighting function and the slit height weighting  
    69 determined at the given *q* point, respectively. It is assumed that the weighting 
     67The functions $W_v(v)$ and $W_u(u)$ 
     68refer to the slit width weighting function and the slit height weighting 
     69determined at the given $q$ point, respectively. It is assumed that the weighting 
    7070function is described by a rectangular function, such that 
    7171 
    72 .. image:: sm_image006.gif 
     72.. image:: sm_image006.png 
    7373 
    7474**[Equation 2]** 
     
    7676and 
    7777 
    78 .. image:: sm_image007.gif 
     78.. image:: sm_image007.png 
    7979 
    8080**[Equation 3]** 
    8181 
    82 so that |inlineimage008| |inlineimage009| for |inlineimage010| and *u*\ . 
    83  
    84 Here |inlineimage011| and |inlineimage012| stand for 
    85 the slit height (FWHM/2) and the slit width (FWHM/2) in *q* space. 
     82so that $\Delta q_\alpha = \int_0^\infty d\alpha W_\alpha(\alpha)$ 
     83for $\alpha = v$ and $u$. 
     84 
     85Here $\Delta q_u$ and $\Delta q_v$ stand for 
     86the slit height (FWHM/2) and the slit width (FWHM/2) in $q$ space. 
    8687 
    8788This simplifies the integral in Equation 1 to 
    8889 
    89 .. image:: sm_image013.gif 
     90.. image:: sm_image013.png 
    9091 
    9192**[Equation 4]** 
    9293 
    93 which may be solved numerically, depending on the nature of |inlineimage011| and |inlineimage012| . 
     94which may be solved numerically, depending on the nature of 
     95$\Delta q_u$ and $\Delta q_v$. 
    9496 
    9597Solution 1 
    9698^^^^^^^^^^ 
    9799 
    98 **For** |inlineimage012| **= 0 and** |inlineimage011| **= constant.** 
    99  
    100 .. image:: sm_image016.gif 
    101  
    102 For discrete *q* values, at the *q* values of the data points and at the *q* 
    103 values extended up to *q*\ :sub:`N`\ = *q*\ :sub:`i` + |inlineimage011| the smeared 
     100**For $\Delta q_v= 0$ and $\Delta q_u = \text{constant}$.** 
     101 
     102.. image:: sm_image016.png 
     103 
     104For discrete $q$ values, at the $q$ values of the data points and at the $q$ 
     105values extended up to $q_N = q_i + \Delta q_u$ the smeared 
    104106intensity can be approximately calculated as 
    105107 
    106 .. image:: sm_image017.gif 
     108.. image:: sm_image017.png 
    107109 
    108110**[Equation 5]** 
    109111 
    110 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *i* or *j* > *N-1*. 
     112where |inlineimage018| = 0 for $I_s$ when $j < i$ or $j > N-1$. 
    111113 
    112114Solution 2 
    113115^^^^^^^^^^ 
    114116 
    115 **For** |inlineimage012| **= constant and** |inlineimage011| **= 0.** 
     117**For $\Delta q_v = \text{constant}$ and $\Delta q_u= 0$.** 
    116118 
    117119Similar to Case 1 
    118120 
    119 |inlineimage019| for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012| 
     121|inlineimage019| for $q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$ 
    120122 
    121123**[Equation 6]** 
    122124 
    123 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*. 
     125where |inlineimage018| = 0 for $I_s$ when $j < p$ or $j > N-1$. 
    124126 
    125127Solution 3 
    126128^^^^^^^^^^ 
    127129 
    128 **For** |inlineimage011| **= constant and** |inlineimage011| **= constant.** 
     130**For $\Delta q_u = \text{constant}$ and $\Delta q_v = \text{constant}$.** 
    129131 
    130132In this case, the best way is to perform the integration of Equation 1 
     
    138140numerical integration for the slit width. Then 
    139141 
    140 .. image:: sm_image020.gif 
     142.. image:: sm_image020.png 
    141143 
    142144**[Equation 7]** 
    143145 
    144 for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012| 
    145  
    146 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*. 
     146for *q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$ 
     147where |inlineimage018| = 0 for *I_s$ when $j < p$ or $j > N-1$. 
    147148 
    148149.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    158159Equation 6 becomes 
    159160 
    160 .. image:: sm_image021.gif 
     161.. image:: sm_image021.png 
    161162 
    162163**[Equation 8]** 
     
    171172Thus 
    172173 
    173 .. image:: sm_image022.gif 
     174.. image:: sm_image022.png 
    174175 
    175176**[Equation 9]** 
    176177 
    177 In Equation 9, *x*\ :sub:`0` = *q* cos(|theta|), *y*\ :sub:`0` = *q* sin(|theta|), and 
    178 the primed axes, are all in the coordinate rotated by an angle |theta| about 
    179 the z-axis (see the figure below) so that *x'*\ :sub:`0` = *x*\ :sub:`0` cos(|theta|) + 
    180 *y*\ :sub:`0` sin(|theta|) and *y'*\ :sub:`0` = -*x*\ :sub:`0` sin(|theta|) + 
    181 *y*\ :sub:`0` cos(|theta|). Note that the rotation angle is zero for a x-y symmetric 
    182 elliptical Gaussian distribution. The *A* is a normalization factor. 
    183  
    184 .. image:: sm_image023.gif 
    185  
    186 Now we consider a numerical integration where each of the bins in |theta| and *R* are 
    187 *evenly* (this is to simplify the equation below) distributed by |bigdelta|\ |theta| 
    188 and |bigdelta|\ R, respectively, and it is further assumed that *I(x',y')* is constant 
     178In Equation 9, $x_0 = q \cos(\theta)$, $y_0 = q \sin(\theta)$, and 
     179the primed axes, are all in the coordinate rotated by an angle $\theta$ about 
     180the z-axis (see the figure below) so that 
     181$x'_0 = x_0 \cos(\theta) + y_0 \sin(\theta)$ and 
     182$y'_0 = -x_0 \sin(\theta) + y_0 \cos(\theta)$. 
     183Note that the rotation angle is zero for a $xy$ symmetric 
     184elliptical Gaussian distribution. The $A$ is a normalization factor. 
     185 
     186.. image:: sm_image023.png 
     187 
     188Now we consider a numerical integration where each of the bins in $\theta$ and $R$ are 
     189*evenly* (this is to simplify the equation below) distributed by $\Delta \theta$ 
     190and $\Delta R$, respectively, and it is further assumed that $I(x',y')$ is constant 
    189191within the bins. Then 
    190192 
    191 .. image:: sm_image024.gif 
     193.. image:: sm_image024.png 
    192194 
    193195**[Equation 10]** 
    194196 
    195197Since the weighting factor on each of the bins is known, it is convenient to 
    196 transform *x'-y'* back to *x-y* coordinates (by rotating it by -|theta| around the 
    197 *z* axis). 
     198transform $x'y'$ back to $xy$ coordinates (by rotating it by $-\theta$ around the 
     199$z$ axis). 
    198200 
    199201Then, for a polar symmetric smear 
    200202 
    201 .. image:: sm_image025.gif 
     203.. image:: sm_image025.png 
    202204 
    203205**[Equation 11]** 
     
    205207where 
    206208 
    207 .. image:: sm_image026.gif 
    208  
    209 while for a *x-y* symmetric smear 
    210  
    211 .. image:: sm_image027.gif 
     209.. image:: sm_image026.png 
     210 
     211while for a $xy$ symmetric smear 
     212 
     213.. image:: sm_image027.png 
    212214 
    213215**[Equation 12]** 
     
    215217where 
    216218 
    217 .. image:: sm_image028.gif 
     219.. image:: sm_image028.png 
    218220 
    219221The current version of the SasView uses Equation 11 for 2D smearing, assuming 
     
    225227------------------------- 
    226228 
    227 In all the cases above, the weighting matrix *W* is calculated on the first call 
    228 to a smearing function, and includes ~60 *q* values (finely and evenly binned) 
    229 below (>0) and above the *q* range of data in order to smear all data points for 
    230 a given model and slit/pinhole size. The *Norm*  factor is found numerically with the 
    231 weighting matrix and applied on the computation of *I*\ :sub:`s`. 
     229In all the cases above, the weighting matrix $W$ is calculated on the first call 
     230to a smearing function, and includes ~60 $q$ values (finely and evenly binned) 
     231below (>0) and above the $q$ range of data in order to smear all data points for 
     232a given model and slit/pinhole size. The $Norm$  factor is found numerically with the 
     233weighting matrix and applied on the computation of $I_s$. 
    232234 
    233235.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
  • src/sas/sasgui/perspectives/invariant/media/invariant_help.rst

    r484141c r094b9eb  
    1010----------- 
    1111 
    12 The scattering, or Porod, invariant (Q*\) is a model-independent quantity that  
     12The scattering, or Porod, invariant ($Q^*$) is a model-independent quantity that 
    1313can be easily calculated from scattering data. 
    1414 
    15 For two phase systems, the scattering invariant is defined as the integral of  
    16 the square of the wave transfer (Q) multiplied by the scattering cross section  
    17 over the full range of Q from zero to infinity, that is 
     15For two phase systems, the scattering invariant is defined as the integral of 
     16the square of the wavevector transfer ($Q$) multiplied by the scattering cross section 
     17over the full range of $Q$ from zero to infinity, that is 
    1818 
    19 .. image:: image001.gif 
     19.. math:: 
    2020 
    21 where *g = q* for pinhole geometry (SAS) and *g = q*\ :sub:`v` (the slit height) for   
    22 slit geometry (USAS). 
     21    Q^* = \int_0^\infty q^2I(q)\,dq 
    2322 
    24 The worth of Q*\  is that it can be used to determine the volume fraction and  
    25 the specific area of a sample. Whilst these quantities are useful in their own  
     23in the case of pinhole geometry. For slit geometry the invariant is given by 
     24 
     25.. math:: 
     26 
     27    Q^* = \Delta q_v \int_0^\infty qI(q)\,dq 
     28 
     29where $\Delta q_v$ is the slit height. 
     30 
     31The worth of $Q^*$  is that it can be used to determine the volume fraction and 
     32the specific area of a sample. Whilst these quantities are useful in their own 
    2633right they can also be used in further analysis. 
    2734 
    28 The difficulty with using Q*\  arises from the fact that experimental data is  
    29 never measured over the range 0 =< *Q* =< infinity. At best, combining USAS and  
    30 WAS data might cover the range 1e-5 =< *Q* =< 10 1/\ |Ang| . Thus it is usually  
    31 necessary to extrapolate the experimental data to low and high *Q*. For this 
     35The difficulty with using $Q^*$  arises from the fact that experimental data is 
     36never measured over the range $0 \le Q \le \infty$. At best, combining USAS and 
     37WAS data might cover the range $10^{-5} \le Q \le 10$ 1/\ |Ang| . Thus it is usually 
     38necessary to extrapolate the experimental data to low and high $Q$. For this 
    3239 
    33 High-*Q* region (>= *Qmax* in data) 
     40High-\ $Q$ region (>= *Qmax* in data) 
    3441 
    35 *  The power law function *C*/*Q*\ :sup:`4` is used where the constant  
    36    *C* (= 2.\ |pi|\ .(\ |bigdelta|\ |rho|\ ).\ *Sv*\ ) is to be found by fitting part of data  
    37    within the range *Q*\ :sub:`N-m` to *Q*\ :sub:`N` (where m < N). 
     42*  The power law function $C/Q^4$ is used where the constant 
     43   $C = 2 \pi \Delta\rho S_v$ is to be found by fitting part of data 
     44   within the range $Q_{N-m}$ to $Q_N$ (where $m < N$). 
    3845 
    39 Low-*Q* region (<= *Qmin* in data) 
     46Low-\ $Q$ region (<= *Qmin* in data) 
    4047 
    41 *  The Guinier function *I0.exp(-Rg*\ :sup:`2`\ *Q*\ :sup:`2`\ */3)* where *I0*  
    42    and *Rg* are obtained by fitting as for the high-*Q* region above.  
     48*  The Guinier function $I_0 exp(-R_g^2 Q^2/3)$ where $I_0$ 
     49   and $R_g$ are obtained by fitting as for the high-\ $Q$ region above. 
    4350   Alternatively a power law can be used. 
    4451 
     
    52592) Load some data with the *Data Explorer*. 
    5360 
    54 3) Select a dataset and use the *Send To* button on the *Data Explorer* to load  
     613) Select a dataset and use the *Send To* button on the *Data Explorer* to load 
    5562   the dataset into the *Invariant* panel. 
    5663 
    57 4) Use the *Customised Input* boxes on the *Invariant* panel to subtract  
    58    any background, specify the contrast (i.e. difference in SLDs - this must be  
    59    specified for the eventual value of Q*\  to be on an absolute scale), or to  
     644) Use the *Customised Input* boxes on the *Invariant* panel to subtract 
     65   any background, specify the contrast (i.e. difference in SLDs - this must be 
     66   specified for the eventual value of $Q^*$  to be on an absolute scale), or to 
    6067   rescale the data. 
    6168 
    62 5) Adjust the extrapolation range as necessary. In most cases the default  
     695) Adjust the extrapolation range as necessary. In most cases the default 
    6370   values will suffice. 
    6471 
    65726) Click the *Compute* button. 
    6673 
    67 7) To include a lower and/or higher Q range, check the relevant *Enable  
     747) To include a lower and/or higher $Q$ range, check the relevant *Enable 
    6875   Extrapolate* check boxes. 
    69     
    70    If power law extrapolations are chosen, the exponent can be either held  
    71    fixed or fitted. The number of points, Npts, to be used for the basis of the  
     76 
     77   If power law extrapolations are chosen, the exponent can be either held 
     78   fixed or fitted. The number of points, Npts, to be used for the basis of the 
    7279   extrapolation can also be specified. 
    7380 
    74 8) If the value of Q*\  calculated with the extrapolated regions is invalid, a  
     818) If the value of $Q^*$  calculated with the extrapolated regions is invalid, a 
    7582   red warning will appear at the top of the *Invariant* panel. 
    7683 
    77    The details of the calculation are available by clicking the *Details*  
     84   The details of the calculation are available by clicking the *Details* 
    7885   button in the middle of the panel. 
    7986 
    80 .. image:: image005.gif 
     87.. image:: image005.png 
    8188 
    8289.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    8895^^^^^^^^^^^^^^^ 
    8996 
    90 The volume fraction |phi| is related to Q*\  by 
     97The volume fraction $\phi$ is related to $Q^*$  by 
    9198 
    92 .. image:: image002.gif 
     99.. math:: 
    93100 
    94 where |bigdelta|\ |rho| is the SLD contrast. 
     101    \phi(1 - \phi) = \frac{Q^*}{2\pi^2(\Delta\rho)^2} \equiv A 
    95102 
    96 .. image:: image003.gif 
     103where $\Delta\rho$ is the SLD contrast. 
     104 
     105.. math:: 
     106 
     107    \phi = \frac{1 \pm \sqrt{1 - 4A}}{2} 
    97108 
    98109.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    101112^^^^^^^^^^^^^^^^^^^^^ 
    102113 
    103 The specific surface area *Sv* is related to Q*\  by 
     114The specific surface area $S_v$ is related to $Q^*$  by 
    104115 
    105 .. image:: image004.gif 
     116.. math:: 
    106117 
    107 where *Cp* is the Porod constant. 
     118    S_v = \frac{2\pi\phi(1-\phi)C_p}{Q^*} = \frac{2\pi A C_p}{Q^*} 
     119 
     120where $C_p$ is the Porod constant. 
    108121 
    109122.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
Note: See TracChangeset for help on using the changeset viewer.