Пример #1
0
 ]
 dfSrf = DATA[ks]
 if dfSrf.shape[0] < 4:
     continue
 ###########################################################################
 # Generate Surface
 ###########################################################################
 (x, y, z) = (dfSrf[HD_IND[0]], dfSrf[HD_IND[1]], dfSrf[MOI])
 scalers = [1, 1, 1]  # max(x), 1, 1] # max(y), 1]
 (xLogMin, yLogMin) = (min([i for i in sorted(list(x.unique())) if i > 0]),
                       min([i for i in sorted(list(y.unique())) if i > 0]))
 rs = monet.calcResponseSurface(x,
                                y,
                                z,
                                scalers=scalers,
                                mthd=mthd,
                                xAxis=xSca,
                                yAxis=ySca,
                                xLogMin=xLogMin,
                                yLogMin=yLogMin,
                                DXY=(ngdx, ngdy))
 # Get ranges --------------------------------------------------------------
 (a, b) = ((min(x), max(x)), (min(y), max(y)))
 (ran, rsG, rsS) = (rs['ranges'], rs['grid'], rs['surface'])
 ###########################################################################
 # Plot
 ###########################################################################
 (fig, ax) = plt.subplots(figsize=(10, 8))
 # Experiment points, contour lines, response surface ----------------------
 xy = ax.plot(rsG[0], rsG[1], 'k.', ms=2.5, alpha=.25, marker='.')
 cc = ax.contour(rsS[0],
                 rsS[1],
Пример #2
0
 print('* Exporting {}/{}'.format(xpNumCS, xpNumS), end='\r')
 ###################################################################
 # Filter
 ###################################################################
 indepFltrs = [list(df[hId[1]] == hId[0]) for hId in zip(xpId, hdFree)]
 fullFilter = list(map(all, zip(*indepFltrs)))
 dfSrf = df[fullFilter]
 ###################################################################
 # Plot
 ###################################################################
 # Prepare the response surface ------------------------------------
 (x, y, z) = (dfSrf[HD_IND[0]], dfSrf[HD_IND[1]], dfSrf[HD_DEP])
 # if moi == 'MNX':
 #     z = [i for i in z]
 #     print(list(z))
 rs = monet.calcResponseSurface(x, y, z, scalers=scalers, mthd=mthd)
 (rsG, rsS) = (rs['grid'], rs['surface'])
 # Plot the response surface ---------------------------------------
 fig, ax = plt.subplots()
 # Experiment points, contour lines, response surface
 xy = ax.plot(rsG[0], rsG[1], 'k.', ms=3, alpha=.25, marker='.')
 cc = ax.contour(rsS[0], rsS[1], rsS[2], levels=lvls, colors='w', lw=1, alpha=.5)
 cs = ax.contourf(rsS[0], rsS[1], rsS[2], levels=lvls, cmap=cmap, extend='max')
 # Figure Modifiers ------------------------------------------------
 sz = fig.get_size_inches()[0]
 fig.set_size_inches(sz, .85*sz)
 ax.set_xscale(xSca)
 ax.set_yscale(ySca)
 # Colorbar
 cbar = fig.colorbar(cs)
 cbar.ax.get_yaxis().labelpad = 25