Changeset ed0b796 in sasview
- Timestamp:
- Oct 1, 2016 10:05:16 PM (8 years ago)
- 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. - Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Vagrantfile
r96032b3 r601b93d 21 21 # Every Vagrant development environment requires a box. You can search for 22 22 # 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" 25 24 #config.vm.box = "fedora19" 26 25 #config.vm.box_url = "https://dl.dropboxusercontent.com/u/86066173/fedora-19.box" -
docs/sphinx-docs/source/conf.py
r86eb046 r9a182b2 62 62 version = '4.0' 63 63 # The full version, including alpha/beta/rc tags. 64 release = '4.0 b1'64 release = '4.0.0' 65 65 66 66 # The language for content autogenerated by Sphinx. Refer to documentation -
sasview/README.txt
r86eb046 r9a182b2 4 4 1- Features 5 5 =========== 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 6 18 7 19 - New in Version 4.0 beta 1 … … 14 26 - Old custom models should now still work 15 27 - '''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 17 29 is now the same as the built in models and offers much better 18 30 support. … … 79 91 - New in Version 3.1.2 80 92 -------------------- 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 82 94 that came to light since release 3.1.1. All users should upgrade. 83 95 84 - Fixes bug #468 broken remove constraint buttons in 96 - Fixes bug #468 broken remove constraint buttons in 85 97 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 87 99 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 89 101 in SasView crashing even if left alone. 90 102 - Fixes bug #479 missing help button on simultaneous/constrained fit page … … 110 122 documentation. 111 123 - 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 113 125 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 115 127 below) including rules of thumb on how and when to choose a given 116 128 optimizer and what the parameters do. … … 127 139 - A Nelder-Mead Simplex optimizer 128 140 - A Differential Evolution optimizer 129 - A Monte Carlo optimizer (DREAM) 141 - A Monte Carlo optimizer (DREAM) 130 142 - New models were added: 131 143 - MicelleSphCoreModel (currently residing in the Uncategorized category) … … 136 148 - RectangularHollowPrismInfThinWallsModel 137 149 - 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 139 151 the command line with some caveats. 140 152 - A number of bugs were fixed including a thread crashing issue and an … … 161 173 floating. 162 174 - Five new models have been added: PringlesModel, CoreShellEllipsoidXTModel, 163 RectangularPrismModel, RectangularHollowPrismModel and 175 RectangularPrismModel, RectangularHollowPrismModel and 164 176 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 166 178 information from canSAS file formats. 167 179 - Redefined convention for specifying angular parameters for anisotropic 168 180 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 171 183 addition of a Kratky plot option to the linear plots. 172 184 - A number of bugs have also been fixed. 173 185 - 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 175 187 implemented for some spherical and cylindrical models. 176 188 - 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 182 194 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 185 197 data. Supported formats include: TIFF, TIF, PNG, BMP, JPG. 186 198 … … 210 222 - Added more plot symbols options for 1d plots 211 223 - 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 213 225 depending on the choice of axis scale of the plot) to the linear fits 214 226 - Added more models 215 216 - Feature set from previous versions 227 228 - Feature set from previous versions 217 229 ----------------------------------- 218 230 - Perspectives Available … … 220 232 specific surface area. 221 233 - 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 223 235 analytical model functions 224 236 - Tools: provides a number of useful supplementary tools such as SLD 225 calculation 226 227 - Fitting 237 calculation 238 239 - Fitting 228 240 - Includes a large number of model functions, both form factors and structure factors. 229 241 - Support P(Q)*S(Q) for form factors that flag they can be so multiplied. … … 233 245 - Anisotropic shapes and magnetic moment modeling in 2D allow for a non-uniform 234 246 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. 236 248 - User can choose to weight fits or not. If using weights, the user can choose 237 249 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. 239 251 - Instrumental resolution smearing of model or fits is provided with several 240 252 options: read the resolution/point fromt he file. Input a pinhole resolution … … 249 261 data set or several different sets simultaneously with the application 250 262 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. 253 265 - Models that are the sum of two other models can be easily generated through the 254 266 SUM Model menubar item. … … 259 271 and the mathematical function of the model (box 2) and generating the 260 272 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. 263 275 - A batch fitting capability allows for the analysis of a series of data sets to 264 276 a single model and provides the results in a tabular form suitable for saving 265 277 or plotting the evolution of the fit parameters with error bars (from within 266 278 the application). 267 279 268 280 - Tools 269 281 - A scattering length density calculator,including some X-ray information … … 275 287 - A slit size calculator optimized for Anton Paar Saxess is provided. 276 288 - A kiessig fringe thickness calculator is provided 277 289 278 290 - Plots and plot management 279 291 - A 3D graphing option (for 2d data/results) is provided with the view … … 289 301 - Extensive context sensitive plot/fitting/manipulation options are available 290 302 through a right mouse click pop-up menu on plots. 291 303 292 304 - Data management 293 305 - 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. 295 307 - 2D data is expected in Q space but for historical reasons accepts the 296 308 NIST 2D raw pixel format and will do conversion internally. … … 298 310 right clicking on a data set and choosing Data Info in the DataExplorer 299 311 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 301 313 - An optional Data Explorer is provided (default) which simplifies managing, 302 314 plotting, deleting, or setup for computation. Most functions however do … … 304 316 right click menus and the toolbar. The data explorer can be re-started 305 317 from the menu bar. 306 318 307 319 - Data manipulation 308 320 - Support various 2D averaging methods : Circular, sectors, annular, … … 310 322 - A 2D data maks editor is provided 311 323 - 2D mask can be applied to the circular averaging. 312 324 313 325 - Miscellaneous features 314 326 - limited reports can be generated in pdf format … … 331 343 2- Downloading and Installing 332 344 ============================= 333 345 334 346 *** Note 1: Much more information is available at www.sasview.org under links. 335 347 Look in the 'For Developers' section and particularly the wiki at … … 370 382 - The following modules are required (version numbers are what are used 371 383 in the windows release build): 372 384 373 385 - Common Packages 374 386 - reportlab 3.1.44 … … 387 399 - html5lib Version Installed: 0.99999 388 400 - wx Version Installed: 3.0.2.0 389 401 390 402 - Windows Specific Packages 391 403 - pywin 219 … … 393 405 - comtypes 1.1.1 394 406 - 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 396 408 re-distributable) 397 409 - Innosetup (WIN - isetup 5.4.2-unicode) - used to create distributable … … 399 411 *** Note: Windows build dependencies can be set up using anaconda. Instructions 400 412 can be found at http://trac.sasview.org/wiki/AnacondaSetup 401 413 402 414 - MAC Specifc Packages 403 415 - py2app 0.7.1 404 416 405 417 406 418 3- Known Issues … … 412 424 equations will render properly. Until then they will show in their 413 425 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 415 427 different browser and set that as your default browser. Issues have 416 428 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 420 432 website FAQ. 421 433 - The copy and paste functions (^C, ^V) in the batch mode results grid 422 434 require two clicks: one to select the cell and a second to select the 423 contents of the cell. 435 contents of the cell. 424 436 - The tutorial has not yet been updated and is somewhat out of date 425 437 - Very old computers may struggle to run the 3.x and later releases … … 436 448 - The angular distribution angles are not clearly defined and may in 437 449 some cases lead to incorrect calculations(ticket #332) 438 450 439 451 3.2- Windows: 440 452 - If installed to same directory as old version without first removing … … 443 455 have the old name even though pointing to the new version. Usually 444 456 safest to uninstall old version prior to installing new version anyway. 445 457 446 458 3.3- MAC: 447 459 - Application normally starts up hidden. Click icon in Dock to view/use 448 application. 460 application. 449 461 - Multiprocessing does not currently work on MAC OS 450 462 451 463 3.4- Linux: 452 464 - Not well tested … … 456 468 ================== 457 469 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 459 471 information about the sasview project. It includes information 460 472 about the project, a FAQ page and links to all developer and user … … 475 487 - Latest developer builds 476 488 - https://jenkins.esss.dk/sasview/view/Master-Builds/ 477 478 -
sasview/__init__.py
r4ac4caa r9a182b2 1 __version__ = "4.0 b1"1 __version__ = "4.0" 2 2 __build__ = "GIT_COMMIT" 3 3 try: -
sasview/local_config.py
r9bbc074 re74274ab 35 35 '''Acknowledge its use in your publications as suggested below''' 36 36 _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''' 38 39 _acknowledgement_preamble_bullet3 =\ 39 40 '''Reference the model you used if appropriate (see documentation for refs)''' … … 42 43 _acknowledgement_publications = \ 43 44 '''This work benefited from the use of the SasView application, originally 44 developed under NSF award DMR-0520547. 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. 45 48 ''' 46 49 _acknowledgement = \ 47 50 '''This work originally developed as part of the DANSE project funded by the NSF 48 51 under grant DMR-0520547, and currently maintained by NIST, UMD, ORNL, ISIS, ESS 49 and ILL. 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. 50 55 51 56 ''' -
src/sas/sascalc/dataloader/readers/anton_paar_saxs_reader.py
r80c5d46 ra235f715 45 45 output = None 46 46 47 def __init__(self):47 def reset_state(self): 48 48 self.current_dataset = Data1D(np.empty(0), np.empty(0), 49 49 np.empty(0), np.empty(0)) … … 72 72 73 73 ## Reinitialize the class when loading a new data file to reset all class variables 74 self. __init__()74 self.reset_state() 75 75 ## Check that the file exists 76 76 if os.path.isfile(filename): … … 84 84 self.raw_data = buff.splitlines() 85 85 self.read_data() 86 xml_intermediate = self.raw_data[self.upper:]87 xml = ''.join(xml_intermediate)88 self.set_xml_file(xml)89 86 return self.output 90 87 … … 100 97 self.lower = 5 101 98 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]) 103 101 self.current_dataset.source.radiation = "x-ray" 104 102 self.current_dataset.source.name = "Anton Paar SAXSess Instrument" 105 103 self.current_dataset.source.wavelength = float(line4[4]) 106 normal = line4[3] 104 xvals = [] 105 yvals = [] 106 dyvals = [] 107 107 for i in range(self.lower, self.upper): 108 index = i - self.lower 108 109 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) 118 133 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 70 70 self.xmldoc = etree.parse(self.xml, parser=PARSER) 71 71 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) 72 89 except etree.XMLSyntaxError as xml_error: 73 90 logging.info(xml_error)
Note: See TracChangeset
for help on using the changeset viewer.