Changes in / [0688888:12361fd] in sasview


Ignore:
Files:
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r51f1c347 r5dd7499  
    1414.vagrant 
    1515.idea 
    16 .settings/ 
    1716build 
    1817dist 
  • docs/sphinx-docs/source/conf.py

    r220b1e7 r9a182b2  
    5353# General information about the project. 
    5454project = u'SasView' 
    55 copyright = u'2017, The SasView Project' 
     55copyright = u'2015, The SasView Project' 
    5656 
    5757# The version info for the project you're documenting, acts as replacement for 
     
    6060# 
    6161# The short X.Y version. 
    62 version = '4.1' 
     62version = '4.0' 
    6363# The full version, including alpha/beta/rc tags. 
    64 release = '4.1.0' 
     64release = '4.0.0' 
    6565 
    6666# The language for content autogenerated by Sphinx. Refer to documentation 
  • sasview/README.txt

    r220b1e7 r9a182b2  
    441- Features 
    55=========== 
    6     - New in Version 4.0.1 
    7       ------------------ 
    8       This release fixes the critical bug #750 in P(Q)*S(Q).  Most damaging 
    9       it appears that the background term was being added to S(Q) prior to 
    10       multiplication by P(Q). 
    11  
    12  
    136    - New in Version 4.0 
    147      ------------------ 
  • sasview/__init__.py

    r220b1e7 r9a182b2  
    1 __version__ = "4.1" 
     1__version__ = "4.0" 
    22__build__ = "GIT_COMMIT" 
    33try: 
  • sasview/custom_config.py

    r73cbeec r79492222  
    1515TOOLBAR_SHOW = True 
    1616DEFAULT_PERSPECTIVE = "Fitting" 
    17 SAS_OPENCL = "None" 
  • sasview/local_config.py

    r73cbeec r49e000b  
    9797GUIFRAME_WIDTH = 1150 
    9898GUIFRAME_HEIGHT = 840 
    99 PLUGIN_STATE_EXTENSIONS = ['.fitv', '.inv', '.prv', '.crf'] 
     99PLUGIN_STATE_EXTENSIONS = ['.fitv', '.inv', '.prv', '.cor'] 
    100100PLUGINS_WLIST = ['Fitting files (*.fitv)|*.fitv', 
    101101                 'Invariant files (*.inv)|*.inv', 
    102102                 'P(r) files (*.prv)|*.prv', 
    103                  'Corfunc files (*.crf)|*.crf'] 
     103                 'Corfunc files (*.cor)|*.cor'] 
    104104PLOPANEL_WIDTH = 415 
    105105PLOPANEL_HEIGTH = 370 
     
    140140UPDATE_TIMEOUT = 2 
    141141 
    142 #OpenCL option 
    143 SAS_OPENCL = None 
    144  
    145142def printEVT(message): 
    146143    if __EVT_DEBUG__: 
  • src/sas/sasgui/guiframe/customdir.py

    r73cbeec r212bfc2  
    3434        if not os.path.isfile(config_file): 
    3535            shutil.copyfile(os.path.join(path, "custom_config.py"), config_file) 
    36  
    37         #Adding SAS_OPENCL if it doesn't exist in the config file 
    38         # - to support backcompability 
    39         if not "SAS_OPENCL" in open(config_file).read(): 
    40             open(config_file,"a+").write("SAS_OPENCL = \"None\"\n") 
    4136    except: 
    4237        # Check for data path next to exe/zip file. 
  • src/sas/sasgui/guiframe/gui_manager.py

    r73cbeec rd3911e3  
    152152SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 
    153153SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 
    154 SAS_OPENCL = config.SAS_OPENCL 
    155154if not WELCOME_PANEL_ON: 
    156155    WELCOME_PANEL_SHOW = False 
     
    177176    else: 
    178177        DEFAULT_OPEN_FOLDER = PATH_APP 
    179     SAS_OPENCL = custom_config.SAS_OPENCL 
    180178except: 
    181179    DATALOADER_SHOW = True 
     
    192190    CLEANUP_PLOT = False 
    193191    DEFAULT_OPEN_FOLDER = PATH_APP 
    194     SAS_OPENCL = None 
     192 
    195193DEFAULT_STYLE = config.DEFAULT_STYLE 
    196194 
     
    227225        CHILD_FRAME = wx.Frame 
    228226 
    229 #Initiliaze enviromental variable with custom setting but only if variable not set 
    230 if SAS_OPENCL and not "SAS_OPENCL" in os.environ: 
    231     os.environ["SAS_OPENCL"] = SAS_OPENCL 
    232227 
    233228class ViewerFrame(PARENT_FRAME): 
     
    21092104        Quit the application 
    21102105        """ 
    2111         #IF SAS_OPENCL is set, settings are stored in the custom config file 
    2112         self._write_opencl_config_file() 
    21132106        logging.info(" --- SasView session was closed --- \n") 
    21142107        wx.Exit() 
    21152108        sys.exit() 
    2116  
    2117     def _write_opencl_config_file(self): 
    2118         """ 
    2119         Writes OpenCL settings to custom config file, so they can be remmbered 
    2120         from session to session 
    2121         """ 
    2122         if custom_config is not None: 
    2123             sas_opencl = os.environ.get("SAS_OPENCL",None) 
    2124             new_config_lines = [] 
    2125             config_file = open(custom_config.__file__) 
    2126             config_lines = config_file.readlines() 
    2127             for line in config_lines: 
    2128                 if "SAS_OPENCL" in line: 
    2129                     if sas_opencl: 
    2130                         new_config_lines.append("SAS_OPENCL = \""+sas_opencl+"\"") 
    2131                     else: 
    2132                         new_config_lines.append("SAS_OPENCL = None") 
    2133                 else: 
    2134                     new_config_lines.append(line) 
    2135             config_file.close() 
    2136  
    2137             #If custom_config is None, settings will not be remmbered 
    2138             new_config_file = open(custom_config.__file__,"w") 
    2139             new_config_file.writelines(new_config_lines) 
    2140             new_config_file.close() 
    2141         else: 
    2142             logging.info("Failed to save OPENCL settings in custom config file") 
    2143  
    21442109 
    21452110    def _check_update(self, event=None): 
  • src/sas/sasgui/guiframe/startup_configuration.py

    r73cbeec rd85c194  
    3131                   'CLEANUP_PLOT':False, 
    3232                   'DEFAULT_PERSPECTIVE':'Fitting', 
    33                    'DEFAULT_OPEN_FOLDER': None, 
    34                    'SAS_OPENCL': None} 
     33                   'DEFAULT_OPEN_FOLDER': None} 
    3534try: 
    3635    CURRENT_STRINGS = {'GUIFRAME_WIDTH':CURRENT.GUIFRAME_WIDTH, 
     
    4645                       'CLEANUP_PLOT':CURRENT.CLEANUP_PLOT, 
    4746                       'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE, 
    48                        'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER, 
    49                        'SAS_OPENCL': None} 
     47                       'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER} 
    5048except: 
    5149    CURRENT_STRINGS = DEFAULT_STRINGS 
  • src/sas/sasgui/perspectives/corfunc/corfunc.py

    r1dc8ec9 r96d293da  
    3232        self._always_active = True 
    3333        self.state_reader = Reader(self.set_state) 
    34         self._extensions = '.crf' 
     34        self._extensions = '.cor' 
    3535 
    3636    def get_panels(self, parent): 
     
    4848 
    4949        l = Loader() 
    50         l.associate_file_reader('.crf', self.state_reader) 
     50        l.associate_file_reader('.cor', self.state_reader) 
    5151 
    5252        return [self.corfunc_panel] 
     
    6767            return [] 
    6868        data = plotpanel.plots[graph.selected_plottable] 
    69         if data.id == IQ_DATA_LABEL or data.id == IQ_EXTRAPOLATED_DATA_LABEL or data.id == TRANSFORM_LABEL1 or data.id == TRANSFORM_LABEL3: 
     69        if data.id == IQ_DATA_LABEL or data.id == IQ_EXTRAPOLATED_DATA_LABEL or data.id == TRANSFORM_LABEL: 
    7070            return [] 
    7171        item = plotpanel.plots[graph.selected_plottable] 
     
    8181    def set_state(self, state=None, datainfo=None): 
    8282        """ 
    83         Callback for CorfuncState reader. Called when a .crf file is loaded 
     83        Callback for CorfuncState reader. Called when a .cor file is loaded 
    8484        """ 
    8585        if isinstance(datainfo, list): 
     
    179179                # Show the extrapolation as a curve instead of points 
    180180                new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 
    181         elif label == TRANSFORM_LABEL1 or label == TRANSFORM_LABEL3: 
     181        elif label == TRANSFORM_LABEL: 
    182182            new_plot.xaxis("{x}", 'A') 
    183183            new_plot.yaxis("{\\Gamma}", '') 
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    r1dc8ec9 rd45d590  
    274274        plot_x = transform.x[np.where(transform.x <= 200)] 
    275275        plot_y = transform.y[np.where(transform.x <= 200)] 
    276         self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL1) 
     276        self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL) 
    277277        # Only enable extract params button if a fourier trans. has been done 
    278278        if self.transform_type == 'fourier': 
     
    325325        dlg = wx.FileDialog(self, "Choose a file", 
    326326                            default_save_location, \ 
    327                             self.window_caption, "*.crf", wx.SAVE) 
     327                            self.window_caption, "*.cor", wx.SAVE) 
    328328        if dlg.ShowModal() == wx.ID_OK: 
    329329            path = dlg.GetPath() 
     
    336336        dlg.Destroy() 
    337337        # MAC always needs the extension for saving 
    338         extens = ".crf" 
     338        extens = ".cor" 
    339339        # Make sure the ext included in the file name 
    340340        f_name = os.path.splitext(path)[0] + extens 
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    rae9b8bf rd45d590  
    9696            self.background = value 
    9797 
    98     def toXML(self, filename='corfunc_state.crf', doc=None, entry_node=None): 
     98    def toXML(self, filename='corfunc_state.cor', doc=None, entry_node=None): 
    9999        """ 
    100100        Writes the state of the CorfuncPanel panel to file, as XML. 
     
    257257    type_name = "Corfunc" 
    258258 
    259     type = ["Corfunc file (*.crf)|*.crf", 
     259    type = ["Corfunc file (*.cor)|*.cor", 
    260260            "SASView file (*.svs)|*.svs"] 
    261261 
    262     ext = ['.crf', '.CRF', '.svs', '.SVS'] 
     262    ext = ['.cor', '.COR', '.svs', '.SVS'] 
    263263 
    264264    def __init__(self, callback): 
  • src/sas/sasgui/perspectives/corfunc/plot_labels.py

    r1dc8ec9 rff11b21  
    44 
    55GROUP_ID_TRANSFORM = r"$\Gamma(x)$" 
    6 TRANSFORM_LABEL1 = r"$\Gamma1(x)$" 
    7 TRANSFORM_LABEL3 = r"$\Gamma3(x)$" 
     6TRANSFORM_LABEL = r"$\Gamma(x)$" 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r73cbeec r1a5d5f2  
    4545from sas.sasgui.guiframe.gui_manager import MDIFrame 
    4646from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
    47 from sas.sasgui.perspectives.fitting.gpu_options import GpuOptions 
    4847 
    4948from . import models 
     
    193192        self.bumps_options_menu = self.menu1.FindItemById(self.id_bumps_options) 
    194193        self.bumps_options_menu.Enable(True) 
    195  
    196         self.id_gpu_options_panel = wx.NewId() 
    197         self.menu1.Append(self.id_gpu_options_panel, "OpenCL Options", "Choose OpenCL driver or turn it off") 
    198         wx.EVT_MENU(owner, self.id_gpu_options_panel, self.on_gpu_options) 
    199194 
    200195        self.id_result_panel = wx.NewId() 
     
    806801        self.result_frame.Show() 
    807802        self.result_frame.Raise() 
    808  
    809     def on_gpu_options(self, event=None): 
    810         """ 
    811         Make the Fit Results panel visible. 
    812         """ 
    813         dialog = GpuOptions(None, wx.ID_ANY, "") 
    814         dialog.Show() 
    815803 
    816804    def stop_fit(self, uid): 
  • src/sas/sasgui/perspectives/fitting/media/plugin.rst

    rca6cbc1c rca1eaeb  
    568568    cube(x): 
    569569        $x^3$ 
    570     sas_sinx_x(x): 
     570    sinc(x): 
    571571        $\sin(x)/x$, with limit $\sin(0)/0 = 1$. 
    572572    powr(x, y): 
     
    669669        (`link to Bessel function's code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_JN.c>`_) 
    670670 
    671     sas_Si(x): 
     671    Si(x): 
    672672        Sine integral $\text{Si}(x) = \int_0^x \tfrac{\sin t}{t}\,dt$. 
    673673 
     
    693693        (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/Si.c>`_) 
    694694 
    695     sas_3j1x_x(x): 
     695    sph_j1c(x): 
    696696        Spherical Bessel form 
    697697        $\text{sph_j1c}(x) = 3 j_1(x)/x = 3 (\sin(x) - x \cos(x))/x^3$, 
     
    701701        This function uses a Taylor series for small $x$ for numerical accuracy. 
    702702 
    703         :code:`source = ["lib/sas_3j1x_x.c", ...]` 
    704         (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_3j1x_x.c>`_) 
    705  
    706  
    707     sas_2J1x_x(x): 
     703        :code:`source = ["lib/sph_j1c.c", ...]` 
     704        (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sph_j1c.c>`_) 
     705 
     706 
     707    sas_J1c(x): 
    708708        Bessel form $\text{sas_J1c}(x) = 2 J_1(x)/x$, with a limiting value 
    709709        of 1 at $x=0$, where $J_1(x)$ is the Bessel function of first kind 
  • src/sas/sasgui/perspectives/fitting/media/sm_help.rst

    r27aabc1 r7805458  
    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  
    29 experimentally - a process called *smearing*. SasView will do the latter. 
    30  
    31 Both smearing and desmearing rely on functions to describe the resolution  
    32 effect. SasView provides three smearing algorithms: 
     22Sometimes it will be necessary to correct reduced experimental data for the 
     23physical effects of the instrumental geometry in use. This process is called 
     24*desmearing*. However, calculated/simulated data - which by definition will be 
     25perfect/exact - can be *smeared* to make it more representative of what might 
     26actually be measured experimentally. 
     27 
     28SasView provides the following three smearing algorithms: 
    3329 
    3430*  *Slit Smearing* 
    3531*  *Pinhole Smearing* 
    3632*  *2D Smearing* 
    37  
    38 SasView also has an option to use Q resolution data (estimated at the time of  
    39 data reduction) supplied in a reduced data file: the *Use dQ data* radio button. 
    40  
    41 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    42  
    43 dQ Smearing 
    44 ----------- 
    45   
    46 If this option is checked, SasView will assume that the supplied dQ values  
    47 represent the standard deviations of Gaussian functions. 
    4833 
    4934.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
  • src/sas/sasgui/perspectives/fitting/model_thread.py

    rc1681ea rd3911e3  
    197197            output[index] = self.model.evalDistribution(self.data.x[index]) 
    198198 
    199         sq_values = None 
    200         pq_values = None 
    201         s_model = None 
    202         p_model = None 
     199        sq_model = None 
     200        pq_model = None 
    203201        if isinstance(self.model, MultiplicationModel): 
    204             s_model = self.model.s_model 
    205             p_model = self.model.p_model 
    206         elif hasattr(self.model, "get_composition_models"): 
    207             p_model, s_model = self.model.get_composition_models() 
    208  
    209         if p_model is not None and s_model is not None: 
    210             sq_values = numpy.zeros((len(self.data.x))) 
    211             pq_values = numpy.zeros((len(self.data.x))) 
    212             sq_values[index] = s_model.evalDistribution(self.data.x[index]) 
    213             pq_values[index] = p_model.evalDistribution(self.data.x[index]) 
     202            sq_model = numpy.zeros((len(self.data.x))) 
     203            pq_model = numpy.zeros((len(self.data.x))) 
     204            sq_model[index] = self.model.s_model.evalDistribution(self.data.x[index]) 
     205            pq_model[index] = self.model.p_model.evalDistribution(self.data.x[index]) 
    214206 
    215207        elapsed = time.time() - self.starttime 
     
    228220                      unsmeared_data=unsmeared_data, 
    229221                      unsmeared_error=unsmeared_error, 
    230                       pq_model=pq_values, 
    231                       sq_model=sq_values) 
     222                      pq_model=pq_model, 
     223                      sq_model=sq_model) 
    232224 
    233225    def results(self): 
  • src/sas/sasgui/perspectives/pr/media/pr_help.rst

    r1221196 r0391dae  
    1010----------- 
    1111 
    12 This tool calculates a real-space distance distribution function, *P(r)*, using 
    13 the inversion approach (Moore, 1980). 
     12This tool calculates a real-space distance distribution function, *P(r)*, using  
     13the inversion approach (Moore, 1908). 
    1414 
    1515*P(r)* is set to be equal to an expansion of base functions of the type 
     
    2424 
    2525  \chi^2=\frac{\sum_i (I_{meas}(Q_i)-I_{th}(Q_i))^2}{error^2}+Reg\_term 
    26  
     26   
    2727 
    2828where $I_{meas}(Q_i)$ is the measured scattering intensity and $I_{th}(Q_i)$ is 
    29 the prediction from the Fourier transform of the *P(r)* expansion. 
     29the prediction from the Fourier transform of the *P(r)* expansion.  
    3030 
    31 The $Reg\_term$ term is a regularization term set to the second derivative 
     31The $Reg\_term$ term is a regularization term set to the second derivative  
    3232$d^2P(r)/d^2r$ integrated over $r$. It is used to produce a smooth *P(r)* output. 
    3333 
     
    4040 
    4141*  *Number of terms*: the number of base functions in the P(r) expansion. 
    42  
     42    
    4343*  *Regularization constant*: a multiplicative constant to set the size of 
    4444   the regularization term. 
Note: See TracChangeset for help on using the changeset viewer.