Changeset 3290
- Timestamp:
- Feb 19, 2018 10:31:26 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r3288 r3290 7357 7357 mainSizer.Add((-1,10)) 7358 7358 lenmag = len(data[0]['Magnification']) 7359 data[0]['Magnification'] .sort(key=lambda x: x[0])7359 data[0]['Magnification'][1:] = sorted(data[0]['Magnification'][1:],key=lambda x: x[0]) 7360 7360 if lenmag > 1: 7361 7361 panel = wx.StaticBox(G2frame.dataWindow, wx.ID_ANY, 'Magnification regions', -
trunk/GSASIIplot.py
r3288 r3290 1846 1846 ypos = pick.get_ydata() 1847 1847 ind = event.ind 1848 xy = list( zip(np.take(xpos,ind),np.take(ypos,ind))[0])1848 xy = list(list(zip(np.take(xpos,ind),np.take(ypos,ind)))[0]) 1849 1849 # convert from plot units 1850 1850 if G2frame.plotStyle['qPlot']: #qplot - convert back to 2-theta -
trunk/GSASIIscriptable.py
r3270 r3290 240 240 241 241 This table describes the dictionaries supplied to :func:`G2PwdrData.set_refinements` 242 and :func:`G2PwdrData.clear_refinements`. 242 and :func:`G2PwdrData.clear_refinements`. Note that in Instrument Parameters, 243 to save space in the table, related profile parameters (such as U and V) are listed 244 together, separated by commas. 243 245 244 246 .. tabularcolumns:: |l|l|p{3.5in}| … … 252 254 \ low Sets the low limit 253 255 \ high Sets the high limit 256 254 257 Sample Parameters Should be provided as a **list** of subkeys 255 258 to set or clear, e.g. ['DisplaceX', 'Scale'] … … 259 262 \ DisplaceY Sample displacement along the Y direction 260 263 \ Scale Histogram Scale factor 264 261 265 Background Sample background. If value is a boolean, 262 266 the background's 'refine' parameter is set … … 268 272 \ coeffs List of floats, literal values for background 269 273 \ FixedPoints List of (2-theta, intensity) values for fixed points 270 \ fit fixed points If True, triggers a fit to the fixed points to be calculated. It is calculated when this key is detected, regardless of calls to refine. 271 Instrument Parameters As in Sample Paramters, Should be provided as a **list** of subkeys to 274 \ fit fixed points If True, triggers a fit to the fixed points to 275 be calculated. It is calculated when this key is 276 detected, regardless of calls to refine. 277 278 Instrument Parameters As in Sample Paramters, provide as a **list** of 279 subkeys to 272 280 set or clear, e.g. ['X', 'Y', 'Zero', 'SH/L'] 273 \ U, V, W All separate keys. Gaussian peak profile terms 274 \ X, Y Separate keys. Lorentzian peak profile terms 281 \ U, V, W Gaussian peak profile terms 282 \ X, Y, Z Lorentzian peak profile terms 283 \ alpha, beta-0, TOF profile terms 284 beta-1, beta-q, 285 \ sig-0, sig-1, TOF profile terms 286 sig-2, sig-q 287 \ difA, difB, difC TOF Calibration constants 275 288 \ Zero Zero shift 276 \ SH/L 289 \ SH/L Finger-Cox-Jephcoat low-angle peak asymmetry 277 290 \ Polariz. Polarization parameter 278 291 \ Lam Lambda, the incident wavelength … … 1088 1101 >>> # Load an existing project file 1089 1102 >>> proj = G2Project('filename.gpx') 1103 1090 1104 >>> # Create a new project 1091 >>> proj = G2Project(filename='new_file.gpx') 1092 >>> # Specify an author 1093 >>> proj = G2Project(author='Dr. So-And-So', filename='my_data.gpx') 1094 1105 >>> proj = G2Project(newgpx='new_file.gpx') 1106 1095 1107 Histograms can be accessed easily. 1096 1108 1097 1109 >>> # By name 1098 1110 >>> hist = proj.histogram('PWDR my-histogram-name') 1111 1099 1112 >>> # Or by index 1100 1113 >>> hist = proj.histogram(0) 1101 1114 >>> assert hist.id == 0 1115 1102 1116 >>> # Or by random id 1103 1117 >>> assert hist == proj.histogram(hist.ranId) … … 1118 1132 :meth:`~G2Project.iter_refinements`, :meth:`~G2Project.do_refinements`. 1119 1133 """ 1120 def __init__(self, gpxfile=None, author=None, filename=None ):1134 def __init__(self, gpxfile=None, author=None, filename=None, newgpx=None): 1121 1135 """Loads a GSAS-II project from a specified filename. 1122 1136 1123 1137 :param str gpxfile: Existing .gpx file to be loaded. If nonexistent, 1124 1138 creates an empty project. 1125 :param str author: Author's name. Optional. 1126 :param str filename: The filename the project should be saved to in 1127 the future. If both filename and gpxfile are present, the project is 1128 loaded from the gpxfile, then set to save to filename in the future""" 1139 :param str author: Author's name (not yet implemented) 1140 :param str newgpx: The filename the project should be saved to in 1141 the future. If both newgpx and gpxfile are present, the project is 1142 loaded from the gpxfile, then when saved will be written to newgpx. 1143 :param str filename: Name to be used to save the project. Has same function as 1144 parameter newgpx (do not use both gpxfile and filename). Use of newgpx 1145 is preferred over filename. 1146 """ 1147 if filename is not None and newgpx is not None: 1148 raise G2ScriptException('Do not use filename and newgpx together') 1149 elif newgpx is not None: 1150 filename = newgpx 1129 1151 if gpxfile is None: 1130 1152 filename = os.path.abspath(os.path.expanduser(filename)) 1131 1153 self.filename = filename 1132 1154 self.data, self.names = make_empty_project(author=author, filename=filename) 1133 elif isinstance(gpxfile, str): 1134 # TODO set author, filename 1135 self.filename = os.path.abspath(os.path.expanduser(gpxfile)) 1155 elif isinstance(gpxfile, str): # TODO: create replacement for isinstance that checks if path exists 1156 # filename is valid, etc. 1157 if isinstance(filename, str): 1158 self.filename = os.path.abspath(os.path.expanduser(filename)) # both are defined 1159 else: 1160 self.filename = os.path.abspath(os.path.expanduser(gpxfile)) 1161 # TODO set author 1136 1162 self.data, self.names = LoadDictFromProjFile(gpxfile) 1137 1163 self.update_ids() … … 2703 2729 2704 2730 """ 2705 proj = G2Project( filename=args.filename)2731 proj = G2Project(gpxname=args.filename) 2706 2732 2707 2733 hist_objs = []
Note: See TracChangeset
for help on using the changeset viewer.