Changes in / [bcabf4e:2510b9b] in sasview


Ignore:
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

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

    r9a182b2 r220b1e7  
    5353# General information about the project. 
    5454project = u'SasView' 
    55 copyright = u'2015, The SasView Project' 
     55copyright = u'2017, 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.0' 
     62version = '4.1' 
    6363# The full version, including alpha/beta/rc tags. 
    64 release = '4.0.0' 
     64release = '4.1.0' 
    6565 
    6666# The language for content autogenerated by Sphinx. Refer to documentation 
  • sasview/README.txt

    r9a182b2 r220b1e7  
    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 
    613    - New in Version 4.0 
    714      ------------------ 
  • sasview/__init__.py

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

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

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

    rdc8a553 r2ab9c432  
    11#include <Python.h> 
     2//#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 
    23#include <numpy/arrayobject.h> 
    34#include <stdio.h> 
     
    2122static PyObject *CLoader_init(CLoader *self, PyObject *args, PyObject *kwds) { 
    2223    const char *filename; 
    23     const int n_frames; 
    24     const int n_pixels; 
    25     const int n_rasters; 
    26     const int swap_bytes; 
     24    int n_frames; 
     25    int n_pixels; 
     26    int n_rasters; 
     27    int swap_bytes; 
    2728 
    2829    if (self != NULL) { 
  • src/sas/sasgui/guiframe/customdir.py

    r212bfc2 r73cbeec  
    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") 
    3641    except: 
    3742        # Check for data path next to exe/zip file. 
  • src/sas/sasgui/guiframe/gui_manager.py

    rd3911e3 r73cbeec  
    152152SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 
    153153SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 
     154SAS_OPENCL = config.SAS_OPENCL 
    154155if not WELCOME_PANEL_ON: 
    155156    WELCOME_PANEL_SHOW = False 
     
    176177    else: 
    177178        DEFAULT_OPEN_FOLDER = PATH_APP 
     179    SAS_OPENCL = custom_config.SAS_OPENCL 
    178180except: 
    179181    DATALOADER_SHOW = True 
     
    190192    CLEANUP_PLOT = False 
    191193    DEFAULT_OPEN_FOLDER = PATH_APP 
    192  
     194    SAS_OPENCL = None 
    193195DEFAULT_STYLE = config.DEFAULT_STYLE 
    194196 
     
    225227        CHILD_FRAME = wx.Frame 
    226228 
     229#Initiliaze enviromental variable with custom setting but only if variable not set 
     230if SAS_OPENCL and not "SAS_OPENCL" in os.environ: 
     231    os.environ["SAS_OPENCL"] = SAS_OPENCL 
    227232 
    228233class ViewerFrame(PARENT_FRAME): 
     
    21042109        Quit the application 
    21052110        """ 
     2111        #IF SAS_OPENCL is set, settings are stored in the custom config file 
     2112        self._write_opencl_config_file() 
    21062113        logging.info(" --- SasView session was closed --- \n") 
    21072114        wx.Exit() 
    21082115        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 
    21092144 
    21102145    def _check_update(self, event=None): 
  • src/sas/sasgui/guiframe/startup_configuration.py

    rd85c194 r73cbeec  
    3131                   'CLEANUP_PLOT':False, 
    3232                   'DEFAULT_PERSPECTIVE':'Fitting', 
    33                    'DEFAULT_OPEN_FOLDER': None} 
     33                   'DEFAULT_OPEN_FOLDER': None, 
     34                   'SAS_OPENCL': None} 
    3435try: 
    3536    CURRENT_STRINGS = {'GUIFRAME_WIDTH':CURRENT.GUIFRAME_WIDTH, 
     
    4546                       'CLEANUP_PLOT':CURRENT.CLEANUP_PLOT, 
    4647                       'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE, 
    47                        'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER} 
     48                       'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER, 
     49                       'SAS_OPENCL': None} 
    4850except: 
    4951    CURRENT_STRINGS = DEFAULT_STRINGS 
  • src/sas/sasgui/perspectives/corfunc/corfunc.py

    r96d293da r1dc8ec9  
    3232        self._always_active = True 
    3333        self.state_reader = Reader(self.set_state) 
    34         self._extensions = '.cor' 
     34        self._extensions = '.crf' 
    3535 
    3636    def get_panels(self, parent): 
     
    4848 
    4949        l = Loader() 
    50         l.associate_file_reader('.cor', self.state_reader) 
     50        l.associate_file_reader('.crf', 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_LABEL: 
     69        if data.id == IQ_DATA_LABEL or data.id == IQ_EXTRAPOLATED_DATA_LABEL or data.id == TRANSFORM_LABEL1 or data.id == TRANSFORM_LABEL3: 
    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 .cor file is loaded 
     83        Callback for CorfuncState reader. Called when a .crf 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_LABEL: 
     181        elif label == TRANSFORM_LABEL1 or label == TRANSFORM_LABEL3: 
    182182            new_plot.xaxis("{x}", 'A') 
    183183            new_plot.yaxis("{\\Gamma}", '') 
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    rd45d590 r1dc8ec9  
    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_LABEL) 
     276        self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL1) 
    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, "*.cor", wx.SAVE) 
     327                            self.window_caption, "*.crf", 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 = ".cor" 
     338        extens = ".crf" 
    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

    rd45d590 rae9b8bf  
    9696            self.background = value 
    9797 
    98     def toXML(self, filename='corfunc_state.cor', doc=None, entry_node=None): 
     98    def toXML(self, filename='corfunc_state.crf', 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 (*.cor)|*.cor", 
     259    type = ["Corfunc file (*.crf)|*.crf", 
    260260            "SASView file (*.svs)|*.svs"] 
    261261 
    262     ext = ['.cor', '.COR', '.svs', '.SVS'] 
     262    ext = ['.crf', '.CRF', '.svs', '.SVS'] 
    263263 
    264264    def __init__(self, callback): 
  • src/sas/sasgui/perspectives/corfunc/plot_labels.py

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

    r1a5d5f2 r73cbeec  
    4545from sas.sasgui.guiframe.gui_manager import MDIFrame 
    4646from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
     47from sas.sasgui.perspectives.fitting.gpu_options import GpuOptions 
    4748 
    4849from . import models 
     
    192193        self.bumps_options_menu = self.menu1.FindItemById(self.id_bumps_options) 
    193194        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) 
    194199 
    195200        self.id_result_panel = wx.NewId() 
     
    801806        self.result_frame.Show() 
    802807        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() 
    803815 
    804816    def stop_fit(self, uid): 
  • src/sas/sasgui/perspectives/fitting/media/plugin.rst

    rca1eaeb rca6cbc1c  
    568568    cube(x): 
    569569        $x^3$ 
    570     sinc(x): 
     570    sas_sinx_x(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     Si(x): 
     671    sas_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     sph_j1c(x): 
     695    sas_3j1x_x(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/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): 
     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): 
    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

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

    r0391dae r1221196  
    1010----------- 
    1111 
    12 This tool calculates a real-space distance distribution function, *P(r)*, using  
    13 the inversion approach (Moore, 1908). 
     12This tool calculates a real-space distance distribution function, *P(r)*, using 
     13the inversion approach (Moore, 1980). 
    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.