Ignore:
Timestamp:
Feb 18, 2016, 4:13:14 PM (9 years ago)
Author:
ldelgass
Message:

Merge UQ and fixes from 1.4 branch

Location:
trunk
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/puq/get_response.py

    r5849 r6021  
    4040    resp = unpickle(resp)
    4141    var = None
     42
    4243    for index, p in enumerate(resp.params):
    4344        if p.name == name:
     
    5051
    5152    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))
    5663
    5764    curve = xml.SubElement(dout, 'curve', {'id': 'response'})
     
    7481        else:
    7582            allpts[:, i] = np.mean(v.pdf.mean)
    76     print("allpts=", allpts)
     83
    7784    pts = resp.evala(allpts)
    78     print("pts=", pts)
    7985    xy = '\n'.join([' '.join(map(repr, a)) for a in zip(x, pts)])
    8086    comp = xml.SubElement(curve, 'component')
     
    8288
    8389    # 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
    9198
    9299
Note: See TracChangeset for help on using the changeset viewer.