Changeset 82d88d5 in sasview for src/sas/sasgui/perspectives/corfunc
- Timestamp:
- Mar 6, 2019 4:18:09 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
- Children:
- f923967
- Parents:
- cb64d86 (diff), f205d3a (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. - Location:
- src/sas/sasgui/perspectives/corfunc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/corfunc/corfunc_panel.py
r5251ec6 r82d88d5 277 277 self._transformed_data = transforms 278 278 (transform1, transform3, idf) = transforms 279 plot_x = transform1.x[transform1.x <= 200]280 plot_y = transform1.y[transform1.x <= 200]279 plot_x = transform1.x[transform1.x <= 1000] 280 plot_y = transform1.y[transform1.x <= 1000] 281 281 self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL1) 282 # No need to shorten gamma3 as it's only calculated up to x= 200282 # No need to shorten gamma3 as it's only calculated up to x=1000 283 283 self._manager.show_data(transform3, TRANSFORM_LABEL3) 284 284 285 plot_x = idf.x[idf.x <= 200]286 plot_y = idf.y[idf.x <= 200]285 plot_x = idf.x[idf.x <= 1000] 286 plot_y = idf.y[idf.x <= 1000] 287 287 self._manager.show_data(Data1D(plot_x, plot_y), IDF_LABEL) 288 288 -
src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst
r490f790 r4d06668 30 30 of the profile provides measures of the layer thickness, and the area under 31 31 the profile is related to the amount of material that is adsorbed. 32 33 .. note:: 34 These transforms assume that the data has been measured on a pinhole- 35 collimated instrument or, if not, that the data has been Lorentz- 36 corrected beforehand. 32 37 33 38 Both analyses are performed in 3 stages: -
src/sas/sasgui/perspectives/corfunc/__init__.py
rc23f303 r5251ec6 1 1 PLUGIN_ID = "Corfunc Plug-In 0.1" 2 from corfunc import *2 from .corfunc import * -
src/sas/sasgui/perspectives/corfunc/corfunc.py
r9b90bf8 r5251ec6 18 18 from sas.sascalc.dataloader.loader import Loader 19 19 import sas.sascalc.dataloader 20 from plot_labels import *20 from .plot_labels import * 21 21 22 22 logger = logging.getLogger(__name__) … … 148 148 self.data_id = data.id 149 149 self.corfunc_panel.set_data(data) 150 except :151 msg = "Corfunc set_data: " + str( sys.exc_value)150 except Exception as exc: 151 msg = "Corfunc set_data: " + str(exc) 152 152 wx.PostEvent(self.parent, StatusEvent(status=msg, 153 153 info='error')) -
src/sas/sasgui/perspectives/corfunc/corfunc_state.py
r5652efc r5251ec6 74 74 if self.outputs != {} and self.outputs is not None: 75 75 state += "\nOutputs:\n" 76 for key, value in self.outputs.ite ritems():76 for key, value in self.outputs.items(): 77 77 name = output_list[key][1] 78 78 state += "{}: {}\n".format(name, str(value)) … … 158 158 state = new_doc.createElement("state") 159 159 top_element.appendChild(state) 160 for name, value in self.saved_state.ite ritems():160 for name, value in self.saved_state.items(): 161 161 element = new_doc.createElement(name) 162 162 element.appendChild(new_doc.createTextNode(str(value))) … … 181 181 output = new_doc.createElement("output") 182 182 top_element.appendChild(output) 183 for key, value in self.outputs.ite ritems():183 for key, value in self.outputs.items(): 184 184 element = new_doc.createElement(key) 185 185 element.appendChild(new_doc.createTextNode(str(value))) … … 214 214 try: 215 215 self.timestamp = (entry.get('epoch')) 216 except :216 except Exception as exc: 217 217 msg = ("CorfuncState.fromXML: Could not read timestamp", 218 "\n{}").format( sys.exc_value)218 "\n{}").format(exc) 219 219 logger.error(msg) 220 220 … … 222 222 entry = get_content('ns:state', node) 223 223 if entry is not None: 224 for item in DEFAULT_STATE. iterkeys():224 for item in DEFAULT_STATE.keys(): 225 225 input_field = get_content("ns:{}".format(item), entry) 226 226 if input_field is not None: … … 283 283 root, ext = os.path.splitext(basename) 284 284 if not ext.lower() in self.ext: 285 raise IOError , "{} is not a supported file type".format(ext)285 raise IOError("{} is not a supported file type".format(ext)) 286 286 tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 287 287 root = tree.getroot() … … 299 299 # File not found 300 300 msg = "{} is not a valid file path or doesn't exist".format(path) 301 raise IOError , msg301 raise IOError(msg) 302 302 303 303 if len(output) == 0: … … 323 323 msg = ("The CanSAS writer expects a Data1D instance. {} was " 324 324 "provided").format(datainfo.__class__.__name__) 325 raise RuntimeError , msg325 raise RuntimeError(msg) 326 326 if datainfo.title is None or datainfo.title == '': 327 327 datainfo.title = datainfo.name … … 358 358 state = CorfuncState() 359 359 state.fromXML(nodes[0]) 360 except :360 except Exception as exc: 361 361 msg = "XML document does not contain CorfuncState information\n{}" 362 msg.format( sys.exc_value)362 msg.format(exc) 363 363 logger.info(msg) 364 364 return state
Note: See TracChangeset
for help on using the changeset viewer.