Changeset ed0b796 in sasview


Ignore:
Timestamp:
Oct 1, 2016 10:05:16 PM (5 years ago)
Author:
butler
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
c5a22a85, 311fce5
Parents:
d186319 (diff), e74274ab (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/SasView/sasview.git

Files:
1 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • Vagrantfile

    r96032b3 r601b93d  
    2121  # Every Vagrant development environment requires a box. You can search for 
    2222  # boxes at https://atlas.hashicorp.com/search. 
    23   config.vm.box = "ubuntu1404" 
    24   config.vm.box_url = "https://github.com/hnakamur/packer-templates/releases/download/v1.0.2/ubuntu-14-04-x64-virtualbox.box" 
     23  config.vm.box = "ubuntu/trusty64" 
    2524  #config.vm.box = "fedora19" 
    2625  #config.vm.box_url = "https://dl.dropboxusercontent.com/u/86066173/fedora-19.box" 
  • docs/sphinx-docs/source/conf.py

    r86eb046 r9a182b2  
    6262version = '4.0' 
    6363# The full version, including alpha/beta/rc tags. 
    64 release = '4.0b1' 
     64release = '4.0.0' 
    6565 
    6666# The language for content autogenerated by Sphinx. Refer to documentation 
  • sasview/README.txt

    r86eb046 r9a182b2  
    441- Features 
    55=========== 
     6    - New in Version 4.0 
     7      ------------------ 
     8      This release fixes the various bugs found during the alpha and beta testing 
     9      - Improvements 
     10        - Support for reading data files from Anton Paar Saxess instruments 
     11        - Adds documentation on how to write custom models in the new framework 
     12      - Bug Fixes 
     13        - Fixes bug #604 Pringle model questions 
     14        - Fixes bug #472 Reparameterize Teubner-Strey 
     15        - Fixes bug #530 Numerical instabilities in Teubner Strey model 
     16        - Fixes bug #658 ASCII reader very broken 
     17 
    618 
    719    - New in Version 4.0 beta 1 
     
    1426         - Old custom models should now still work 
    1527            - '''NOTE:''' These will be deprecated in a future version. Old 
    16             custom models should be converted to the new model format which  
     28            custom models should be converted to the new model format which 
    1729            is now the same as the built in models and offers much better 
    1830            support. 
     
    7991   - New in Version 3.1.2 
    8092     -------------------- 
    81      This release is a major stability improvement, having fixed a serious bug  
     93     This release is a major stability improvement, having fixed a serious bug 
    8294     that came to light since release 3.1.1. All users should upgrade. 
    8395 
    84      - Fixes bug #468 broken remove constraint buttons in  
     96     - Fixes bug #468 broken remove constraint buttons in 
    8597       simultaneous/constrained fitting panel 
    86      - Fixes bug #474 resulting from changes in 3.1.1 that had  
     98     - Fixes bug #474 resulting from changes in 3.1.1 that had 
    8799       introduced an error in the high-Q of slit-smeared models. 
    88      - Fixes bug #478 which would cause wx to run out of IDs and result  
     100     - Fixes bug #478 which would cause wx to run out of IDs and result 
    89101       in SasView crashing even if left alone. 
    90102     - Fixes bug #479 missing help button on simultaneous/constrained fit page 
     
    110122         documentation. 
    111123       - The model help has been split so that the Details button now brings up 
    112          a very short pop-up giving the equation being used while HELP goes to  
     124         a very short pop-up giving the equation being used while HELP goes to 
    113125         the section in the full documentation describing the model. 
    114        - Extensive help has also been added for the new optimizer engine (see  
     126       - Extensive help has also been added for the new optimizer engine (see 
    115127         below) including rules of thumb on how and when to choose a given 
    116128         optimizer and what the parameters do. 
     
    127139         - A Nelder-Mead Simplex optimizer 
    128140         - A Differential Evolution optimizer 
    129          - A Monte Carlo optimizer (DREAM)  
     141         - A Monte Carlo optimizer (DREAM) 
    130142     - New models were added: 
    131143         - MicelleSphCoreModel (currently residing in the Uncategorized category) 
     
    136148         - RectangularHollowPrismInfThinWallsModel 
    137149     - Infrastructure to allow SESANS data to be fit with models was added. This 
    138        will become available in a future release but can currently be used from  
     150       will become available in a future release but can currently be used from 
    139151       the command line with some caveats. 
    140152     - A number of bugs were fixed including a thread crashing issue and an 
     
    161173       floating. 
    162174     - Five new models have been added: PringlesModel, CoreShellEllipsoidXTModel, 
    163        RectangularPrismModel, RectangularHollowPrismModel and  
     175       RectangularPrismModel, RectangularHollowPrismModel and 
    164176       RectangularHollowPrismInfThinWallsModel. 
    165      - The data loader now supports ILL DAT data files and reads the full meta  
     177     - The data loader now supports ILL DAT data files and reads the full meta 
    166178       information from canSAS file formats. 
    167179     - Redefined convention for specifying angular parameters for anisotropic 
    168180       models. 
    169      - A number of minor features have been added such as permitting a log  
    170        distribution of points when using a model to simulate data, and the  
     181     - A number of minor features have been added such as permitting a log 
     182       distribution of points when using a model to simulate data, and the 
    171183       addition of a Kratky plot option to the linear plots. 
    172184     - A number of bugs have also been fixed. 
    173185     - Save Project and Save Analysis now work more reliably. 
    174      - BETA: Magnetic contrast supporting full polarization analysis has been  
     186     - BETA: Magnetic contrast supporting full polarization analysis has been 
    175187       implemented for some spherical and cylindrical models. 
    176188     - BETA: Two new tools have been added: 
    177        - A generic scattering calculator which takes an atomic, magnetic or  
    178          SLD distribution in space and generates the appropriate 2D  
    179          scattering pattern. In some cases the orientationally averaged  
    180          (powder) 1D scattering can also be computed. Supported formats  
    181          include: SLD or text, PDB, and OMF magnetic moment distribution  
     189       - A generic scattering calculator which takes an atomic, magnetic or 
     190         SLD distribution in space and generates the appropriate 2D 
     191         scattering pattern. In some cases the orientationally averaged 
     192         (powder) 1D scattering can also be computed. Supported formats 
     193         include: SLD or text, PDB, and OMF magnetic moment distribution 
    182194         file. 
    183        - An image viewer/converter for data in image format; this reads in  
    184          an image file and will attempt to convert the image pixels to  
     195       - An image viewer/converter for data in image format; this reads in 
     196         an image file and will attempt to convert the image pixels to 
    185197         data. Supported formats include: TIFF, TIF, PNG, BMP, JPG. 
    186198 
     
    210222     - Added more plot symbols options for 1d plots 
    211223     - Added improved trapping of compiling errors to the 'New model editor' 
    212      - Added some intelligent outputs (e.g., Rg, background, or rod diameter  
     224     - Added some intelligent outputs (e.g., Rg, background, or rod diameter 
    213225       depending on the choice of axis scale of the plot) to the linear fits 
    214226     - Added more models 
    215       
    216    - Feature set from previous versions          
     227 
     228   - Feature set from previous versions 
    217229     ----------------------------------- 
    218230     - Perspectives Available 
     
    220232         specific surface area. 
    221233       - P(r) inversion calculator: Indirect Fourier transformation method. 
    222        - Fitting: the tool used for modeling and fitting 1D and 2D data to  
     234       - Fitting: the tool used for modeling and fitting 1D and 2D data to 
    223235         analytical model functions 
    224236       - Tools: provides a number of useful supplementary tools such as SLD 
    225          calculation   
    226      
    227      - Fitting  
     237         calculation 
     238 
     239     - Fitting 
    228240       - Includes a large number of model functions, both form factors and structure factors. 
    229241       - Support P(Q)*S(Q) for form factors that flag they can be so multiplied. 
     
    233245       - Anisotropic shapes and magnetic moment modeling in 2D allow for a non-uniform 
    234246         distribution of orientations of a given axis leading to modeling and fitting 
    235          capabilities of non azimuthaly symmetric data.   
     247         capabilities of non azimuthaly symmetric data. 
    236248       - User can choose to weight fits or not. If using weights, the user can choose 
    237249         the error bar on each point if provided in the file, the square root 
    238          of the intensity or the intensity itself.  
     250         of the intensity or the intensity itself. 
    239251       - Instrumental resolution smearing of model or fits is provided with several 
    240252         options: read the resolution/point fromt he file. Input a pinhole resolution 
     
    249261         data set or several different sets simultaneously with the application 
    250262         of advanced constraints relating fit parameters to functions of other 
    251          parameters (including from a different set). For example thickness of  
    252          shell = sin(30) times the length.   
     263         parameters (including from a different set). For example thickness of 
     264         shell = sin(30) times the length. 
    253265       - Models that are the sum of two other models can be easily generated through the 
    254266         SUM Model menubar item. 
     
    259271         and the mathematical function of the model (box 2) and generating the 
    260272         necessary *.py file.  A separate advanced model editor provides a full Python 
    261          file editor.  Either way once saved the model becomes immediately available  
    262          to the application.  
     273         file editor.  Either way once saved the model becomes immediately available 
     274         to the application. 
    263275       - A batch fitting capability allows for the analysis of a series of data sets to 
    264276         a single model and provides the results in a tabular form suitable for saving 
    265277         or plotting the evolution of the fit parameters with error bars (from within 
    266278         the application). 
    267   
     279 
    268280     - Tools 
    269281       - A scattering length density calculator,including some X-ray information 
     
    275287       - A slit size calculator optimized for Anton Paar Saxess is provided. 
    276288       - A kiessig fringe thickness calculator is provided 
    277           
     289 
    278290     - Plots and plot management 
    279291       - A 3D graphing option (for 2d data/results) is provided with the view 
     
    289301       - Extensive context sensitive plot/fitting/manipulation options are available 
    290302         through a right mouse click pop-up menu on plots. 
    291             
     303 
    292304     - Data management 
    293305       - Supports 2 + column 1D ASCII data, NIST 1D and 2D data, and canSAS data 
    294          via plug-in mechanism which can easily allow other readers as appropriate.  
     306         via plug-in mechanism which can easily allow other readers as appropriate. 
    295307       - 2D data is expected in Q space but for historical reasons accepts the 
    296308         NIST 2D raw pixel format and will do conversion internally. 
     
    298310         right clicking on a data set and choosing Data Info in the DataExplorer 
    299311         or on the plots 
    300        - Supports loading a single file, multiple files, or a whole folder    
     312       - Supports loading a single file, multiple files, or a whole folder 
    301313       - An optional Data Explorer is provided (default) which simplifies managing, 
    302314         plotting, deleting, or setup for computation. Most functions however do 
     
    304316         right click menus and the toolbar.  The data explorer can be re-started 
    305317         from the menu bar. 
    306             
     318 
    307319     - Data manipulation 
    308320       - Support various 2D averaging methods : Circular, sectors, annular, 
     
    310322       - A 2D data maks editor is provided 
    311323       - 2D mask can be applied to the circular averaging. 
    312           
     324 
    313325     - Miscellaneous features 
    314326       - limited reports can be generated in pdf format 
     
    3313432- Downloading and Installing 
    332344============================= 
    333          
     345 
    334346   *** Note 1:  Much more information is available at www.sasview.org under links. 
    335347                    Look in the 'For Developers' section and particularly the wiki at 
     
    370382        - The following modules are required (version numbers are what are used 
    371383          in the windows release build): 
    372            
     384 
    373385          - Common Packages 
    374386            - reportlab 3.1.44 
     
    387399            - html5lib Version Installed: 0.99999 
    388400            - wx Version Installed: 3.0.2.0 
    389            
     401 
    390402          - Windows Specific Packages 
    391403            - pywin 219 
     
    393405            - comtypes 1.1.1 
    394406            - MinGW w/ gcc version 4.6.1 (WIN) 
    395             - vcredist_x86.exe (version 9.0.21022.8  -microsoft visual C 2008  
     407            - vcredist_x86.exe (version 9.0.21022.8  -microsoft visual C 2008 
    396408              re-distributable) 
    397409            - Innosetup (WIN - isetup 5.4.2-unicode) - used to create distributable 
     
    399411            *** Note: Windows build dependencies can be set up using anaconda. Instructions 
    400412                can be found at http://trac.sasview.org/wiki/AnacondaSetup 
    401              
     413 
    402414          - MAC Specifc Packages 
    403415            - py2app 0.7.1 
    404            
     416 
    405417 
    4064183- Known Issues 
     
    412424          equations will render properly. Until then they will show in their 
    413425          original TeX format. 
    414         - If the documentation window remains stubbornly blank, try installing a  
     426        - If the documentation window remains stubbornly blank, try installing a 
    415427          different browser and set that as your default browser. Issues have 
    416428          been noted with Internet Explorer 11. 
    417         - Check for Updates may fail (with the status bar message ' Cannot  
    418           connect to the application server') if your internet connection uses  
    419           a proxy server. Tested resolutions for this are described on the  
     429        - Check for Updates may fail (with the status bar message ' Cannot 
     430          connect to the application server') if your internet connection uses 
     431          a proxy server. Tested resolutions for this are described on the 
    420432          website FAQ. 
    421433        - The copy and paste functions (^C, ^V) in the batch mode results grid 
    422434          require two clicks: one to select the cell and a second to select the 
    423           contents of the cell.  
     435          contents of the cell. 
    424436        - The tutorial has not yet been updated and is somewhat out of date 
    425437        - Very old computers may struggle to run the 3.x and later releases 
     
    436448        - The angular distribution angles are not clearly defined and may in 
    437449          some cases lead to incorrect calculations(ticket #332) 
    438            
     450 
    439451   3.2- Windows: 
    440452        - If installed to same directory as old version without first removing 
     
    443455          have the old name even though pointing to the new version.  Usually 
    444456          safest to uninstall old version prior to installing new version anyway. 
    445                  
     457 
    446458   3.3- MAC: 
    447459        - Application normally starts up hidden. Click icon in Dock to view/use 
    448           application.  
     460          application. 
    449461        - Multiprocessing does not currently work on MAC OS 
    450                  
     462 
    451463   3.4- Linux: 
    452464        - Not well tested 
     
    456468================== 
    457469 
    458    - www.sasview.org.  This main project site is the gateway to all  
     470   - www.sasview.org.  This main project site is the gateway to all 
    459471     information about the sasview project.  It includes information 
    460472     about the project, a FAQ page and links to all developer and user 
     
    475487   - Latest developer builds 
    476488     - https://jenkins.esss.dk/sasview/view/Master-Builds/ 
    477  
    478      
  • sasview/__init__.py

    r4ac4caa r9a182b2  
    1 __version__ = "4.0b1" 
     1__version__ = "4.0" 
    22__build__ = "GIT_COMMIT" 
    33try: 
  • sasview/local_config.py

    r9bbc074 re74274ab  
    3535'''Acknowledge its use in your publications as suggested below''' 
    3636_acknowledgement_preamble_bullet2 =\ 
    37 '''Reference the following website: http://www.sasview.org''' 
     37'''Reference SasView as : Doucet M, et. al. SasView version 4.0, Zenodo''' +\ 
     38''', http://doi.org/10.5281/zenodo.159083''' 
    3839_acknowledgement_preamble_bullet3 =\ 
    3940'''Reference the model you used if appropriate (see documentation for refs)''' 
     
    4243_acknowledgement_publications = \ 
    4344'''This work benefited from the use of the SasView application, originally 
    44 developed under NSF award DMR-0520547. 
     45developed under NSF award DMR-0520547. SasView contains code developed with 
     46funding from the European Union's Horizon 2020 research and innovation programme 
     47under the SINE2020 project, grant agreement No 654000. 
    4548''' 
    4649_acknowledgement =  \ 
    4750'''This work originally developed as part of the DANSE project funded by the NSF 
    4851under grant DMR-0520547, and currently maintained by NIST, UMD, ORNL, ISIS, ESS 
    49 and ILL. 
     52and ILL. SasView contains code developed with funding from the European Union's 
     53Horizon 2020 research and innovation programme under the SINE2020 project, grant 
     54agreement No 654000. 
    5055 
    5156''' 
  • src/sas/sascalc/dataloader/readers/anton_paar_saxs_reader.py

    r80c5d46 ra235f715  
    4545    output = None 
    4646 
    47     def __init__(self): 
     47    def reset_state(self): 
    4848        self.current_dataset = Data1D(np.empty(0), np.empty(0), 
    4949                                            np.empty(0), np.empty(0)) 
     
    7272 
    7373        ## Reinitialize the class when loading a new data file to reset all class variables 
    74         self.__init__() 
     74        self.reset_state() 
    7575        ## Check that the file exists 
    7676        if os.path.isfile(filename): 
     
    8484                self.raw_data = buff.splitlines() 
    8585                self.read_data() 
    86                 xml_intermediate = self.raw_data[self.upper:] 
    87                 xml = ''.join(xml_intermediate) 
    88                 self.set_xml_file(xml) 
    8986        return self.output 
    9087 
     
    10097        self.lower = 5 
    10198        self.upper = self.lower + self.data_points 
    102         self.detector.distance = float(line4[1]) 
     99        self.source.radiation = 'x-ray' 
     100        normal = float(line4[3]) 
    103101        self.current_dataset.source.radiation = "x-ray" 
    104102        self.current_dataset.source.name = "Anton Paar SAXSess Instrument" 
    105103        self.current_dataset.source.wavelength = float(line4[4]) 
    106         normal = line4[3] 
     104        xvals = [] 
     105        yvals = [] 
     106        dyvals = [] 
    107107        for i in range(self.lower, self.upper): 
     108            index = i - self.lower 
    108109            data = self.raw_data[i].split() 
    109             x_val = [float(data[0])] 
    110             y_val = [float(data[1])] 
    111             dy_val = [float(data[2])] 
    112             self.current_dataset.x = np.append(self.current_dataset.x, x_val) 
    113             self.current_dataset.y = np.append(self.current_dataset.y, y_val) 
    114             self.current_dataset.dy = np.append(self.current_dataset.dy, dy_val) 
    115         self.current_dataset.xaxis("Q (%s)" % (q_unit), q_unit) 
    116         self.current_dataset.yaxis("Intensity (%s)" % (i_unit), i_unit) 
    117         self.current_dataset.detector.append(self.detector) 
     110            xvals.insert(index, normal * float(data[0])) 
     111            yvals.insert(index, normal * float(data[1])) 
     112            dyvals.insert(index, normal * float(data[2])) 
     113        self.current_dataset.x = np.append(self.current_dataset.x, xvals) 
     114        self.current_dataset.y = np.append(self.current_dataset.y, yvals) 
     115        self.current_dataset.dy = np.append(self.current_dataset.dy, dyvals) 
     116        if self.data_points != self.current_dataset.x.size: 
     117            self.errors.add("Not all data was loaded properly.") 
     118        if self.current_dataset.dx.size != self.current_dataset.x.size: 
     119            dxvals = np.zeros(self.current_dataset.x.size) 
     120            self.current_dataset.dx = dxvals 
     121        if self.current_dataset.x.size != self.current_dataset.y.size: 
     122            self.errors.add("The x and y data sets are not the same size.") 
     123        if self.current_dataset.y.size != self.current_dataset.dy.size: 
     124            self.errors.add("The y and dy datasets are not the same size.") 
     125        self.current_dataset.errors = self.errors 
     126        self.current_dataset.xaxis("Q", q_unit) 
     127        self.current_dataset.yaxis("Intensity", i_unit) 
     128        xml_intermediate = self.raw_data[self.upper:] 
     129        xml = ''.join(xml_intermediate) 
     130        self.set_xml_string(xml) 
     131        dom = self.xmlroot.xpath('/fileinfo') 
     132        self._parse_child(dom) 
    118133        self.output.append(self.current_dataset) 
     134 
     135    def _parse_child(self, dom, parent=''): 
     136        """ 
     137        Recursive method for stepping through the embedded XML 
     138        :param dom: XML node with or without children 
     139        """ 
     140        for node in dom: 
     141            tagname = node.tag 
     142            value = node.text 
     143            attr = node.attrib 
     144            key = attr.get("key", '') 
     145            if len(node.getchildren()) > 1: 
     146                self._parse_child(node, key) 
     147                if key == "SampleDetector": 
     148                    self.current_dataset.detector.append(self.detector) 
     149                    self.detector = Detector() 
     150            else: 
     151                if key == "value": 
     152                    if parent == "Wavelength": 
     153                        self.current_dataset.source.wavelength = value 
     154                    elif parent == "SampleDetector": 
     155                        self.detector.distance = value 
     156                    elif parent == "Temperature": 
     157                        self.current_dataset.sample.temperature = value 
     158                    elif parent == "CounterSlitLength": 
     159                        self.detector.slit_length = value 
     160                elif key == "unit": 
     161                    value = value.replace("_", "") 
     162                    if parent == "Wavelength": 
     163                        self.current_dataset.source.wavelength_unit = value 
     164                    elif parent == "SampleDetector": 
     165                        self.detector.distance_unit = value 
     166                    elif parent == "X": 
     167                        self.current_dataset.xaxis(self.current_dataset._xaxis, value) 
     168                    elif parent == "Y": 
     169                        self.current_dataset.yaxis(self.current_dataset._yaxis, value) 
     170                    elif parent == "Temperature": 
     171                        self.current_dataset.sample.temperature_unit = value 
     172                    elif parent == "CounterSlitLength": 
     173                        self.detector.slit_length_unit = value 
     174                elif key == "quantity": 
     175                    if parent == "X": 
     176                        self.current_dataset.xaxis(value, self.current_dataset._xunit) 
     177                    elif parent == "Y": 
     178                        self.current_dataset.yaxis(value, self.current_dataset._yunit) 
  • src/sas/sascalc/dataloader/readers/xml_reader.py

    rb699768 ra235f715  
    7070            self.xmldoc = etree.parse(self.xml, parser=PARSER) 
    7171            self.xmlroot = self.xmldoc.getroot() 
     72        except etree.XMLSyntaxError as xml_error: 
     73            logging.info(xml_error) 
     74        except Exception: 
     75            self.xml = None 
     76            self.xmldoc = None 
     77            self.xmlroot = None 
     78 
     79    def set_xml_string(self, tag_soup): 
     80        """ 
     81        Set an XML string as the working XML. 
     82 
     83        :param tag_soup: XML formatted string 
     84        """ 
     85        try: 
     86            self.xml = tag_soup 
     87            self.xmldoc = tag_soup 
     88            self.xmlroot = etree.fromstring(tag_soup) 
    7289        except etree.XMLSyntaxError as xml_error: 
    7390            logging.info(xml_error) 
Note: See TracChangeset for help on using the changeset viewer.