profile_data[id]['name'] = string.join(l[4:])
                    profile_data[id]['time'] = []
                    profile_data[id]['duration'] = []
                    profile_data[id]['model_t'] = []
                profile_data[id]['time'].append(float(l[0]))
                profile_data[id]['duration'].append(float(l[1]))
                profile_data[id]['model_t'].append(float(l[3]))
    return profile_data


data = read_profile('glide.profile')

plot = PyGMT.Canvas('profile.ps',size='A4')
plot.defaults['LABEL_FONT_SIZE']='12p'
plot.defaults['ANOT_FONT_SIZE']='10p'

area = PyGMT.AutoXY(plot,size=[18.,10.],pos=[0.,4.])
keyarea = PyGMT.KeyArea(plot,size=[18.,2.])
keyarea.num=[4,4]
i = 0
for id in data.keys():
    area.line('-W1/%s'%Colours[i],data[id]['time'], data[id]['duration'])
    keyarea.plot_line(data[id]['name'],'1/%s'%Colours[i])
    i = i+1
area.finalise()
area.xlabel='total elapsed time [CPU time]'
area.ylabel='duration of operation [CPU time]'
area.axis='WeSn'
area.coordsystem()
plot.close()
Пример #2
0
    bigarea = PyGMT.AreaXY(plot,size=[30,30])

    bigarea.text([7.5,2*ysize+3*dy+key_y],"Experiment %s"%exp,textargs='20 0 0 CM')

    area_dome = PyGMT.AutoXY(bigarea,pos=[0.,key_y+dy],size=[15,ysize],logx=True)
    area_dome.xlabel = 'time step [a]'
    area_dome.ylabel = 'dome error [m]'
    area_dome.axis = 'WeSn'

    area_max = PyGMT.AutoXY(bigarea,pos=[0.,ysize+2*dy+key_y],size=[15,ysize],logx=True)
    area_max.xlabel = 'time step [a]'
    area_max.ylabel = 'max error [m]'
    area_max.axis = 'Wesn'

    s_keyarea = PyGMT.KeyArea(bigarea,pos=[0.,-0.8],size=[5,key_y])
    s_keyarea.num=[1,7]

    e_keyarea = PyGMT.KeyArea(bigarea,pos=[5.,-0.8],size=[10.,key_y])
    e_keyarea.num=[2,7]

    styles = {'non-lin':'','lin':'to','ADI':'ta'}
    colours = ['255/0/0','0/255/0','0/0/255','0/255/255','255/0/255','255/255/0','127/0/0','0/127/0','0/0/127','0/127/127','127/0/127','127/127/0']

    done_grid = []
    # loop over solvers
    sn = 0
    for s in verif[exp]:
        # loop over grid sizes
        s_keyarea.plot_line(s,'3/0/0/0%s'%styles[s])
        for g in verif[exp][s]: