Changeset 6021 for trunk/puq/get_response.py
- Timestamp:
- Feb 18, 2016, 4:13:14 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
-
trunk/puq/get_response.py
r5849 r6021 40 40 resp = unpickle(resp) 41 41 var = None 42 42 43 for index, p in enumerate(resp.params): 43 44 if p.name == name: … … 50 51 51 52 data = resp.data 52 print ("vars=", resp.vars) 53 print("data=", data) 54 print("my data=", data.T[index]) 55 print("my data=", data[:, index]) 53 print('data=', repr(data)) 54 for ind, p in enumerate(resp.params): 55 if ind == index: 56 continue 57 m = p.pdf.mean 58 means = np.isclose(m, data[:, ind], rtol=1e-6, atol=1e-12) 59 data = data[means] 60 61 print("vars=", resp.vars) 62 print("data=", repr(data)) 56 63 57 64 curve = xml.SubElement(dout, 'curve', {'id': 'response'}) … … 74 81 else: 75 82 allpts[:, i] = np.mean(v.pdf.mean) 76 print("allpts=", allpts) 83 77 84 pts = resp.evala(allpts) 78 print("pts=", pts)79 85 xy = '\n'.join([' '.join(map(repr, a)) for a in zip(x, pts)]) 80 86 comp = xml.SubElement(curve, 'component') … … 82 88 83 89 # scatter plot sampled data on response surface 84 # curve = io['output.curve(response-%s-scatter)' % name] 85 # curve['about.label'] = 'Data Points' 86 # curve['about.group'] = title 87 # curve['about.type'] = 'scatter' 88 # curve['xaxis.label'] = varlist[0] 89 # curve['yaxis.label'] = tname 90 # curve['component.xy'] = (xdata, ydata) 90 curve = xml.SubElement(dout, 'curve', {'id': 'scatter'}) 91 about = xml.SubElement(curve, 'about') 92 xml.SubElement(about, 'label').text = 'Data Points' 93 xml.SubElement(about, 'group').text = rlabel 94 xml.SubElement(about, 'type').text = 'scatter' 95 comp = xml.SubElement(curve, 'component') 96 xy = '\n'.join([' '.join(map(repr, a)) for a in zip(data[:, index], data[:, -1])]) 97 xml.SubElement(comp, 'xy').text = xy 91 98 92 99
Note: See TracChangeset
for help on using the changeset viewer.