Exemple #1
0
def unitPowerBall(ballName, xcen, ycen, zcen,
                     xradius, yradius, zradius,
                     par, needplot, flatplot=False):
    ''' Pwoerball with Gaussian shape, unit maximum magnitude'''
    wplot.param(par) 
    centers = [
        [m.sqrt(3.0), 1.0], [0.0, 2.0], [-m.sqrt(3.0), 1.0],
        [-m.sqrt(3.0), -1.0], [0.0, -2.0], [m.sqrt(3.0), -1.0]]
    centers = map(lambda (x,y): [xcen + x * xradius, ycen + y * xradius], centers)
    xsig = 0.512 * xradius
    ysig = 0.512 * yradius
    zsig = 0.512 * zradius
    ball_list = []
    for i in range(6):
        xcoord = centers[i][0]
        ycoord = centers[i][1]
        zcoord = zcen
        name = ballName +'_%d'%i
        ball_list += [name]
        gauss3d(name, xcoord, ycoord, zcoord, xsig, ysig, zsig, par)
        xframe = xcoord/par['dx']
        yframe = ycoord/par['dy']
        if needplot == True:
            plotstring = wplot.igrey3d('flat=n point1=0.618 point2=0.618 frame2=%d frame3=%d color=j '%(xframe,yframe),par)
            if flatplot: plotstring += ' flat=y '
            Result(name, 'byte pclip=100 gainpanel=a | '+ plotstring)
            # --------- cat plots -----------
            extra = ' wantaxis1=n wantaxis2=n wantaxis3=n '
            if i == 0 or i == 3: extra += ' wantaxis1=y '
            if i == 2 or i == 5: extra += ' wantaxis3=y '
            if i > 2 and i < 6:  extra += ' wantaxis2=y '
            Plot(name, 'byte pclip=100 gainpanel=a | '+ plotstring+extra)
    from rsf.recipes import pplot
    pplot.p1x3(ballName+'_merge_up',ball_list[0],ball_list[1],ball_list[2],1,1,-9.10)
    pplot.p1x3(ballName+'_merge_down',ball_list[3],ball_list[4],ball_list[5],1,1,-9.10)
    pplot.p2x3(ballName+'_merge',
               ball_list[0], ball_list[1], ball_list[2],
               ball_list[3], ball_list[4], ball_list[5],
               0.5,0.5,-6.1,-9.1)
                

    Flow(ballName+'_all', ball_list, 'add ${SOURCES[1:-1]}')
    if needplot == True:
        yframe = centers[5][1] / par['dy']
        plotstring = wplot.igrey3d('flat=n point1=0.618 point2=0.618 frame3=%d color=j '%yframe,par)
        # ratio = (par['nz']*par['dz']+par['oz']) / (par['nx']*par['dx']+par['ox'])
        # heit = 12.0 * ratio
        # plotstring += ' screenratio=%f screenht=%f '%(ratio, heit)
        if flatplot: plotstring += ' flat=y '
        Result(ballName+'_all', 'byte pclip=100 gainpanel=a mean=y | '+plotstring)
    
    if needplot == True:
        yframe = centers[5][1] / par['dy']
        plotstring = wplot.igrey3d('flat=n color=i frame3=%d'%yframe,par)
        if flatplot: plotstring += ' flat=y '
        Plot(ballName+'_all', 'byte pclip=100 gainpanel=a mean=y | '+plotstring)
        Plot('box_source_zSlice_scaled', 'box_source_zSlice','Overlay', vppen='yscale=0.6 xscale=0.6 xcenter=-1.652')
        pplot.p2x1(ballName+'_all_source',
              ballName+'_all' , 'box_source_zSlice_scaled',
               1,1,-1.518)
Exemple #2
0
def plt3x2(par, filename, pltname='', pclip=100, flat=False, needBound=False):
    from copy import deepcopy
    pltpar = deepcopy(par)
    wplot.param(pltpar)
    pltpar['pclip'] = pclip
    boundstr = ''
    if needBound:
        boundstr = ' minval=%(xlb)g maxval=%(xub)g ' % pltpar
    if not pltname:
        pltname = filename
    bytefile = filename + '_byte'
    barfile = filename + '_bar'
    Flow([bytefile, barfile], filename, '''
        byte bar=${TARGETS[1]} gainpanel=a pclip=%(pclip)g mean=n bias=2.3
        ''' % pltpar + boundstr)
    plist = []
    for i in range(6):
        basic = wplot.igrey3d(
            '''
                bar=${SOURCES[1]} bartype=h barwidth=0.256 barmove=n
                color=j flat=n point1=0.618 point2=0.618 mean=n bias=2.3
                ''' + boundstr, pltpar)
        if flat: pltstr += ' flat=y '
        extra = ' wantaxis1=n wantaxis2=n wantaxis3=n '
        if i == 0 or i == 3: extra += ' wantaxis1=y '
        if i == 2 or i == 5: extra += ' wantaxis3=y '
        if i > 2 and i < 6: extra += ' wantaxis2=y '
        pltstr = basic + extra
        plist += [pltname + '_%d' % i]
        Plot(pltname + '_%d' % i, [bytefile, barfile], '''
            window n4=1 f4=%d | ''' % i + pltstr)
    pplot.p2x3(pltname + '_byte', plist[0], plist[1], plist[2], plist[3],
               plist[4], plist[5], 0.5, 0.5, -7.4, -9.2)
    Plot(pltname + '_bar_', [bytefile, barfile], '''
        window n4=1 |''' + pltstr + ' scalebar=y')
    barX = 10.20
    barY = 0.22
    barUnits = "(km\s75 /\s100 s)"
    Plot(
        pltname + '_bar_units', None, '''
            box x0=%g y0=%g label="%s"
                boxit=n pointer=n lab_fat=3 size=0.18
            ''' % (barX, barY, barUnits))
    Plot(pltname + '_bar__',
         pltname + '_bar_',
         'Overlay',
         vppen='ywmin=7.2 yshift=-7.2')
    Plot(pltname + '_bar', [pltname + '_bar__', pltname + '_bar_units'],
         'Overlay')
    Plot(pltname + '_byte_yshift',
         pltname + '_byte',
         'Overlay',
         vppen='ycenter=-1.0')
    pplot.p2x1(pltname + '_noText', pltname + '_byte_yshift', pltname + '_bar',
               1, 1, 0.0)
    addText(pltname, pltname + '_noText', [])
