Esempio n. 1
0
    if sensmode == 'main':
        sensdata = allsens_main
    elif sensmode == 'total':
        sensdata = allsens_total

    pars = range(ndim)
    cases = range(nout)

    np.savetxt('allsens_' + sensmode + '.dat', sensdata)

    print '==================================================='
    print "Plotting " + sensmode + " sensitivities across all output QoIs (bar plot)"
    ss.plot_sens(sensdata[outrange],
                 pars,
                 cases,
                 vis="bar",
                 reverse=False,
                 par_labels=pnames,
                 case_labels=outnames,
                 showplot=False)
    os.system('mv sens.eps sens_' + sensmode + '.eps')
    print 'Created file sens_' + sensmode + '.eps'

elif (plotid == 'senscirc'):
    allsens_main, allsens_total, allsens_joint = results['sens']

    print 'Plotting main sand joint sensitivities (circular plots)'
    for i in range(len(outrange)):
        iout = outrange[i]
        print '======== Output # ' + str(
            iout + 1) + ' (QoI ' + outnames[iout] + ') ========='
        ss.plot_senscirc(outnames[iout],
Esempio n. 2
0
    sensmode=args.sensmode
    if sensmode=='main':
        sensdata=allsens_main
    elif sensmode=='total':
        sensdata=allsens_total

    pars=range(ndim)
    cases=range(nout)

    np.savetxt('allsens_'+sensmode+'.dat',sensdata)


    print('===================================================')
    print("Plotting %s sensitivities across all output QoIs (bar plot)" % sensmode)
    ss.plot_sens(sensdata[outrange],pars,cases,vis="bar",reverse=False,par_labels=pnames,case_labels=outnames,ncol=5,grid_show=False, xlbl='', topsens=10, showplot=False)
    os.system('mv sens.eps sens_'+sensmode+'.eps')
    print('Sensitivities are reported in allsens_%s.dat' % sensmode)
    print('Created file sens_%s.eps' % sensmode)

elif(plot_type=='senscirc'):
    allsens_main,allsens_total,allsens_joint=results['sens']


    npar=allsens_main[0].shape[0]
    allsens_main_ave=np.zeros((npar,))
    allsens_joint_ave=np.zeros((npar,npar))
    print('Plotting main sand joint sensitivities (circular plots)')
    for i in range(len(outrange)):
        iout=outrange[i]
        print('======== Output # ',str(iout+1),' (QoI ',outnames[iout],') =========')
Esempio n. 3
0
if outnames_file is not None:
    with open(outnames_file) as f:
        outnames = f.read().splitlines()
else:
    outnames = [str(i) for i in range(1, nout + 1)]

if pnames_file is not None:
    with open(pnames_file) as f:
        pnames = f.read().splitlines()
else:
    pnames = ['Param # ' + str(i) for i in range(1, npar + 1)]

nout_plot = ind_plot.shape[0]

pars = np.arange(npar)
cases = np.arange(nout_plot)
outnames = [outnames[j] for j in ind_plot]

if colors_file is not None:
    colors = np.loadtxt(colors_file)
else:
    colors = []
    # colors = np.random.rand(npar, 3)
    # np.savetxt('colors.txt', colors)


ss.plot_sens(sens[ind_plot], pars, cases, vis="bar", reverse=False, par_labels=pnames,
             case_labels=outnames, ncol=4, legend_show=2, legend_size=26,
             grid_show=False, xlbl='', topsens=8, colors=colors,
             yoffset=-0.05, showplot=False)