Changes in / [a4340d1:0c4bca6] in sasview


Ignore:
Files:
104 added
43 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • docs/sphinx-docs/build_sphinx.py

    r296f290 r7168b8b  
    2929SPHINX_SOURCE = os.path.join(CURRENT_SCRIPT_DIR, "source") 
    3030SPHINX_SOURCE_API = os.path.join(SPHINX_SOURCE, "dev", "api") 
     31SPHINX_SOURCE_GUIFRAME = os.path.join(SPHINX_SOURCE, "user", "guiframe") 
     32SPHINX_SOURCE_MODELS = os.path.join(SPHINX_SOURCE, "user", "models") 
     33SPHINX_SOURCE_PERSPECTIVES = os.path.join(SPHINX_SOURCE, "user", "perspectives") 
    3134 
    3235def _remove_dir(dir_path): 
     
    4346    _remove_dir(SASVIEW_DOCS) 
    4447    _remove_dir(SPHINX_BUILD) 
     48    _remove_dir(SPHINX_SOURCE_GUIFRAME) 
     49    _remove_dir(SPHINX_SOURCE_MODELS) 
     50    _remove_dir(SPHINX_SOURCE_PERSPECTIVES) 
    4551 
    4652def retrieve_user_docs(): 
  • docs/sphinx-docs/source/user/user.rst

    ref325c7 r3702c12  
    1212   Plotting Data/Models <guiframe/graph_help> 
    1313    
    14    Fitting Perspective <fitting/fitting_help> 
    1514    
    16    P(r) Inversion Perspective <invariant/pr_help> 
     15   Fitting Perspective <perspectives/fitting/fitting_help> 
    1716    
    18    Invariant Calculation Perspective <invariant/invariant_help> 
     17   P(r) Inversion Perspective <perspectives/pr/pr_help> 
     18    
     19   Invariant Calculation Perspective <perspectives/invariant/invariant_help> 
    1920    
    2021   
    21    Data Operations Tool <data_util/data_operator_help> 
     22   Data Operations Tool <perspectives/calculator/data_operator_help> 
     23       
     24   Density/Volume Calculator Tool <perspectives/calculator/density_calculator_help> 
    2225    
    23    SLD Calculator Tool <calculator/sld_calculator_help> 
     26   Generic Scattering Calculator Tool <perspectives/calculator/sas_calculator_help> 
    2427    
    25    Density/Volume Calculator Tool <calculator/density_calculator_help> 
     28   Image Viewer Tool <perspectives/calculator/image_viewer_help> 
     29       
     30   Kiessig Thickness Calculator Tool <perspectives/calculator/kiessig_calculator_help> 
    2631    
    27    Slit Size Calculator Tool <calculator/slit_calculator_help> 
     32   SLD Calculator Tool <perspectives/calculator/sld_calculator_help> 
    2833    
    29    Kiessig Thickness Calculator Tool <calculator/kiessig_calculator_help> 
     34   Slit Size Calculator Tool <perspectives/calculator/slit_calculator_help> 
    3035    
    31    SANS Resolution Estimator Tool <calculator/resolution_calculator_help> 
     36   SANS Resolution Estimator Tool <perspectives/calculator/resolution_calculator_help> 
    3237    
    33    Generic Scattering Calculator Tool <calculator/sas_calculator_help> 
    3438    
    35    Python Shell Tool 
    36     
    37    Image Viewer Tool 
     39   Python Shell Tool <perspectives/calculator/python_shell_help> 
  • setup.py

    ra6d2e3b rd8c4019  
    88from distutils.command.build_ext import build_ext 
    99from distutils.core import Command 
    10  
    11 sys.path.append("docs/sphinx-docs") 
    12 import build_sphinx 
    1310 
    1411try: 
     
    158155        self.cwd = os.getcwd() 
    159156 
    160     def run(self):         
     157    def run(self): 
     158        sys.path.append("docs/sphinx-docs") 
     159        import build_sphinx 
     160 
    161161        build_sphinx.clean() 
    162162        build_sphinx.retrieve_user_docs() 
  • src/sas/dataloader/data_info.py

    rb3efb7d r7eaf9f2  
    2525import numpy 
    2626import math 
     27 
     28 
     29class plottable_sesans1D: 
     30    """ 
     31    SESANS is a place holder for 1D SESANS plottables. 
     32     
     33    #TODO: This was directly copied from the plottables_1D. 
     34    #TODO: The class has not been updated from there. 
     35    """ 
     36    # The presence of these should be mutually 
     37    # exclusive with the presence of Qdev (dx) 
     38    x = None 
     39    y = None 
     40    dx = None 
     41    dy = None 
     42    ## Slit smearing length 
     43    dxl = None 
     44    ## Slit smearing width 
     45    dxw = None 
     46     
     47    # Units 
     48    _xaxis = '' 
     49    _xunit = '' 
     50    _yaxis = '' 
     51    _yunit = '' 
     52     
     53    def __init__(self, x, y, dx=None, dy=None, dxl=None, dxw=None): 
     54        self.x = numpy.asarray(x) 
     55        self.y = numpy.asarray(y) 
     56        if dx is not None: 
     57            self.dx = numpy.asarray(dx) 
     58        if dy is not None: 
     59            self.dy = numpy.asarray(dy) 
     60        if dxl is not None: 
     61            self.dxl = numpy.asarray(dxl) 
     62        if dxw is not None:  
     63            self.dxw = numpy.asarray(dxw) 
     64 
     65    def xaxis(self, label, unit): 
     66        """ 
     67        set the x axis label and unit 
     68        """ 
     69        self._xaxis = label 
     70        self._xunit = unit 
     71         
     72    def yaxis(self, label, unit): 
     73        """ 
     74        set the y axis label and unit 
     75        """ 
     76        self._yaxis = label 
     77        self._yunit = unit 
    2778 
    2879 
     
    940991         
    941992         
     993class SESANSData1D(plottable_sesans1D, DataInfo): 
     994    """ 
     995    SESANS 1D data class 
     996    """ 
     997    x_unit = '1/A' 
     998    y_unit = '1/cm' 
     999     
     1000    def __init__(self, x, y, dx=None, dy=None): 
     1001        DataInfo.__init__(self) 
     1002        plottable_sesans1D.__init__(self, x, y, dx, dy) 
     1003         
     1004    def __str__(self): 
     1005        """ 
     1006        Nice printout 
     1007        """ 
     1008        _str =  "%s\n" % DataInfo.__str__(self) 
     1009     
     1010        _str += "Data:\n" 
     1011        _str += "   Type:         %s\n" % self.__class__.__name__ 
     1012        _str += "   X-axis:       %s\t[%s]\n" % (self._xaxis, self._xunit) 
     1013        _str += "   Y-axis:       %s\t[%s]\n" % (self._yaxis, self._yunit) 
     1014        _str += "   Length:       %g\n" % len(self.x) 
     1015 
     1016        return _str 
     1017 
     1018    def is_slit_smeared(self): 
     1019        """ 
     1020        Check whether the data has slit smearing information 
     1021         
     1022        :return: True is slit smearing info is present, False otherwise 
     1023         
     1024        """ 
     1025        def _check(v): 
     1026            if (v.__class__ == list or v.__class__ == numpy.ndarray) \ 
     1027                and len(v) > 0 and min(v) > 0: 
     1028                return True 
     1029             
     1030            return False 
     1031         
     1032        return _check(self.dxl) or _check(self.dxw) 
     1033         
     1034    def clone_without_data(self, length=0, clone=None): 
     1035        """ 
     1036        Clone the current object, without copying the data (which 
     1037        will be filled out by a subsequent operation). 
     1038        The data arrays will be initialized to zero. 
     1039         
     1040        :param length: length of the data array to be initialized 
     1041        :param clone: if provided, the data will be copied to clone 
     1042        """ 
     1043        from copy import deepcopy 
     1044         
     1045        if clone is None or not issubclass(clone.__class__, Data1D): 
     1046            x  = numpy.zeros(length) 
     1047            dx = numpy.zeros(length) 
     1048            y  = numpy.zeros(length) 
     1049            dy = numpy.zeros(length) 
     1050            clone = Data1D(x, y, dx=dx, dy=dy) 
     1051         
     1052        clone.title          = self.title 
     1053        clone.run            = self.run 
     1054        clone.filename       = self.filename 
     1055        clone.instrument     = self.instrument 
     1056        clone.notes          = deepcopy(self.notes) 
     1057        clone.process        = deepcopy(self.process) 
     1058        clone.detector       = deepcopy(self.detector) 
     1059        clone.sample         = deepcopy(self.sample) 
     1060        clone.source         = deepcopy(self.source) 
     1061        clone.collimation    = deepcopy(self.collimation) 
     1062        clone.trans_spectrum = deepcopy(self.trans_spectrum) 
     1063        clone.meta_data      = deepcopy(self.meta_data) 
     1064        clone.errors         = deepcopy(self.errors) 
     1065         
     1066        return clone 
     1067     
     1068     
    9421069class Data2D(plottable_2D, DataInfo): 
    9431070    """ 
  • src/sas/dataloader/manipulations.py

    r79492222 r400155b  
    582582    """ 
    583583    #Todo: remove center. 
    584     def __init__(self, r_min=0, r_max=0, center_x=0, center_y=0, nbins=20): 
     584    def __init__(self, r_min=0, r_max=0, center_x=0, center_y=0, nbins=36): 
    585585        # Minimum radius 
    586586        self.r_min = r_min 
     
    593593        # Number of angular bins 
    594594        self.nbins_phi = nbins 
     595 
    595596         
    596597    def __call__(self, data2D): 
     
    622623        phi_values = numpy.zeros(self.nbins_phi) 
    623624        phi_err    = numpy.zeros(self.nbins_phi) 
    624          
     625         
     626        # Shift to apply to calculated phi values in order to center first bin at zero 
     627        phi_shift = Pi / self.nbins_phi 
     628 
    625629        for npt in range(len(data)): 
    626630            frac = 0 
     
    637641                continue 
    638642            # binning            
    639             i_phi = int(math.floor((self.nbins_phi) * phi_value / (2 * Pi))) 
     643            i_phi = int(math.floor((self.nbins_phi) * (phi_value+phi_shift) / (2 * Pi))) 
    640644             
    641645            # Take care of the edge case at phi = 2pi. 
    642             if i_phi == self.nbins_phi: 
    643                 i_phi =  self.nbins_phi - 1 
     646            if i_phi >= self.nbins_phi: 
     647                i_phi =  0 
    644648            phi_bins[i_phi] += frac * data[npt] 
    645649             
     
    655659            phi_bins[i] = phi_bins[i] / phi_counts[i] 
    656660            phi_err[i] = math.sqrt(phi_err[i]) / phi_counts[i] 
    657             phi_values[i] = 2.0 * math.pi / self.nbins_phi * (1.0 * i + 0.5) 
     661            phi_values[i] = 2.0 * math.pi / self.nbins_phi * (1.0 * i) 
    658662             
    659663        idx = (numpy.isfinite(phi_bins)) 
  • src/sas/dataloader/readers/associations.py

    rfd5ac0d r5dfdfa7  
    1717import sys 
    1818import logging 
    19 from lxml import etree 
    20 # Py2exe compatibility: import _elementpath to ensure that py2exe finds it 
    21 from lxml import _elementpath 
     19import json 
    2220 
    23 ## Format version for the XML settings file 
    24 VERSION = 'sasloader/1.0' 
     21FILE_NAME = 'defaults.json' 
    2522 
    26  
    27 def read_associations(loader, settings='defaults.xml'): 
     23def read_associations(loader, settings=FILE_NAME): 
    2824    """ 
    2925    Read the specified settings file to associate 
     
    3127     
    3228    :param loader: Loader object 
    33     :param settings: path to the XML settings file [string] 
     29    :param settings: path to the json settings file [string] 
    3430    """ 
    3531    reader_dir = os.path.dirname(__file__) 
     
    4743        path = "./%s" % settings 
    4844    if os.path.isfile(path): 
    49         tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 
    50          
    51         # Check the format version number 
    52         # Specifying the namespace will take care of the file format version 
    53         root = tree.getroot() 
     45        with open(path) as fh: 
     46            json_tree = json.load(fh) 
    5447         
    5548        # Read in the file extension associations 
    56         entry_list = root.xpath('/ns:SasLoader/ns:FileType', 
    57                                  namespaces={'ns': VERSION}) 
     49        entry_list = json_tree['SasLoader']['FileType'] 
    5850 
    5951        # For each FileType entry, get the associated reader and extension 
    6052        for entry in entry_list: 
    61             reader = entry.get('reader') 
    62             ext = entry.get('extension') 
     53            reader = entry['-reader'] 
     54            ext = entry['-extension'] 
    6355             
    6456            if reader is not None and ext is not None: 
  • src/sas/guiframe/local_perspectives/data_loader/data_loader.py

    rb3efb7d rb45cde3  
    233233                error_message += "Make sure the content of your file" 
    234234                error_message += " is properly formatted.\n\n" 
    235                 error_message += "When contacting the DANSE team, mention the" 
     235                error_message += "When contacting the SasView team, mention the" 
    236236                error_message += " following:\n%s" % str(error) 
    237237            elif data_error: 
  • src/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.py

    r79492222 r400155b  
    3535     
    3636        ## Number of points on the plot 
    37         self.nbins = 20 
     37        self.nbins = 36 
    3838        #Cursor position of Rings (Left(-1) or Right(1)) 
    3939        self.xmaxd = self.base.data2D.xmax 
     
    131131                   math.fabs(self.outer_circle.get_radius())) 
    132132        #if the user does not specify the numbers of points to plot  
    133         # the default number will be nbins= 20 
     133        # the default number will be nbins= 36 
    134134        if nbins == None: 
    135             self.nbins = 20 
     135            self.nbins = 36 
    136136        else: 
    137137            self.nbins = nbins 
  • src/sas/guiframe/media/data_explorer_help.rst

    r0d66541 r23a9beb  
    1 ..data_explorer_help.rst 
     1.. data_explorer_help.rst 
    22 
    3 Placeholder for data explorer help 
     3.. This is a port of the original SasView html help file to ReSTructured text 
     4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
     5 
     6Loading Data 
     7============ 
     8 
     9Introduction_ 
     10 
     11Load_Data_ 
     12 
     13Handy_Menu_ 
     14 
     15Activate_Data_ 
     16 
     17Remove_Data_ 
     18 
     19Append_Plot_to_Graph_ 
     20 
     21Create_New_Plot_ 
     22 
     23Freeze_Theory_ 
     24 
     25Send_Data_to_Applications_ 
     26 
     27.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     28 
     29.. _Introduction: 
     30 
     31Introduction 
     32------------ 
     33 
     34*Data Explorer* is a panel that allows the user more interactions with data.  
     35Some functionalities provided by the Data Explorer are also available through  
     36the context menu of plot panels or other menus of the applications.Under menu  
     37*View*  of the menubar, Data explorer can be toggled between Show and Hide by  
     38clicking the menu *Show/Hide Data Explorer* . 
     39 
     40*IMPORTANT!*  When Data explorer is hidden, all the data loaded will be sent  
     41directly to the current active application, if possible. When data Explorer is  
     42shown data go first to the Data Explorer for the user to handle them later. 
     43 
     44.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     45 
     46.. _Load_Data: 
     47 
     48Load Data 
     49--------- 
     50 
     51To Load data, click the button *Load Data* , then select one or more (holding  
     52Ctrl key) files to load into the application. In the list, the *Data*  will be  
     53displayed as the name of each selected file. Expending this data by clicking  
     54the *+*  symbol will display available information about the data such as data  
     55title if exists. 
     56 
     57.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     58 
     59.. _Handy_Menu: 
     60 
     61Handy Menu 
     62---------- 
     63 
     64For a quick Data-info/Save/Plot/3d-plot(2d only)/Edit-mask(2d only),  
     65high-light the data/theory, right-click, and select a proper item from the  
     66context menu. 
     67 
     68.. image:: hand_menu.png 
     69 
     70.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     71 
     72.. _Activate_Data: 
     73 
     74Activate Data 
     75------------- 
     76 
     77To interact with data, check a data label and click on a button. Checking Data  
     78make them active for the button operation. Unchecking Data labels will  
     79deactivate them. 
     80 
     81There is a combo box labeled *Selection Options*  that allows to activate or  
     82select multiple data simultaneously. 
     83 
     84.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     85 
     86.. _Remove_Data: 
     87 
     88Remove Data 
     89----------- 
     90 
     91Remove data button remove all reference of this data into the application. 
     92 
     93*WARNING!* Remove data will stop any jobs currently using the selected data. 
     94 
     95.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     96 
     97.. _Append_Plot_to_Graph: 
     98 
     99Append Plot to Graph 
     100-------------------- 
     101 
     102Click on the button *Append To*  to append selected Data to a plot panel on  
     103focus. Next to this button is a combo box containing available panels names.  
     104Selecting a name from this combo box will set the corresponding lot panel on  
     105focus. If not plot panel is available, the combo box and button will be  
     106disable. 2D Data cannot be appended to any plot panels . This operation can  
     107only be performed on 1D data and plot panels currently containing 1D data. 
     108 
     109.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     110 
     111.. _Create_New_Plot: 
     112 
     113Create New Plot 
     114--------------- 
     115 
     116Click on *New Plot*  button to create a new plot panel where selected data  
     117will be plotted. 
     118 
     119.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     120 
     121.. _Freeze_Theory: 
     122 
     123Freeze Theory 
     124------------- 
     125 
     126*Freeze Theory*  button generate Data from selected theory. This operation can  
     127only be performed when theory labels are selected. 
     128 
     129.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     130 
     131.. _Send_Data_to_Applications: 
     132 
     133Send to Application 
     134------------------- 
     135 
     136Click on the button *Send To*  to send Data to the current active control  
     137page. One of the single/batch mode can be selected only for Fitting. The batch  
     138mode provides serial (batch) fitting with one model, i.e., fitting one data by  
     139another data. Note that only the Fitting allows more that one data to be sent. 
  • src/sas/guiframe/media/graph_help.rst

    r0d66541 r98b30b4  
    1 ..graph_help.rst 
    2  
    3 Placeholder for graph help 
     1.. graph_help.rst 
     2 
     3.. This is a port of the original SasView html help file to ReSTructured text 
     4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
     5 
     6Plotting Data/Models 
     7==================== 
     8 
     9Graph_Menu_ 
     10 
     112D_Data_Averaging_ 
     12 
     13Key_Sequences_ 
     14 
     15.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     16 
     17.. _Graph_Menu: 
     18 
     19Graph Menu 
     20---------- 
     21 
     22Invoking_the_Graph_Menu_ 
     23 
     24Reset_Graph_ 
     25 
     26Hide_Show_Delete_Graph_ 
     27 
     28Data_Info_ 
     29 
     30Save_Plot_Image_ 
     31 
     32Save_Data_ 
     33 
     34Drag_Plot_ 
     35 
     36Zoom_In_Out_ 
     37 
     38Remove_Data_from_Plot_ 
     39 
     40Change_Scale_ 
     41 
     42Linear_Fit_ 
     43 
     44Other_Graph_Modifications_ 
     45 
     46.. _Invoking_the_Graph_Menu: 
     47 
     48Introduction 
     49------------ 
     50 
     51Locating the pointer and right-clicking on a data/theory plot will bring a  
     52context menu. On the menu, select a menu item. 
     53 
     54.. _Reset_Graph: 
     55 
     56Reset Graph 
     57----------- 
     58 
     59To reset the graph's axis range, right click on the plot and the context menu  
     60pops-up. Select *Reset Graph*  and the plot will take its initial range. Also  
     61the 'home' icon in tool bar will do the same. 
     62 
     63.. _Hide_Show_Delete_Graph: 
     64 
     65Hide/Show/Delete Graph 
     66---------------------- 
     67 
     68To Hide, click the Hide (bar) button in the tool bar.To Show, select the the  
     69'Show' menu item in the 'Graph' menu in the menu bar.To Delete, click the 'x'  
     70button in the title bar. 
     71 
     72Note: If a residuals graph (in Fitting) is hidden, it will not show up after  
     73computation. 
     74 
     75.. _Data_Info: 
     76 
     77Data Info 
     78--------- 
     79 
     80From the context menu, select 'Data Info' to see the data information dialog 
     81panel. 
     82 
     83.. _Save_Plot_Image: 
     84 
     85Save Plot Image 
     86--------------- 
     87 
     88Right click on plot. Context menu will pop-up select save image [file name]. 
     89A dialog window opens and write a the name of the file to save and click on  
     90*Save Image.* 
     91 
     92.. _Save_Data: 
     93 
     94Save Data 
     95--------- 
     96 
     97From the context menu, select 'Save points as a file' for 1D, or 'Save as a  
     98file(DAT)' for 2D. Note that two formats, txt and xml, are available in 1D  
     99saving. 
     100 
     101.. _Drag_Plot: 
     102 
     103Drag Plot 
     104--------- 
     105 
     106Select the *crossed arrows*  button on the plot panel *toolbar*  to drag the  
     107plot. To disable dragging mode, unselect the same button on the toolbar. 
     108 
     109.. _Zoom_In_Out: 
     110 
     111Zoom In/Out 
     112----------- 
     113 
     114Select the *rectangle*  button on the plot panel *toolbar*  to zoom in a 
     115region of the plot. 
     116 
     117To disable zoom mode, unselect the same button on the toolbar. After zoom in 
     118a region, select *left arrow*  or *right arrow*  button on the toolbar to set 
     119the graph the the previous size. If a mouse wheel button is available, 
     120*zoom in/out*  by scrolling the mouse wheel (see Key_Sequences_ help for 
     121details). 
     122 
     123.. _Remove_Data_from_Plot: 
     124 
     125Remove Data from Plot 
     126--------------------- 
     127 
     128Highlight the plot and the context menu appears.Select *remove [file name]*. 
     129The plot selected will disappear. 
     130 
     131.. _Change_Scale: 
     132 
     133Change Scale 
     134------------ 
     135 
     136If the loaded data is a 1-D data changing scale or data representation will  
     137work as follows. *Right click* on the plot window. A context menu pops-up and  
     138select *Change Scale* . A dialog window titled *select the scale of the graph*  
     139will pop-up then change the *x* , the *y*  and the *view*  values as wish. 
     140 
     141The 'view' option includes the axis scale short-cuts such as Linear, Guinier,  
     142Cross-sectional (XC) Guinier, and Porod plot scale. For a proper data set,  
     143these axis scales can be used to estimate Rg, Rod diameter, or Background of  
     144neutron scattering data respectively (via 'Linear Fit'; see below). For a 2D  
     145image, *Right click*  on the image to pop-up the context menu. Select to  
     146switch from linear to log scale. The scale selected is printed on the status  
     147bar. 
     148 
     149If the loaded data is an image. *Right click*  on the image to pop-up the 
     150context menu. Select to switch from linear to log scale. The scale selected is 
     151printed on the status bar. 
     152 
     153.. _Linear_Fit: 
     154 
     155Linear Fit 
     156---------- 
     157 
     158Linear fit is to perform a line model fitting keeping the scale of the plot. 
     159Highlight data to fit. From the context menu select *Linear Fit* . A dialog 
     160window appears. Change model initial parameters, data limits and hit *fit* 
     161button. New parameters values are displayed and the line with the new 
     162parameters is added to the plot. Especially for Guinier, XC Guinier, and 
     163Porod plot scale, this 'Linear Fit' will provides Rg, Rod diameter, and 
     164background, respectively. The following figure shows an example for the 
     165Guinier scale. 
     166 
     167.. image:: guinier_fit.png 
     168 
     169.. _Other_Graph_Modifications: 
     170 
     171Other Graph Modifications 
     172------------------------- 
     173 
     174Some custom modifications of the symbols, text, axis, etc of the graph are  
     175provided. 
     176 
     177.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     178 
     179.. _2D_Data_Averaging: 
     180 
     1812D Data Averaging 
     182----------------- 
     183 
     184Principle_ 
     185 
     186How_to_Average_ 
     187 
     188Available_Averagings_ 
     189 
     190Unmasked_Circular_Average_ 
     191 
     192Masked_Circular_Average_ 
     193 
     194Sector_Average_ 
     195 
     196Annular_Average_ 
     197 
     198Box_Sum_ 
     199 
     200Box_Averaging_in_Qx_ 
     201 
     202Box_Averaging_in_Qy_ 
     203 
     204.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     205 
     206.. Principle:  
     207 
     208Principle 
     209--------- 
     210 
     211This feature allows you to perform different types of averages on your data,  
     212and allows you to see what regions of the detector will contribute to the  
     213average. The region to be averaged will be drown and can be modified by  
     214dragging the lines around. 
     215 
     216.. _How_to_Average: 
     217 
     218How to Average 
     219-------------- 
     220 
     221Right click on 2D data for the context menu to appear. Select one type of  
     222averages among *"sector [Q view]", "Annulus [Phi view]", "Box sum", "Box  
     223averaging in Qx ", "box averaging on Qy","Perform circular Average".* 
     224 
     225A slicer will appear except for *"Perform circular Average"*  that you can  
     226drag by clicking on a slicer 's marker. When the marker is highlighted in red,  
     227it means that the slicer can change size.You can also move some of the slicer  
     228by simply drag its side when highlighted in red. the slicer size will be reset  
     229to its previous size if the user try to select a region greater than the size  
     230of the data. 
     231 
     232The user can also select a region to average when a slicer has been selected  
     233already by *right clicking*  on the context menu and selecting *Edit Slicer  
     234Parameters* . The dialog window will appears and the user can enter values to  
     235selected a region or selected numbers of points to plot *nbins* . 
     236 
     237For *Box sum* , when the user selects this option, a new panel is created  
     238containing the result of average of the sum of every pixels contains on that  
     239data.The user can also enter values to select a region. 
     240 
     241.. _Available_Averagings: 
     242 
     243Available Averagings 
     244-------------------- 
     245 
     246Some different types of averaging are provided for. 
     247 
     248.. _Unmasked_Circular_Average: 
     249 
     250Unmasked Circular Average 
     251------------------------- 
     252 
     253This operation will perform and average in constant q-rings around the (x,y) pixel 
     254location of the beam center. 
     255 
     256.. _Masked_Circular_Average: 
     257 
     258Masked Circular Average 
     259----------------------- 
     260 
     261This operation is same as 'Masked Circular Average' except that the masked 
     262region is excluded if masked. 
     263 
     264.. _Sector_Average: 
     265 
     266Sector Average [Q View] 
     267----------------------- 
     268 
     269This operation averages in constant q-arcs. The width of the sector is specified in 
     270degrees (+/- delta phi) each side of the central angle (phi). 
     271 
     272.. _Annular_Average: 
     273 
     274Annular Average [Phi View] 
     275-------------------------- 
     276 
     277It performs an average between two q-values centered in (0,0), and averaged  
     278over a width of a specified number of pixels. The data is returned as a  
     279function of angle (phi) in degrees. Moving one circle of this slicer to  
     280radius of zero corresponding to a circular averaging on radius qmax , the  
     281outer circle. The angle zero starts from the positive x-axis direction. 
     282 
     283.. _Box_Sum: 
     284 
     285Box Sum 
     286------- 
     287 
     288Perform the sum of counts in a 2D region of interest.When editing the slicer,  
     289the user can enter the length and the width the rectangle slicer and the  
     290coordinates of the center of this rectangle. 
     291 
     292.. _Box_Averaging_in_Qx: 
     293 
     294Box Averaging in Qx 
     295------------------- 
     296 
     297Computes average I(Qx) for a region of interest. When editing the slicer, the  
     298user can control the length and the width the rectangle slicer. The averaged  
     299output is calculated from the constant bins with rectangular shape. The  
     300resultant q values are nominal values, i.e., the central values of each bins  
     301on the x-axis. 
     302 
     303.. _Box_Averaging_in_Qy: 
     304 
     305Box Averaging in Qy 
     306------------------- 
     307 
     308Computes average I(Qy) for a region of interest.When editing the slicer, the  
     309user can control the length and the width the rectangle slicer. The averaged  
     310output is calculated from the constant bins with rectangular shape. The  
     311resultant q values are nominal values, i.e., the central values of each bins  
     312on the y-axis. 
     313 
     314.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     315 
     316.. _Key_Sequences: 
     317 
     318Key Sequences 
     319------------- 
     320 
     321Floating_Panel_ 
     322 
     323Context_Menu_ 
     324 
     325Zoom_ 
     326 
     327.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     328 
     329.. _Floating_Panel: 
     330 
     331Floating Panel 
     332-------------- 
     333 
     334For a graph panel to float on the top of the SV window: 
     335 
     336Press the *Ctrl(Cmd on MAC) key*  on dragging and placing a panel. Or if you  
     337want to make all plot panels float, select 'Float' from Graph/Preperences in  
     338the menu bar. Otherwise choose 'Dock'. 
     339 
     340.. _Context_Menu: 
     341 
     342Graph Context Menu 
     343------------------ 
     344 
     345To get the graph context menu to print, copy, save data, (2D)average, etc,  
     346*locate the mouse point on the plot to highlight and *(Mouse) Right Click*  
     347to bring up the full menu. 
     348 
     349.. _Zoom: 
     350 
     351Zoom In/Out 
     352----------- 
     353 
     354To Zoom in or out the full plot, *locate the mouse point inside the graph  
     355which will be the center of the zooming, then *rotate MouseWheel*. 
     356 
     357*To Zoom in or out the plot in x or y direction, *locate (and click) the  
     358mouse point near x (or y) axis just outside of the graph and then *rotate  
     359MouseWheel* .* Note that this works only on the 1D plots. 
  • src/sas/models/c_extension/python_wrapper/modelTemplate.txt

    rfd5ac0d r8836849  
    2626from sas.models.BaseComponent import BaseComponent 
    2727from sas.models.sas_extension.c_models import [CPYTHONCLASS] 
     28from numpy import inf 
    2829 
    2930def create_[PYTHONCLASS](): 
  • src/sas/models/include/cylinder.h

    r79492222 r8836849  
    3434 
    3535  /// Radius of the cylinder [A] 
    36   //  [DEFAULT]=radius=20.0 [A] 
     36  //  [DEFAULT]=radius=20.0 [A] 0.0 inf 
    3737  Parameter radius; 
    3838 
    3939  /// Length of the cylinder [A] 
    40   //  [DEFAULT]=length=400.0 [A] 
     40  //  [DEFAULT]=length=400.0 [A] 0.0 inf 
    4141  Parameter length; 
    4242 
  • src/sas/models/media/model_functions.rst

    r79492222 r98b30b4  
    8282Contents 
    8383-------- 
    84 1. Introduction_ 
     841. Background_ 
    8585 
    86862. Model_ Functions 
     
    9999 
    100100 
    101 .. _Introduction: 
    102  
    103 1. Introduction 
     101.. _Background: 
     102 
     1031. Background 
    104104--------------- 
    105105 
  • src/sas/perspectives/calculator/data_editor.py

    r79492222 rb45cde3  
    4646     
    4747    if error is not None: 
    48         message += "When contacting the DANSE team," 
     48        message += "When contacting the SasView team," 
    4949        message += " mention the following:\n%s" % str(error) 
    5050     
  • src/sas/perspectives/fitting/fitpage.py

    r9e11cf5 r22ae2f7  
    30133013                    if not self.is_mac: 
    30143014                        ctl2.Hide() 
    3015                      
     3015 
    30163016                    ix += 1 
    30173017                    ctl3 = self.ModelTextCtrl(self, -1, 
     
    30193019                                              style=wx.TE_PROCESS_ENTER, 
    30203020                                text_enter_callback=self._onparamRangeEnter) 
    3021           
     3021                    min_bound = self.model.details[item][1] 
     3022                    if min_bound is not None: 
     3023                        ctl3.SetValue(format_number(min_bound, True)) 
     3024 
    30223025                    sizer.Add(ctl3, (iy, ix), (1, 1), 
    30233026                              wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     
    30283031                                              style=wx.TE_PROCESS_ENTER, 
    30293032                                text_enter_callback=self._onparamRangeEnter) 
     3033                    max_bound = self.model.details[item][2] 
     3034                    if max_bound is not None: 
     3035                        ctl4.SetValue(format_number(max_bound, True)) 
    30303036                    sizer.Add(ctl4, (iy, ix), (1, 1), 
    30313037                              wx.EXPAND | wx.FIXED_MINSIZE, 0) 
  • test/sasdataloader/test/ring_testdata.txt

    r8c9ffde r400155b  
    11<X>   <Y>   <dY> 
    2 0.157079632679 0.892216637179 0.0775663414595 
    3 0.471238898038 0.98455818481 0.079657697118 
    4 0.785398163397 0.961797998125 0.0788556980394 
    5 1.09955742876 0.97171642327 0.0791285423182 
    6 1.41371669412 1.0146882474 0.082063426639 
    7 1.72787595947 1.00992701463 0.080353091764 
    8 2.04203522483 1.02880481582 0.0815342153253 
    9 2.35619449019 1.00598046038 0.0798251732283 
    10 2.67035375555 1.07871021115 0.0836335498662 
    11 2.98451302091 0.998456910563 0.079747331585 
    12 3.29867228627 1.04419570592 0.0830428241489 
    13 3.61283155163 1.01232642025 0.0808308513267 
    14 3.92699081699 1.0083937443 0.0810028887009 
    15 4.24115008235 1.03216852956 0.0810389534812 
    16 4.55530934771 1.06499475793 0.0814085230439 
    17 4.86946861306 0.982265097403 0.0805528988046 
    18 5.18362787842 1.00390126667 0.0806633561062 
    19 5.49778714378 0.980815954717 0.0793145659499 
    20 5.81194640914 0.907713166456 0.0765782956648 
    21 6.1261056745 0.983188286879 0.0797444057771 
     20.0 0.974491286452 0.0803843574327 
     30.314159265359 0.9046853025 0.0768971192264 
     40.628318530718 0.964040908176 0.0790933208542 
     50.942477796077 0.922142905769 0.0781616076625 
     61.25663706144 1.02710537736 0.080875897538 
     71.57079632679 1.01448978075 0.0808313893873 
     81.88495559215 1.04677136013 0.0828850195035 
     92.19911485751 1.00067189877 0.0790510747578 
     102.51327412287 1.06280533013 0.0830643956456 
     112.82743338823 1.04313751703 0.0824585190353 
     123.14159265359 0.993559460696 0.0803376331443 
     133.45575191895 0.998101030127 0.0813124293449 
     143.76991118431 1.04589910764 0.0821364674302 
     154.08407044967 0.997201556522 0.0797466854806 
     164.39822971503 1.07289797405 0.0830165798358 
     174.71238898038 1.01212391625 0.0803021745794 
     185.02654824574 0.995907123899 0.0804649435453 
     195.3407075111 0.991431571613 0.0803765721376 
     205.65486677646 0.959020086792 0.0787114622667 
     215.96902604182 0.945705788519 0.0767669312314 
Note: See TracChangeset for help on using the changeset viewer.