Exemple #3
0
def plots(par):
    Result('icomp', 'imgCC migCC-FFD migCC-F60', 'Movie')
    Result('imgCC', ['imgCC', 'cos'], 'Overlay')

    pplot.p3x2('iCCall', 'migCC-SSF', 'migCC-PSC', 'migCC-FFD', 'migCC-F15',
               'migCC-F45', 'migCC-F60', 0.3, 0.3, -8, -12)
    pplot.p3x2('iRCall', 'migRC-SSF', 'migRC-PSC', 'migRC-FFD', 'migRC-F15',
               'migRC-F45', 'migRC-F60', 0.3, 0.3, -10, -12)

    Plot('imgCC', 'window | transp |' + cgrey('pclip=99', par))
    Plot('imgRC', 'migCC-FFD', '         transp |' + cgrey('pclip=99', par))
    Plot('imgRC-ovl', ['imgRC', 'cos'], 'Overlay')

    pplot.p2x1('CCvsRC', 'imgRC-ovl', 'imgCC', 0.5, 0.5, -9)
Exemple #4
0
def plots(par):
    pplot.p3x2(par['prefix'] + 'iCCall', 'migCC-SSF', 'migCC-PSC', 'migCC-FFD',
               'migCC-F15', 'migCC-F45', 'migCC-F60', 0.3, 0.3, -8, -12)
    pplot.p3x2(par['prefix'] + 'iRCall', 'migRC-SSF', 'migRC-PSC', 'migRC-FFD',
               'migRC-F15', 'migRC-F45', 'migRC-F60', 0.3, 0.3, -10, -12)

    Result(par['prefix'] + 'icomp', ['imgCC', 'migCC-FFD', 'migCC-F60'],
           'Movie')
    Result(par['prefix'] + 'imgCC', ['imgCC', 'cos'], 'Overlay')

    Plot('imgCC', 'window | transp |' + fdmod.cgrey('pclip=100', par))
    Plot('imgRC', 'migCC-FFD',
         '         transp |' + fdmod.cgrey('pclip=100', par))
    Plot('imgRC-ovl', ['imgRC', 'cos'], 'Overlay')
    pplot.p2x1(par['prefix'] + 'CCvsRC', 'imgRC-ovl', 'imgCC', 0.5, 0.5, -9)
Exemple #5
0
def eframe(frame,movie,index,custom,axis,par,xscale=0.75,yscale=0.75,shift=-8.25):

    Flow([movie+'-plt',movie+'-bar'],movie,
         'byte bar=${TARGETS[1]} gainpanel=a pclip=100 %s' % custom)

    for i in range(2):
        Plot(frame+'-'+str(i),movie+'-plt',
             'window n3=1 f3=%d n4=1 f4=%d |' % (i,index)
             + cgrey('',par))
#        Result(frame+'-'+str(i),movie+'-plt',
#             'window n3=1 f3=%d n4=1 f4=%d |' % (i,index)
#             + cgrey('',par))

    if(axis==1):
        pplot.p2x1(frame,frame+'-1',frame+'-0',yscale,xscale,shift)
    else:
        pplot.p1x2(frame,frame+'-0',frame+'-1',yscale,xscale,shift)
Exemple #6
0
def eframe(frame,movie,index,custom,axis,par,xscale=0.75,yscale=0.75,shift=-8.25):

    Flow([movie+'-plt',movie+'-bar'],movie,
         'byte bar=${TARGETS[1]} gainpanel=a pclip=100 %s' % custom)

    for i in range(2):
        Plot(frame+'-'+str(i),movie+'-plt',
             'window n3=1 f3=%d n4=1 f4=%d |' % (i,index)
             + cgrey('',par))
#        Result(frame+'-'+str(i),movie+'-plt',
#             'window n3=1 f3=%d n4=1 f4=%d |' % (i,index)
#             + cgrey('',par))

    if(axis==1):
        pplot.p2x1(frame,frame+'-1',frame+'-0',yscale,xscale,shift)
    else:
        pplot.p1x2(frame,frame+'-0',frame+'-1',yscale,xscale,shift)