from rsf.proj import *
import rsf.recipes.rfield as rfield
real_par = [{},{},{}]
real_par[0] = {'name':'ex1D_', 'nr':3, 'seed':1}
real_par[1] = {'name':'ex2D_', 'nr':3, 'seed':1}
real_par[2] = {'name':'ex3D_', 'nr':3, 'seed':1}
grid_par = [{},{},{}]
grid_par[0] = {'nx':1024, 'ny': 1, 'nz': 1,
'dx': 1, 'dy': 1, 'dz': 1}
grid_par[1] = {'nx':1024, 'ny': 512, 'nz': 1,
'dx': 1, 'dy': 1, 'dz': 1}
grid_par[2] = {'nx': 256, 'ny': 256, 'nz': 16,
'dx': 4, 'dy': 2, 'dz': 16}
covar_par = {'taper_switch':1,
'alpha':1,
'oriu':[ 5,1,0],
'oriv':[-1,5,0],
'oriw':[ 0,0,1],
'ru' :100,
'rv' :20,
'rw' :20}
for i in range(3):
rfield.rfield(real_par[i],grid_par[i],covar_par)
results = ['dist','covar','pspec_real','aspec_real']
plots = range(3)
for i in range(3):
plots[i] = results
for j in range(real_par[i]['nr']):
plots[i] = plots[i] + ['sim_%02d_real' % (j+1)]
plots[i] = map(lambda x: real_par[i]['name']+x,plots[i])
if (grid_par[0]['nx'] > 50):
circles = ''
else:
circles = 'symbol="o" symbolsz=10'
for i in (plots[0]):
Result (i,'graph title="%s" %s label2=""' % (i,circles))
screen_ratio = ( float(grid_par[1]['ny']*grid_par[1]['dy'])
/float(grid_par[1]['nx']*grid_par[1]['dx']) )
screen_height = 10
if (screen_height/screen_ratio > 13):
screen_height = 13*screen_ratio
for i in (plots[1]):
Result (i,
'''
grey title="%s" transp=n yreverse=n
pclip=100 color=E wantscalebar=y gainpanel=a
screenratio=%g screenht=%g
''' % (i,screen_ratio,screen_height)
)
for i in (plots[2]):
Result (i,
'''
transp plane=12 | transp plane=13 | reverse which=1 |
byte bar=bar.rsf gainpanel=all pclip=100 wantscalebar=y |
grey3 title="%s"
color=E movie=0 flat=y scalebar=y bar=bar.rsf
frame1=%d frame2=%d frame3=%d point1=0.5 point2=0.5 > $TARGET &&
rm -f bar.rsf
''' % (i,grid_par[2]['nz']/2-1,
grid_par[2]['nx']/2,
grid_par[2]['ny']/2) , stdout=0
)
End () |