Changes in / [ed0b796:d186319] in sasview


Ignore:
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • Vagrantfile

    r601b93d r96032b3  
    2121  # Every Vagrant development environment requires a box. You can search for 
    2222  # boxes at https://atlas.hashicorp.com/search. 
    23   config.vm.box = "ubuntu/trusty64" 
     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" 
    2425  #config.vm.box = "fedora19" 
    2526  #config.vm.box_url = "https://dl.dropboxusercontent.com/u/86066173/fedora-19.box" 
  • docs/sphinx-docs/source/conf.py

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

    r9a182b2 r86eb046  
    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  
    186 
    197    - New in Version 4.0 beta 1 
     
    2614         - Old custom models should now still work 
    2715            - '''NOTE:''' These will be deprecated in a future version. Old 
    28             custom models should be converted to the new model format which 
     16            custom models should be converted to the new model format which  
    2917            is now the same as the built in models and offers much better 
    3018            support. 
     
    9179   - New in Version 3.1.2 
    9280     -------------------- 
    93      This release is a major stability improvement, having fixed a serious bug 
     81     This release is a major stability improvement, having fixed a serious bug  
    9482     that came to light since release 3.1.1. All users should upgrade. 
    9583 
    96      - Fixes bug #468 broken remove constraint buttons in 
     84     - Fixes bug #468 broken remove constraint buttons in  
    9785       simultaneous/constrained fitting panel 
    98      - Fixes bug #474 resulting from changes in 3.1.1 that had 
     86     - Fixes bug #474 resulting from changes in 3.1.1 that had  
    9987       introduced an error in the high-Q of slit-smeared models. 
    100      - Fixes bug #478 which would cause wx to run out of IDs and result 
     88     - Fixes bug #478 which would cause wx to run out of IDs and result  
    10189       in SasView crashing even if left alone. 
    10290     - Fixes bug #479 missing help button on simultaneous/constrained fit page 
     
    122110         documentation. 
    123111       - The model help has been split so that the Details button now brings up 
    124          a very short pop-up giving the equation being used while HELP goes to 
     112         a very short pop-up giving the equation being used while HELP goes to  
    125113         the section in the full documentation describing the model. 
    126        - Extensive help has also been added for the new optimizer engine (see 
     114       - Extensive help has also been added for the new optimizer engine (see  
    127115         below) including rules of thumb on how and when to choose a given 
    128116         optimizer and what the parameters do. 
     
    139127         - A Nelder-Mead Simplex optimizer 
    140128         - A Differential Evolution optimizer 
    141          - A Monte Carlo optimizer (DREAM) 
     129         - A Monte Carlo optimizer (DREAM)  
    142130     - New models were added: 
    143131         - MicelleSphCoreModel (currently residing in the Uncategorized category) 
     
    148136         - RectangularHollowPrismInfThinWallsModel 
    149137     - Infrastructure to allow SESANS data to be fit with models was added. This 
    150        will become available in a future release but can currently be used from 
     138       will become available in a future release but can currently be used from  
    151139       the command line with some caveats. 
    152140     - A number of bugs were fixed including a thread crashing issue and an 
     
    173161       floating. 
    174162     - Five new models have been added: PringlesModel, CoreShellEllipsoidXTModel, 
    175        RectangularPrismModel, RectangularHollowPrismModel and 
     163       RectangularPrismModel, RectangularHollowPrismModel and  
    176164       RectangularHollowPrismInfThinWallsModel. 
    177      - The data loader now supports ILL DAT data files and reads the full meta 
     165     - The data loader now supports ILL DAT data files and reads the full meta  
    178166       information from canSAS file formats. 
    179167     - Redefined convention for specifying angular parameters for anisotropic 
    180168       models. 
    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 
     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  
    183171       addition of a Kratky plot option to the linear plots. 
    184172     - A number of bugs have also been fixed. 
    185173     - Save Project and Save Analysis now work more reliably. 
    186      - BETA: Magnetic contrast supporting full polarization analysis has been 
     174     - BETA: Magnetic contrast supporting full polarization analysis has been  
    187175       implemented for some spherical and cylindrical models. 
    188176     - BETA: Two new tools have been added: 
    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 
     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  
    194182         file. 
    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 
     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  
    197185         data. Supported formats include: TIFF, TIF, PNG, BMP, JPG. 
    198186 
     
    222210     - Added more plot symbols options for 1d plots 
    223211     - Added improved trapping of compiling errors to the 'New model editor' 
    224      - Added some intelligent outputs (e.g., Rg, background, or rod diameter 
     212     - Added some intelligent outputs (e.g., Rg, background, or rod diameter  
    225213       depending on the choice of axis scale of the plot) to the linear fits 
    226214     - Added more models 
    227  
    228    - Feature set from previous versions 
     215      
     216   - Feature set from previous versions          
    229217     ----------------------------------- 
    230218     - Perspectives Available 
     
    232220         specific surface area. 
    233221       - P(r) inversion calculator: Indirect Fourier transformation method. 
    234        - Fitting: the tool used for modeling and fitting 1D and 2D data to 
     222       - Fitting: the tool used for modeling and fitting 1D and 2D data to  
    235223         analytical model functions 
    236224       - Tools: provides a number of useful supplementary tools such as SLD 
    237          calculation 
    238  
    239      - Fitting 
     225         calculation   
     226     
     227     - Fitting  
    240228       - Includes a large number of model functions, both form factors and structure factors. 
    241229       - Support P(Q)*S(Q) for form factors that flag they can be so multiplied. 
     
    245233       - Anisotropic shapes and magnetic moment modeling in 2D allow for a non-uniform 
    246234         distribution of orientations of a given axis leading to modeling and fitting 
    247          capabilities of non azimuthaly symmetric data. 
     235         capabilities of non azimuthaly symmetric data.   
    248236       - User can choose to weight fits or not. If using weights, the user can choose 
    249237         the error bar on each point if provided in the file, the square root 
    250          of the intensity or the intensity itself. 
     238         of the intensity or the intensity itself.  
    251239       - Instrumental resolution smearing of model or fits is provided with several 
    252240         options: read the resolution/point fromt he file. Input a pinhole resolution 
     
    261249         data set or several different sets simultaneously with the application 
    262250         of advanced constraints relating fit parameters to functions of other 
    263          parameters (including from a different set). For example thickness of 
    264          shell = sin(30) times the length. 
     251         parameters (including from a different set). For example thickness of  
     252         shell = sin(30) times the length.   
    265253       - Models that are the sum of two other models can be easily generated through the 
    266254         SUM Model menubar item. 
     
    271259         and the mathematical function of the model (box 2) and generating the 
    272260         necessary *.py file.  A separate advanced model editor provides a full Python 
    273          file editor.  Either way once saved the model becomes immediately available 
    274          to the application. 
     261         file editor.  Either way once saved the model becomes immediately available  
     262         to the application.  
    275263       - A batch fitting capability allows for the analysis of a series of data sets to 
    276264         a single model and provides the results in a tabular form suitable for saving 
    277265         or plotting the evolution of the fit parameters with error bars (from within 
    278266         the application). 
    279  
     267  
    280268     - Tools 
    281269       - A scattering length density calculator,including some X-ray information 
     
    287275       - A slit size calculator optimized for Anton Paar Saxess is provided. 
    288276       - A kiessig fringe thickness calculator is provided 
    289  
     277          
    290278     - Plots and plot management 
    291279       - A 3D graphing option (for 2d data/results) is provided with the view 
     
    301289       - Extensive context sensitive plot/fitting/manipulation options are available 
    302290         through a right mouse click pop-up menu on plots. 
    303  
     291            
    304292     - Data management 
    305293       - Supports 2 + column 1D ASCII data, NIST 1D and 2D data, and canSAS data 
    306          via plug-in mechanism which can easily allow other readers as appropriate. 
     294         via plug-in mechanism which can easily allow other readers as appropriate.  
    307295       - 2D data is expected in Q space but for historical reasons accepts the 
    308296         NIST 2D raw pixel format and will do conversion internally. 
     
    310298         right clicking on a data set and choosing Data Info in the DataExplorer 
    311299         or on the plots 
    312        - Supports loading a single file, multiple files, or a whole folder 
     300       - Supports loading a single file, multiple files, or a whole folder    
    313301       - An optional Data Explorer is provided (default) which simplifies managing, 
    314302         plotting, deleting, or setup for computation. Most functions however do 
     
    316304         right click menus and the toolbar.  The data explorer can be re-started 
    317305         from the menu bar. 
    318  
     306            
    319307     - Data manipulation 
    320308       - Support various 2D averaging methods : Circular, sectors, annular, 
     
    322310       - A 2D data maks editor is provided 
    323311       - 2D mask can be applied to the circular averaging. 
    324  
     312          
    325313     - Miscellaneous features 
    326314       - limited reports can be generated in pdf format 
     
    3433312- Downloading and Installing 
    344332============================= 
    345  
     333         
    346334   *** Note 1:  Much more information is available at www.sasview.org under links. 
    347335                    Look in the 'For Developers' section and particularly the wiki at 
     
    382370        - The following modules are required (version numbers are what are used 
    383371          in the windows release build): 
    384  
     372           
    385373          - Common Packages 
    386374            - reportlab 3.1.44 
     
    399387            - html5lib Version Installed: 0.99999 
    400388            - wx Version Installed: 3.0.2.0 
    401  
     389           
    402390          - Windows Specific Packages 
    403391            - pywin 219 
     
    405393            - comtypes 1.1.1 
    406394            - MinGW w/ gcc version 4.6.1 (WIN) 
    407             - vcredist_x86.exe (version 9.0.21022.8  -microsoft visual C 2008 
     395            - vcredist_x86.exe (version 9.0.21022.8  -microsoft visual C 2008  
    408396              re-distributable) 
    409397            - Innosetup (WIN - isetup 5.4.2-unicode) - used to create distributable 
     
    411399            *** Note: Windows build dependencies can be set up using anaconda. Instructions 
    412400                can be found at http://trac.sasview.org/wiki/AnacondaSetup 
    413  
     401             
    414402          - MAC Specifc Packages 
    415403            - py2app 0.7.1 
    416  
     404           
    417405 
    4184063- Known Issues 
     
    424412          equations will render properly. Until then they will show in their 
    425413          original TeX format. 
    426         - If the documentation window remains stubbornly blank, try installing a 
     414        - If the documentation window remains stubbornly blank, try installing a  
    427415          different browser and set that as your default browser. Issues have 
    428416          been noted with Internet Explorer 11. 
    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 
     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  
    432420          website FAQ. 
    433421        - The copy and paste functions (^C, ^V) in the batch mode results grid 
    434422          require two clicks: one to select the cell and a second to select the 
    435           contents of the cell. 
     423          contents of the cell.  
    436424        - The tutorial has not yet been updated and is somewhat out of date 
    437425        - Very old computers may struggle to run the 3.x and later releases 
     
    448436        - The angular distribution angles are not clearly defined and may in 
    449437          some cases lead to incorrect calculations(ticket #332) 
    450  
     438           
    451439   3.2- Windows: 
    452440        - If installed to same directory as old version without first removing 
     
    455443          have the old name even though pointing to the new version.  Usually 
    456444          safest to uninstall old version prior to installing new version anyway. 
    457  
     445                 
    458446   3.3- MAC: 
    459447        - Application normally starts up hidden. Click icon in Dock to view/use 
    460           application. 
     448          application.  
    461449        - Multiprocessing does not currently work on MAC OS 
    462  
     450                 
    463451   3.4- Linux: 
    464452        - Not well tested 
     
    468456================== 
    469457 
    470    - www.sasview.org.  This main project site is the gateway to all 
     458   - www.sasview.org.  This main project site is the gateway to all  
    471459     information about the sasview project.  It includes information 
    472460     about the project, a FAQ page and links to all developer and user 
     
    487475   - Latest developer builds 
    488476     - https://jenkins.esss.dk/sasview/view/Master-Builds/ 
     477 
     478     
  • sasview/__init__.py

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

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

    ra235f715 r80c5d46  
    4545    output = None 
    4646 
    47     def reset_state(self): 
     47    def __init__(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.reset_state() 
     74        self.__init__() 
    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) 
    8689        return self.output 
    8790 
     
    97100        self.lower = 5 
    98101        self.upper = self.lower + self.data_points 
    99         self.source.radiation = 'x-ray' 
    100         normal = float(line4[3]) 
     102        self.detector.distance = float(line4[1]) 
    101103        self.current_dataset.source.radiation = "x-ray" 
    102104        self.current_dataset.source.name = "Anton Paar SAXSess Instrument" 
    103105        self.current_dataset.source.wavelength = float(line4[4]) 
    104         xvals = [] 
    105         yvals = [] 
    106         dyvals = [] 
     106        normal = line4[3] 
    107107        for i in range(self.lower, self.upper): 
    108             index = i - self.lower 
    109108            data = self.raw_data[i].split() 
    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) 
     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) 
    133118        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

    ra235f715 rb699768  
    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) 
    8972        except etree.XMLSyntaxError as xml_error: 
    9073            logging.info(xml_error) 
Note: See TracChangeset for help on using the changeset viewer.