Changes in / [1dbdb83:e89aed5] in sasview


Ignore:
Files:
22 added
68 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    rdf332d8 re04f87b  
    88# generated. 
    99# 
    10 # Feel free to add more stuff to this as and when it becomes an issue. 
     10# Feel free to add more stuff to this as and when it becomes an issue.  
    1111 
    1212.project 
     
    5050/test/sasdataloader/test/plugins.zip 
    5151/test/sasdataloader/test/test_log.txt 
    52 /test/sasdataloader/test/isis_1_0_write_test.xml 
    53 /test/sasdataloader/test/isis_1_1_write_test.xml 
    54 /test/sasdataloader/test/write_test.xml 
    5552 
    5653# autogenerated scripts 
    5754/sasview/installer.iss 
     55 
  • build_tools/requirements.txt

    rbe4cb41 r785cc657  
    1111bumps==0.7.5.9 
    1212# numpy==1.6.1 
    13 scipy>=0.18.0 
     13# scipy==0.10.1 
    1414# wx==2.8.12.1 
    1515# matplotlib==1.1.0 
  • docs/sphinx-docs/build_sphinx.py

    r578a11d r8096b446  
    3535#/sasview-local-trunk/docs/sphinx-docs/build_sphinx.py 
    3636SASMODELS_SOURCE_PROLOG = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc") 
    37 SASMODELS_SOURCE_SESANS = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "ref", "sesans") 
    3837SASMODELS_SOURCE_MAGNETISM = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "ref", "magnetism") 
    3938SASMODELS_SOURCE_MAGIMG = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "ref", "magnetism", "mag_img") 
     
    7271SPHINX_SOURCE_PERSPECTIVES = os.path.join(SPHINX_SOURCE, "user", "sasgui", "perspectives") 
    7372SPHINX_SOURCE_TEST = os.path.join(SPHINX_SOURCE, "test") 
    74 SPHINX_SOURCE_USER = os.path.join(SPHINX_SOURCE, "user") 
    7573 
    7674BUMPS_DOCS = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", 
     
    192190                    shutil.copy(fromhere,tohere) 
    193191 
    194     if os.path.exists(SASMODELS_SOURCE_SESANS): 
    195         print "Found docs folder SASMODELS_SOURCE_SESANS at ", SASMODELS_SOURCE_SESANS 
    196         if os.path.exists(SPHINX_SOURCE_USER): 
    197             print "Found docs folder SPHINX_SOURCE_USER      at ", SPHINX_SOURCE_USER 
    198             print "Copying sasmodels sesans files..." 
    199             for files in os.listdir(SASMODELS_SOURCE_SESANS): 
    200                 if files.endswith(".rst"): 
    201                     fromhere=os.path.join(SASMODELS_SOURCE_SESANS,files) 
    202                     tohere=os.path.join(SPHINX_SOURCE_USER,files) 
    203                     shutil.copy(fromhere,tohere) 
    204  
    205192    if os.path.exists(SASMODELS_SOURCE_MAGNETISM): 
    206193        print "Found docs folder SASMODELS_SOURCE_MAGNETISM at ", SASMODELS_SOURCE_MAGNETISM 
  • docs/sphinx-docs/source/user/analysis.rst

    rec860a8f r8f46df7  
    1 .. _analysis: 
    2  
    31Types of Analysis 
    42================= 
     
    86.. toctree:: 
    97   :maxdepth: 1 
    10  
     8    
    119   Model Fitting <sasgui/perspectives/fitting/fitting> 
    12  
     10    
    1311   P(r) Inversion <sasgui/perspectives/pr/pr_help> 
    14  
     12    
    1513   Invariant Calculation <sasgui/perspectives/invariant/invariant_help> 
    16  
    17    Correlation Function <sasgui/perspectives/corfunc/corfunc_help> 
  • docs/sphinx-docs/source/user/tools.rst

    rec860a8f r8f46df7  
    1 .. _tools: 
    2  
    31Tools 
    42===== 
     
    108 
    119   Data Operations Utility <sasgui/perspectives/calculator/data_operator_help> 
    12  
     10       
    1311   Density/Volume Calculator <sasgui/perspectives/calculator/density_calculator_help> 
    14  
     12    
    1513   Generic SANS Calculator <sasgui/perspectives/calculator/sas_calculator_help> 
    16  
     14    
    1715   Image Viewer <sasgui/perspectives/calculator/image_viewer_help> 
    18  
     16    
    1917   Kiessig Thickness Calculator <sasgui/perspectives/calculator/kiessig_calculator_help> 
    20  
     18    
    2119   SLD Calculator <sasgui/perspectives/calculator/sld_calculator_help> 
    22  
     20    
    2321   Slit Size Calculator <sasgui/perspectives/calculator/slit_calculator_help> 
    24  
     22    
    2523   Q Resolution Estimator <sasgui/perspectives/calculator/resolution_calculator_help> 
    26  
     24    
    2725   Python Shell <sasgui/perspectives/calculator/python_shell_help> 
    28  
    29    File Converter <sasgui/perspectives/file_converter/file_converter_help> 
     26    
  • docs/sphinx-docs/source/user/tutorial.rst

    rec860a8f r13161ac  
    11.. tutorial.rst 
    2  
    3 .. _tutorial: 
    42 
    53Tutorial 
  • docs/sphinx-docs/source/user/working.rst

    r578a11d rc43953ef  
    1919   Computations with a GPU <gpu_computations> 
    2020    
    21    Converting SANS to SESANS <sans_to_sesans> 
    22     
  • run.py

    r18e7309 r832fea2  
    7272    platform = '%s-%s'%(get_platform(),sys.version[:3]) 
    7373    build_path = joinpath(root, 'build','lib.'+platform) 
    74  
    75     # Notify the help menu that the Sphinx documentation is in a different 
     74     
     75    # Notify the help menu that the Sphinx documentation is in a different  
    7676    # place than it otherwise would be. 
    7777    os.environ['SASVIEW_DOC_PATH'] = joinpath(build_path, "doc") 
     
    123123    # Compiled modules need to be pulled from the build directory. 
    124124    # Some packages are not where they are needed, so load them explicitly. 
    125     import sas.sascalc.file_converter 
    126     sas.sascalc.file_converter.core = import_package('sas.sascalc.file_converter.core', 
    127                                   joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core'))                     
    128  
    129     # Compiled modules need to be pulled from the build directory. 
    130     # Some packages are not where they are needed, so load them explicitly. 
    131125    import sas.sascalc.calculator 
    132126    sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core', 
  • sasview/local_config.py

    rc1fdf84 rc1fdf84  
    9595GUIFRAME_WIDTH = 1150 
    9696GUIFRAME_HEIGHT = 840 
    97 PLUGIN_STATE_EXTENSIONS = ['.fitv', '.inv', '.prv', '.cor'] 
     97PLUGIN_STATE_EXTENSIONS = ['.fitv', '.inv', '.prv'] 
    9898PLUGINS_WLIST = ['Fitting files (*.fitv)|*.fitv', 
    9999                 'Invariant files (*.inv)|*.inv', 
    100                  'P(r) files (*.prv)|*.prv', 
    101                  'Corfunc files (*.cor)|*.cor'] 
     100                 'P(r) files (*.prv)|*.prv'] 
    102101PLOPANEL_WIDTH = 415 
    103102PLOPANEL_HEIGTH = 370 
  • sasview/sasview.py

    rcde6e52 rcde6e52  
    148148            logging.error(traceback.format_exc()) 
    149149 
    150         # Corfunc perspective 
    151         try: 
    152             import sas.sasgui.perspectives.corfunc as module 
    153             corfunc_plug = module.Plugin() 
    154             self.gui.add_perspective(corfunc_plug) 
    155         except: 
    156             logging.error("Unable to load corfunc module") 
    157  
    158150        #Calculator perspective 
    159151        try: 
     
    163155        except: 
    164156            logging.error("%s: could not find Calculator plug-in module"% \ 
    165                                                         APP_NAME) 
    166             logging.error(traceback.format_exc()) 
    167  
    168         # File converter tool 
    169         try: 
    170             import sas.sasgui.perspectives.file_converter as module 
    171             converter_plug = module.Plugin() 
    172             self.gui.add_perspective(converter_plug) 
    173         except: 
    174             logging.error("%s: could not find File Converter plug-in module"% \ 
    175157                                                        APP_NAME) 
    176158            logging.error(traceback.format_exc()) 
  • sasview/test/README.txt

    r850a498 rd4c88e24  
    1 Test data sets are included as a convenience to our users. The data sets are organized based on their data structure; 1D data (ie, I(Q)), 2D data (ie, I(Qx,Qy)), coordinate data (eg, PDB files), image data (eg, TIFF files), SasView saved states, SESANS data, and data in formats that are not yet implemented but which are in the works for future releases. 
    2  
    3 1D data sets EITHER a) have at least two columns of data with I(abs. units) on the y-axis and Q on the x-axis, OR b) have I and Q in separate files. Data in the latter format need to be converted to a single file format with the File Converter tool before SasView will analyse them. 
    4  
    5 2D data sets are data sets that give the deduced intensity for each detector pixel. Depending on the file extension, uncertainty and metadata may also be available. 
    6  
    7 Coordinate data sets are designed to be read by the Generic Scattering Calculator tool. 
    8  
    9 Image data sets are designed to be read by the Image Viewer tool. 
    10  
     1Test data sets are included as a convenience to our users. The data sets are organized based on their data structure; 1D data, 2D data, SASVIEW saved states, and data in formats that are not yet implemented but are in the works for future versions. 
     21D data sets have at least two columns of data with I(abs. units) on the y-axis and Q on the x-axis. 2D data sets are data sets that give the deduced intensity for each detector pixel. Depending on the file extension, uncertainty and meta data may also be available. 
    113Save states are projects and analyses saved by the SASVIEW program. A single analysis file contains the data and parameters for a single fit (.fit), p(r) inversion (.pr), or invariant calculation (.inv). A project file (.svs) contains the results for every active analysis. 
    12  
    13 SESANS data sets primarily contain the neutron polarisation as a function of the spin-echo length. 
  • setup.py

    r18e7309 rdb74ee8  
    99from distutils.command.build_ext import build_ext 
    1010from distutils.core import Command 
    11 import numpy 
    1211 
    1312# Manage version number ###################################### 
     
    5554        print "Removing existing build directory", SASVIEW_BUILD, "for a clean build" 
    5655        shutil.rmtree(SASVIEW_BUILD) 
    57  
     56                     
    5857# 'sys.maxsize' and 64bit: Not supported for python2.5 
    5958is_64bits = False 
    6059if sys.version_info >= (2, 6): 
    6160    is_64bits = sys.maxsize > 2**32 
    62  
     61     
    6362enable_openmp = False 
    6463 
     
    119118        c = self.compiler.compiler_type 
    120119        print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 
    121  
     120         
    122121        # OpenMP build options 
    123122        if enable_openmp: 
     
    128127                for e in self.extensions: 
    129128                    e.extra_link_args = lopt[ c ] 
    130  
     129                     
    131130        # Platform-specific build options 
    132131        if platform_lopt.has_key(c): 
     
    206205) 
    207206 
    208  
     207     
    209208# sas.sascalc.pr 
    210209srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
     
    218217                              include_dirs=[], 
    219218                              ) ) 
    220  
    221 # sas.sascalc.file_converter 
    222 mydir = os.path.join("src", "sas", "sascalc", "file_converter", "c_ext") 
    223 package_dir["sas.sascalc.file_converter.core"] = mydir 
    224 package_dir["sas.sascalc.file_converter"] = os.path.join("src","sas", "sascalc", "file_converter") 
    225 packages.extend(["sas.sascalc.file_converter","sas.sascalc.file_converter.core"]) 
    226 ext_modules.append( Extension("sas.sascalc.file_converter.core.bsl_loader", 
    227                               sources = [os.path.join(mydir, "bsl_loader.c")], 
    228                               include_dirs=[numpy.get_include()], 
    229                               ) ) 
    230  
     219         
    231220# sas.sascalc.fit 
    232221package_dir["sas.sascalc.fit"] = os.path.join("src", "sas", "sascalc", "fit") 
     
    250239packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
    251240package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 
    252  
     241     
    253242# Data util 
    254243package_dir["sas.sascalc.data_util"] = os.path.join("src", "sas", "sascalc", "data_util") 
     
    305294                               'test/2d_data/*', 
    306295                               'test/save_states/*', 
    307                                'test/upcoming_formats/*', 
     296                               'test/upcoming_formats/*',  
    308297                                 'default_categories.json'] 
    309298packages.append("sas.sasview") 
     
    327316    required.extend(['pillow']) 
    328317 
    329 # Set up SasView 
     318# Set up SasView     
    330319setup( 
    331320    name="sasview", 
     
    352341                'docs': BuildSphinxCommand, 
    353342                'disable_openmp': DisableOpenMPCommand} 
    354     ) 
     343    )    
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    r654e8e0 r654e8e0  
    11771177            written = written | self.write_node(pix, "z", item.pixel_size.z, 
    11781178                                                {"unit": item.pixel_size_unit}) 
     1179            written = written | self.write_node(det, "slit_length", 
     1180                                                item.slit_length, 
     1181                                                {"unit": item.slit_length_unit}) 
    11791182            if written == True: 
    11801183                self.append(pix, det) 
    1181             self.write_node(det, "slit_length", item.slit_length, 
    1182                 {"unit": item.slit_length_unit}) 
    1183  
    11841184 
    11851185    def _write_process_notes(self, datainfo, entry_node): 
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    r5e906207 r479799c  
    2323 
    2424    Any number of SASdata sets may be present in a SASentry and the data within can be either 1D I(Q) or 2D I(Qx, Qy). 
    25  
    26     Also supports reading NXcanSAS formatted HDF5 files 
    2725 
    2826    :Dependencies: 
     
    7876                ## Add the last data set to the list of outputs 
    7977                self.add_data_set() 
    80                 ## Close the data file 
    81                 self.raw_data.close() 
    8278        ## Return data set(s) 
    8379        return self.output 
     
    187183                    elif key == u'run': 
    188184                        self.current_datainfo.run.append(data_point) 
    189                         try: 
    190                             run_name = value.attrs['name'] 
    191                             run_dict = {data_point: run_name} 
    192                             self.current_datainfo.run_name = run_dict 
    193                         except: 
    194                             pass 
    195185                    elif key == u'title': 
    196186                        self.current_datainfo.title = data_point 
     
    199189 
    200190                    ## Sample Information 
    201                     elif key == u'Title' and self.parent_class == u'SASsample': # CanSAS 2.0 format 
    202                         self.current_datainfo.sample.name = data_point 
    203                     elif key == u'ID' and self.parent_class == u'SASsample': # NXcanSAS format 
     191                    elif key == u'Title' and self.parent_class == u'SASsample': 
    204192                        self.current_datainfo.sample.name = data_point 
    205193                    elif key == u'thickness' and self.parent_class == u'SASsample': 
     
    207195                    elif key == u'temperature' and self.parent_class == u'SASsample': 
    208196                        self.current_datainfo.sample.temperature = data_point 
    209                     elif key == u'transmission' and self.parent_class == u'SASsample': 
    210                         self.current_datainfo.sample.transmission = data_point 
    211                     elif key == u'x_position' and self.parent_class == u'SASsample': 
    212                         self.current_datainfo.sample.position.x = data_point 
    213                     elif key == u'y_position' and self.parent_class == u'SASsample': 
    214                         self.current_datainfo.sample.position.y = data_point 
    215                     elif key == u'polar_angle' and self.parent_class == u'SASsample': 
    216                         self.current_datainfo.sample.orientation.x = data_point 
    217                     elif key == u'azimuthal_angle' and self.parent_class == u'SASsample': 
    218                         self.current_datainfo.sample.orientation.z = data_point 
    219                     elif key == u'details' and self.parent_class == u'SASsample': 
    220                         self.current_datainfo.sample.details.append(data_point) 
    221197 
    222198                    ## Instrumental Information 
     
    228204                        self.detector.distance = float(data_point) 
    229205                        self.detector.distance_unit = unit 
    230                     elif key == u'slit_length' and self.parent_class == u'SASdetector': 
    231                         self.detector.slit_length = float(data_point) 
    232                         self.detector.slit_length_unit = unit 
    233                     elif key == u'x_position' and self.parent_class == u'SASdetector': 
    234                         self.detector.offset.x = float(data_point) 
    235                         self.detector.offset_unit = unit 
    236                     elif key == u'y_position' and self.parent_class == u'SASdetector': 
    237                         self.detector.offset.y = float(data_point) 
    238                         self.detector.offset_unit = unit 
    239                     elif key == u'polar_angle' and self.parent_class == u'SASdetector': 
    240                         self.detector.orientation.x = float(data_point) 
    241                         self.detector.orientation_unit = unit 
    242                     elif key == u'azimuthal_angle' and self.parent_class == u'SASdetector': 
    243                         self.detector.orientation.z = float(data_point) 
    244                         self.detector.orientation_unit = unit 
    245                     elif key == u'beam_center_x' and self.parent_class == u'SASdetector': 
    246                         self.detector.beam_center.x = float(data_point) 
    247                         self.detector.beam_center_unit = unit 
    248                     elif key == u'beam_center_y' and self.parent_class == u'SASdetector': 
    249                         self.detector.beam_center.y = float(data_point) 
    250                         self.detector.beam_center_unit = unit 
    251                     elif key == u'x_pixel_size' and self.parent_class == u'SASdetector': 
    252                         self.detector.pixel_size.x = float(data_point) 
    253                         self.detector.pixel_size_unit = unit 
    254                     elif key == u'y_pixel_size' and self.parent_class == u'SASdetector': 
    255                         self.detector.pixel_size.y = float(data_point) 
    256                         self.detector.pixel_size_unit = unit 
    257206                    elif key == u'SSD' and self.parent_class == u'SAScollimation': 
    258207                        self.collimation.length = data_point 
     
    264213                    elif key == u'name' and self.parent_class == u'SASprocess': 
    265214                        self.process.name = data_point 
    266                     elif key == u'Title' and self.parent_class == u'SASprocess': # CanSAS 2.0 format 
    267                         self.process.name = data_point 
    268                     elif key == u'name' and self.parent_class == u'SASprocess': # NXcanSAS format 
     215                    elif key == u'Title' and self.parent_class == u'SASprocess': 
    269216                        self.process.name = data_point 
    270217                    elif key == u'description' and self.parent_class == u'SASprocess': 
     
    283230                        self.trans_spectrum.wavelength.append(data_point) 
    284231 
    285                     ## Source 
     232                    ## Other Information 
    286233                    elif key == u'wavelength' and self.parent_class == u'SASdata': 
    287234                        self.current_datainfo.source.wavelength = data_point 
    288                         self.current_datainfo.source.wavelength_unit = unit 
    289                     elif key == u'incident_wavelength' and self.parent_class == u'SASsource': 
    290                         self.current_datainfo.source.wavelength = data_point 
    291                         self.current_datainfo.source.wavelength_unit = unit 
    292                     elif key == u'wavelength_max' and self.parent_class == u'SASsource': 
    293                         self.current_datainfo.source.wavelength_max = data_point 
    294                         self.current_datainfo.source.wavelength_max_unit = unit 
    295                     elif key == u'wavelength_min' and self.parent_class == u'SASsource': 
    296                         self.current_datainfo.source.wavelength_min = data_point 
    297                         self.current_datainfo.source.wavelength_min_unit = unit 
    298                     elif key == u'wavelength_spread' and self.parent_class == u'SASsource': 
    299                         self.current_datainfo.source.wavelength_spread = data_point 
    300                         self.current_datainfo.source.wavelength_spread_unit = unit 
    301                     elif key == u'beam_size_x' and self.parent_class == u'SASsource': 
    302                         self.current_datainfo.source.beam_size.x = data_point 
    303                         self.current_datainfo.source.beam_size_unit = unit 
    304                     elif key == u'beam_size_y' and self.parent_class == u'SASsource': 
    305                         self.current_datainfo.source.beam_size.y = data_point 
    306                         self.current_datainfo.source.beam_size_unit = unit 
    307                     elif key == u'beam_shape' and self.parent_class == u'SASsource': 
    308                         self.current_datainfo.source.beam_shape = data_point 
     235                        self.current_datainfo.source.wavelength.unit = unit 
    309236                    elif key == u'radiation' and self.parent_class == u'SASsource': 
    310237                        self.current_datainfo.source.radiation = data_point 
     
    449376        self.current_datainfo = DataInfo() 
    450377 
    451  
    452378    def _initialize_new_data_set(self, parent_list = None): 
    453379        """ 
  • src/sas/sasgui/guiframe/events.py

    r6ffa0dd rd85c194  
    88# plot Qrange 
    99(PlotQrangeEvent, EVT_PLOT_QRANGE) = wx.lib.newevent.NewEvent() 
    10 # set plot limits 
    11 (PlotLimitEvent, EVT_PLOT_LIM) = wx.lib.newevent.NewEvent() 
    1210# print the messages on statusbar 
    1311(StatusEvent,  EVT_STATUS)   = wx.lib.newevent.NewEvent() 
    14 #create a panel slicer 
     12#create a panel slicer  
    1513(SlicerPanelEvent, EVT_SLICER_PANEL)   = wx.lib.newevent.NewEvent() 
    16 #print update paramaters for panel slicer 
     14#print update paramaters for panel slicer  
    1715(SlicerParamUpdateEvent, EVT_SLICER_PARS_UPDATE)   = wx.lib.newevent.NewEvent() 
    18 #update the slicer from the panel 
     16#update the slicer from the panel  
    1917(SlicerParameterEvent, EVT_SLICER_PARS)   = wx.lib.newevent.NewEvent() 
    2018#slicer event 
  • src/sas/sasgui/guiframe/gui_statusbar.py

    r3a22ce7 rd85c194  
    66import sys 
    77import logging 
    8 import datetime 
    98from wx import StatusBar as wxStatusB 
    109from wx.lib import newevent 
     
    4746 
    4847        self.msg_txt.SetEditable(False) 
    49         timestamp = datetime.datetime.now() 
    50         status = '{:%Y-%m-%d %H:%M:%S} : No message available'.format(timestamp) 
    51         self.msg_txt.SetValue(status) 
     48        self.msg_txt.SetValue('No message available') 
    5249        self.sizer.Add(self.msg_txt, 1, wx.EXPAND|wx.ALL, 10) 
    5350        self.SetSizer(self.sizer) 
     
    6360        if status.strip() == "": 
    6461            return 
    65         # Add timestamp 
    66         timestamp = datetime.datetime.now() 
    67         status = '{:%Y-%m-%d %H:%M:%S} : '.format(timestamp) + status 
    6862        color = (0, 0, 0) #black 
    6963        icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    r245ae18 r895c9cb  
    9595        self.parent.SetFocus() 
    9696 
    97         # If true, there are 3 qrange bars 
    98         self.is_corfunc = False 
    99  
    10097 
    10198    def get_symbol_label(self): 
     
    217214        if active_ctrl == None: 
    218215            return 
    219         if hasattr(event, 'is_corfunc'): 
    220             self.is_corfunc = event.is_corfunc 
    221216        if event.id in self.plots.keys(): 
    222217            ctrl = event.ctrl 
     
    227222            values = [max(x_data.min(), float(ctrl[0].GetValue())), 
    228223                      min(x_data.max(), float(ctrl[1].GetValue()))] 
    229             if len(ctrl) == 3: 
    230                 colors.append('purple') 
    231                 values.append(min(x_data.max(), float(ctrl[2].GetValue()))) 
    232224            if self.ly == None: 
    233225                self.ly = [] 
     
    240232                xval = float(active_ctrl.GetValue()) 
    241233                position = self.get_data_xy_vals(xval) 
    242                 if position != None and not self.is_corfunc: 
     234                if position != None: 
    243235                    wx.PostEvent(self.parent, StatusEvent(status=position)) 
    244236            except: 
     
    301293        ly0x = ly[0].get_xdata() 
    302294        ly1x = ly[1].get_xdata() 
    303         ly2x = None 
    304         if self.is_corfunc: ly2x = ly[2].get_xdata() 
    305295        self.q_ctrl[0].SetBackgroundColour('white') 
    306296        self.q_ctrl[1].SetBackgroundColour('white') 
     
    316306                self.q_ctrl[0].SetValue(str(pos_x)) 
    317307                self.q_ctrl[1].SetBackgroundColour('pink') 
    318         elif ly2x is not None and ly1x >= ly2x: 
    319             if self.vl_ind == 1: 
    320                 ly[2].set_xdata(posx) 
    321                 ly[2].set_zorder(nop) 
    322                 self.q_ctrl[2].SetValue(str(pos_x)) 
    323             elif self.vl_ind == 2: 
    324                 ly[1].set_xdata(posx) 
    325                 ly[1].set_zorder(nop) 
    326                 self.q_ctrl[1].SetValue(str(pos_x)) 
    327  
    328308 
    329309    def _get_cusor_lines(self, event): 
     
    345325            dqmin = math.fabs(event.xdata - self.ly[0].get_xdata()) 
    346326            dqmax = math.fabs(event.xdata - self.ly[1].get_xdata()) 
    347             if not self.is_corfunc: 
    348                 is_qmax = dqmin > dqmax 
    349                 if is_qmax: 
    350                     self.vl_ind = 1 
    351                 else: 
    352                     self.vl_ind = 0 
     327            is_qmax = dqmin > dqmax 
     328            if is_qmax: 
     329                self.vl_ind = 1 
    353330            else: 
    354                 dqmax2 = math.fabs(event.xdata - self.ly[2].get_xdata()) 
    355                 closest = min(dqmin, dqmax, dqmax2) 
    356                 self.vl_ind = { dqmin: 0, dqmax: 1, dqmax2: 2 }.get(closest) 
     331                self.vl_ind = 0 
    357332 
    358333    def cusor_line(self, event): 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py

    r6ffa0dd rd85c194  
    1616from sas.sasgui.guiframe.events import EVT_NEW_PLOT 
    1717from sas.sasgui.guiframe.events import EVT_PLOT_QRANGE 
    18 from sas.sasgui.guiframe.events import EVT_PLOT_LIM 
    1918from sas.sasgui.guiframe.events import DeletePlotPanelEvent 
    2019from sas.sasgui.guiframe.plugin_base import PluginBase 
     
    8079        self.parent.Bind(EVT_NEW_PLOT, self._on_plot_event) 
    8180        self.parent.Bind(EVT_PLOT_QRANGE, self._on_plot_qrange) 
    82         self.parent.Bind(EVT_PLOT_LIM, self._on_plot_lim) 
    8381        # We have no initial panels for this plug-in 
    8482        return [] 
     
    9795            return 
    9896        panel.on_plot_qrange(event) 
    99  
    100     def _on_plot_lim(self, event=None): 
    101         if event == None: 
    102             return 
    103         if event.id in self.plot_panels.keys(): 
    104             panel = self.plot_panels[event.id] 
    105         elif event.group_id in self.plot_panels.keys(): 
    106             panel = self.plot_panels[event.group_id] 
    107         else: 
    108             return 
    109         if hasattr(event, 'xlim'): 
    110             panel.subplot.set_xlim(event.xlim) 
    111         if hasattr(event, 'ylim'): 
    112             panel.subplot.set_ylim(event.ylim) 
    113  
    11497 
    11598    def _on_show_panel(self, event): 
     
    329312                new_panel = self.create_2d_panel(data, group_id) 
    330313            self.create_panel_helper(new_panel, data, group_id, title) 
    331             if hasattr(event, 'xlim'): 
    332                 new_panel.subplot.set_xlim(event.xlim) 
    333             if hasattr(event, 'ylim'): 
    334                 new_panel.subplot.set_ylim(event.ylim) 
    335314        return 
  • src/sas/sasgui/guiframe/media/data_formats_help.rst

    r280f929 rd85c194  
    33.. This is a port of the original SasView html help file to ReSTructured text 
    44.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    5 .. WG Bouwman, DUT, added during CodeCamp-V in Oct 2016 the SESANS data format 
    65 
    76.. _Formats: 
     
    109============ 
    1110 
    12 SasView reads several different 1D (I(Q) vs Q), 2D SANS(I(Qx,Qy) vs (Qx,Qy)) 
    13 and SESANS (P(z) vs z) 
     11SasView reads several different 1D (I(Q) vs Q) and 2D (I(Qx,Qy) vs (Qx,Qy)) 
    1412data files. But please note that SasView does not at present load data where 
    1513the Q and I(Q) data are in separate files. 
    1614 
    17 1D Formats SANS 
    18 --------------- 
     151D Formats 
     16---------- 
    1917 
    2018SasView will read files with 2 to 4 columns of numbers in the following order:  
     
    4846.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    4947 
    50 2D Formats SANS 
    51 --------------- 
     482D Formats 
     49---------- 
    5250 
    5351SasView will only read files in the NIST 2D format with the extensions  
     
    6260.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    6361 
    64 SESANS Format 
    65 ------------- 
    66  
    67 The current file extension is .ses or .sesans (not case sensitive). 
    68  
    69 The file format is to have a list of name-value pairs as a header at the top of the file, detailing general experimental parameters necessary for fitting and analyzing data. This list should contain all information necessary for the file to be 'portable' between users. 
    70  
    71 Following that is a 6 column list of instrument experimental variables: 
    72  
    73 - Spin echo length (z, in Angstroms) 
    74 - Spin echo length error (:math:`\Delta` z, in Angstroms) (experimental resolution) 
    75 - neutron wavelength (:math:`\lambda`, in Angstroms) (essential for ToF instruments) 
    76 - neutron wavelength error (:math:`\Delta \lambda`, in Angstroms) 
    77 - Normalized polarization (:math:`P/P_0`, unitless) 
    78 - Normalized polarization error (:math:`\Delta(P/P_0)`, unitless) (measurement error) 
    79  
    80  
    81 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    82  
    83 .. note::  This help document was last changed by Wim Bouwman, 05Oct2016 
     62.. note::  This help document was last changed by Steve King, 01May2015 
  • src/sas/sasgui/perspectives/calculator/pyconsole.py

    rf1cbae7 r7673ecd  
    99import wx 
    1010from wx.lib.dialogs import ScrolledMessageDialog 
    11 from wx.lib import layoutf 
    12  
    1311import wx.py.editor as editor 
    1412 
     
    6563        title, icon = "Info", wx.ICON_INFORMATION 
    6664    text = "\n".join(parts) 
    67     dlg = ResizableScrolledMessageDialog(parent, text, title, size=((550, 250))) 
     65    dlg = ScrolledMessageDialog(parent, text, title, size=((550, 250))) 
    6866    fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL) 
    6967    dlg.GetChildren()[0].SetFont(fnt) 
     
    7270    dlg.Destroy() 
    7371    return errmsg is None 
    74  
    75 class ResizableScrolledMessageDialog(wx.Dialog): 
    76     """ 
    77     Custom version of wx ScrolledMessageDialog, allowing border resize 
    78     """ 
    79     def __init__(self, parent, msg, caption, 
    80         pos=wx.DefaultPosition, size=(500,300), 
    81         style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER ): 
    82         # Notice, that style can be overrriden in the caller. 
    83         wx.Dialog.__init__(self, parent, -1, caption, pos, size, style) 
    84         x, y = pos 
    85         if x == -1 and y == -1: 
    86             self.CenterOnScreen(wx.BOTH) 
    87  
    88         text = wx.TextCtrl(self, -1, msg, style=wx.TE_MULTILINE | wx.TE_READONLY) 
    89         ok = wx.Button(self, wx.ID_OK, "OK") 
    90  
    91         # Mysterious constraint layouts from  
    92         # https://www.wxpython.org/docs/api/wx.lib.layoutf.Layoutf-class.html 
    93         lc = layoutf.Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)) 
    94         text.SetConstraints(lc) 
    95         lc = layoutf.Layoutf('b=b5#1;x%w50#1;w!80;h!25', (self,)) 
    96         ok.SetConstraints(lc) 
    97  
    98         self.SetAutoLayout(1) 
    99         self.Layout() 
    10072 
    10173class PyConsole(editor.EditorNotebookFrame): 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r4c3be25 rc65a265  
    143143        self.theory_qmin_x = None 
    144144        self.theory_qmax_x = None 
     145        self.cb1 = None 
    145146        self.btEditMask = None 
    146147        self.btFit = None 
     
    11961197        # set data, etc. from the state 
    11971198        # reset page between theory and fitting from bookmarking 
     1199        #if state.data == None: 
     1200        #    data = None 
     1201        #else: 
    11981202        data = state.data 
    11991203 
     
    12211225        self.disp_cb_dict = state.disp_cb_dict 
    12221226        self.disp_list = state.disp_list 
     1227 
     1228        ## set the state of the radio box 
     1229        #self.shape_rbutton.SetValue(state.shape_rbutton) 
     1230        #self.shape_indep_rbutton.SetValue(state.shape_indep_rbutton) 
     1231        #self.struct_rbutton.SetValue(state.struct_rbutton) 
     1232        #self.plugin_rbutton.SetValue(state.plugin_rbutton) 
    12231233 
    12241234        ## fill model combobox 
     
    12761286            else: 
    12771287                self.model_view.SetLabel("1D Mode") 
     1288 
     1289        ## set the select all check box to the a given state 
     1290        self.cb1.SetValue(state.cb1) 
    12781291 
    12791292        ## reset state of checkbox,textcrtl  and  regular parameters value 
     
    14051418                        except Exception: 
    14061419                            logging.error(traceback.format_exc()) 
     1420 
     1421        # Make sure the check box updated when all checked 
     1422        if self.cb1.GetValue(): 
     1423            self.select_all_param(None) 
    14071424 
    14081425    def _selectDlg(self): 
     
    25402557                        item[2].Enable() 
    25412558 
    2542             # Make sure the check box updated 
    2543             self.get_all_checked_params() 
     2559            # Make sure the check box updated when all checked 
     2560            if self.cb1.GetValue(): 
     2561                #self.select_all_param(None) 
     2562                self.get_all_checked_params() 
    25442563 
    25452564            # update params 
     
    36963715        call back for model selection if implemented 
    36973716        """ 
     3717    def select_all_param(self, event): 
     3718        """ 
     3719        set to true or false all checkBox if implemented 
     3720        """ 
    36983721    def get_weight_flag(self): 
    36993722        """ 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    r4c3be25 r6c382da  
    624624        ## fill a sizer with the combobox to select dispersion type 
    625625        model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 
    626         CHECK_STATE = False 
     626        CHECK_STATE = self.cb1.GetValue() 
    627627 
    628628        ix = 0 
     
    969969        self.state.model = self.model.clone() 
    970970        ## save state into 
     971        self.state.cb1 = self.cb1.GetValue() 
    971972        self._copy_parameters_state(self.parameters, self.state.parameters) 
    972973        self._copy_parameters_state(self.orientation_params_disp, 
     
    979980                     StatusEvent(status=" Selected Distribution: Gaussian")) 
    980981        #Fill the list of fittable parameters 
     982        #self.select_all_param(event=None) 
    981983        self.get_all_checked_params() 
    982984        self.Layout() 
     
    26932695        self._manager.set_param2fit(self.uid, param2fit) 
    26942696 
     2697    def select_all_param(self, event): 
     2698        """ 
     2699        set to true or false all checkBox given the main checkbox value cb1 
     2700        """ 
     2701        self.param_toFit = [] 
     2702        if  self.parameters != []: 
     2703            if  self.cb1.GetValue(): 
     2704                for item in self.parameters: 
     2705                    if item[0].IsShown(): 
     2706                        ## for data2D select all to fit 
     2707                        if self.data.__class__.__name__ == "Data2D" or \ 
     2708                                self.enable2D: 
     2709                            item[0].SetValue(True) 
     2710                            self.param_toFit.append(item) 
     2711                        else: 
     2712                            ## for 1D all parameters except orientation 
     2713                            if not item in self.orientation_params: 
     2714                                item[0].SetValue(True) 
     2715                                self.param_toFit.append(item) 
     2716                    else: 
     2717                        item[0].SetValue(False) 
     2718                #if len(self.fittable_param)>0: 
     2719                for item in self.fittable_param: 
     2720                    if item[0].IsShown(): 
     2721                        if self.data.__class__.__name__ == "Data2D" or \ 
     2722                                self.enable2D: 
     2723                            item[0].SetValue(True) 
     2724                            self.param_toFit.append(item) 
     2725                            try: 
     2726                                if len(self.values[item[1]]) > 0: 
     2727                                    item[0].SetValue(False) 
     2728                            except: 
     2729                                pass 
     2730 
     2731                        else: 
     2732                            ## for 1D all parameters except orientation 
     2733                            if not item in self.orientation_params_disp: 
     2734                                item[0].SetValue(True) 
     2735                                self.param_toFit.append(item) 
     2736                                try: 
     2737                                    if len(self.values[item[1]]) > 0: 
     2738                                        item[0].SetValue(False) 
     2739                                except: 
     2740                                    pass 
     2741                    else: 
     2742                        item[0].SetValue(False) 
     2743 
     2744            else: 
     2745                for item in self.parameters: 
     2746                    item[0].SetValue(False) 
     2747                for item in self.fittable_param: 
     2748                    item[0].SetValue(False) 
     2749                self.param_toFit = [] 
     2750 
     2751        self.save_current_state_fit() 
     2752 
     2753        if event != None: 
     2754            #self._undo.Enable(True) 
     2755            ## post state to fit panel 
     2756            event = PageInfoEvent(page=self) 
     2757            wx.PostEvent(self.parent, event) 
     2758        param2fit = [] 
     2759        for item in self.param_toFit: 
     2760            if item[0] and item[0].IsShown(): 
     2761                param2fit.append(item[1]) 
     2762        self.parent._manager.set_param2fit(self.uid, param2fit) 
     2763 
    26952764    def select_param(self, event): 
    26962765        """ 
     
    27392808        if len(self.fittable_param) > 0: 
    27402809            len_orient_para *= 2 
     2810        #Set the value of checkbox that selected every checkbox or not 
     2811        if len(self.parameters) + len(self.fittable_param) - len_orient_para \ 
     2812            == len(self.param_toFit): 
     2813            self.cb1.SetValue(True) 
     2814        else: 
     2815            self.cb1.SetValue(False) 
    27412816 
    27422817        self.save_current_state_fit() 
     
    28402915        iy = 0 
    28412916        ix = 0 
    2842         sizer.Add(wx.StaticText(self, wx.ID_ANY, 'Parameter'), 
    2843                   (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     2917        select_text = "Select All" 
     2918        self.cb1 = wx.CheckBox(self, wx.ID_ANY, str(select_text), (10, 10)) 
     2919        wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 
     2920        self.cb1.SetToolTipString("To check/uncheck all the boxes below.") 
     2921        self.cb1.SetValue(True) 
     2922 
     2923        sizer.Add(self.cb1, (iy, ix), (1, 1), \ 
     2924                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 
    28442925        ix += 1 
    28452926        self.text2_2 = wx.StaticText(self, wx.ID_ANY, 'Value') 
     
    28682949        self.text2_4.Hide() 
    28692950 
    2870         CHECK_STATE = False 
     2951        CHECK_STATE = self.cb1.GetValue() 
    28712952        for item in keys: 
    28722953 
  • src/sas/sasgui/perspectives/fitting/media/plugin.rst

    rb2a3814 rcbbb6a4  
    33Writing a Plugin Model 
    44====================== 
    5  
    6 .. note:: If some code blocks are not readable, expand the documentation window 
    75 
    86Overview 
Note: See TracChangeset for help on using the changeset viewer.