mag_enuc_sigma  = 0.1

tfh = TransferFunctionHelper(ds)
tfh.set_field('pos_enucdot')
mag_enuc_bounds = np.array([10.0**-(pos_maxv-3), 10.0**pos_maxv])
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_enuc_bounds)
tfh.build_transfer_function()
nlayers = 10
tfh.tf.add_layers(nlayers, colormap='PiYG', w=mag_enuc_sigma**2, mi=pos_maxv-nlayers+1, ma=pos_maxv, alpha=np.logspace(-2,0,nlayers))
try:
    tfh.plot('{}_tfun_pos_enucdot.png'.format(args.infile))
except:
    print('could not plot pos_enucdot transfer function.')
so_pos_enuc.transfer_function = tfh.tf

tfh = TransferFunctionHelper(ds)
tfh.set_field('neg_enucdot')
mag_enuc_bounds = np.array([10.0**-(neg_maxv-3), 10.0**neg_maxv])
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_enuc_bounds)
tfh.build_transfer_function()
nlayers = 10
tfh.tf.add_layers(nlayers, colormap='PiYG_r', w=mag_enuc_sigma**2, mi=neg_maxv-nlayers+1, ma=neg_maxv, alpha=rat_neg_pos*np.logspace(-2,0,nlayers))
try:
    tfh.plot('{}_tfun_neg_enucdot.png'.format(args.infile))
except:
    print('could not plot neg_enucdot transfer function.')
so_neg_enuc.transfer_function = tfh.tf
Exemple #2
0
nlayers = args.num_layers
if args.alpha_ones:
    alphavec = np.ones(nlayers)
else:
    alphavec = np.logspace(-3, 0, num=nlayers, endpoint=True)

tfh = TransferFunctionHelper(ds)
tfh.set_field(field)
print(field)
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(nlayers, colormap=args.colormap, w=sigma**2, alpha=alphavec)
tfh.plot('{}_tfun_{}.png'.format(args.infile, field_short_name))
so.transfer_function = tfh.tf

if args.dry_run:
    exit()

# Add sources to scene
sc.add_source(so)

# Add camera to scene
sc.add_camera()

# Set camera properties
sc.camera.focus = ds.domain_center
sc.camera.resolution = args.resolution
sc.camera.north_vector = yt.YTArray(args.camera_north, 'cm')
sc.camera.position = ds.domain_center + yt.YTArray(args.camera_position,
# tfh_en.plot('{}_tfun_enuc.png'.format(args.infile), profile_field=('boxlib','enucdot'))
# so_enuc.transfer_function = tfh_en.tf

mag_vel_bounds = np.array([1.0e4, 1.0e6])
mag_vel_sigma  = 0.08

tfh = TransferFunctionHelper(ds)
tfh.set_field('pos_radial_velocity')
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_vel_bounds)
tfh.build_transfer_function()
nlayers = 3
tfh.tf.add_layers(nlayers, colormap='Blues', w=mag_vel_sigma**2, mi=4, ma=6, alpha=np.logspace(-2,0,nlayers))
tfh.plot('{}_tfun_pos_vrad.png'.format(args.infile))
so_pos_vrad.transfer_function = tfh.tf

tfh = TransferFunctionHelper(ds)
tfh.set_field('neg_radial_velocity')
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_vel_bounds)
tfh.build_transfer_function()
nlayers = 3
tfh.tf.add_layers(nlayers, colormap='Reds', w=mag_vel_sigma**2, mi=4, ma=6, alpha=np.logspace(-2,0,nlayers))
tfh.plot('{}_tfun_neg_vrad.png'.format(args.infile))
so_neg_vrad.transfer_function = tfh.tf

# Add sources to scene
#sc.add_source(so_enuc)
sc.add_source(so_pos_vrad)
nlayers = 6
if args.alpha_ones:
    alphavec = np.ones(nlayers)
else:
    alphavec = np.logspace(-5,0,nlayers)

tfh = TransferFunctionHelper(ds)
tfh.set_field(('boxlib', 'circum_velocity'))
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_vel_bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(nlayers, colormap='viridis', w=mag_vel_sigma**2, mi=1, ma=6, alpha=alphavec)
tfh.plot('{}_tfun_circum_vel.png'.format(args.infile))
so_circum_vel.transfer_function = tfh.tf

# Add sources to scene
sc.add_source(so_circum_vel)

# Add camera to scene
sc.add_camera()

# Set camera properties
sc.camera.focus = ds.domain_center
sc.camera.resolution = args.resolution
sc.camera.north_vector = [0, 0, 1]
sc.camera.position = ds.domain_center + [1.0, 1.0, 1.0] * ds.domain_width * args.rup/5.12e8
sc.camera.zoom(2.5*args.zoom)

# Annotate domain - draw boundaries
Exemple #5
0
    alphavec = np.logspace(-5, 0, nlayers)

tfh = TransferFunctionHelper(ds)
tfh.set_field(('boxlib', 'circum_velocity'))
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_vel_bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(nlayers,
                  colormap='viridis',
                  w=mag_vel_sigma**2,
                  mi=1,
                  ma=6,
                  alpha=alphavec)
tfh.plot('{}_tfun_circum_vel.png'.format(args.infile))
so_circum_vel.transfer_function = tfh.tf

# Add sources to scene
sc.add_source(so_circum_vel)

# Add camera to scene
sc.add_camera()

# Set camera properties
sc.camera.focus = ds.domain_center
sc.camera.resolution = args.resolution
sc.camera.north_vector = [0, 0, 1]
sc.camera.position = ds.domain_center + [
    1.0, 1.0, 1.0
] * ds.domain_width * args.rup / 5.12e8
sc.camera.zoom(2.5 * args.zoom)
Exemple #6
0
nlayers = args.num_layers
if args.alpha_ones:
    alphavec = np.ones(nlayers)
else:
    alphavec = np.logspace(-3, 0, num=nlayers, endpoint=True)

tfh = TransferFunctionHelper(ds)
tfh.set_field('abs_ye_asymmetry')
tfh.set_log(False)
tfh.grey_opacity = False
tfh.set_bounds(bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(nlayers, colormap='octarine', w=sigma**2, alpha=alphavec)
#tfh.plot('{}_tfun_ye_asym.png'.format(args.infile))
so.transfer_function = tfh.tf

if args.dry_run:
    exit()

# Add sources to scene
sc.add_source(so)

# Add camera to scene
sc.add_camera()

# Set camera properties
sc.camera.focus = ds.domain_center
sc.camera.resolution = args.resolution
sc.camera.north_vector = yt.YTArray(args.camera_north, 'cm')
sc.camera.position = ds.domain_center + yt.YTArray(args.camera_position, 'cm') * args.rup
Exemple #7
0
    alphavec = np.logspace(-3, 0, num=nlayers, endpoint=True)

tfh = TransferFunctionHelper(ds)
tfh.set_field('pos_radial_velocity')
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_vel_bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(nlayers,
                  colormap='Blues',
                  w=mag_vel_sigma**2,
                  mi=log_min,
                  ma=log_max,
                  alpha=alphavec)
tfh.plot('{}_tfun_pos_vrad.png'.format(args.infile))
so_pos_vrad.transfer_function = tfh.tf

tfh = TransferFunctionHelper(ds)
tfh.set_field('neg_radial_velocity')
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_vel_bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(nlayers,
                  colormap='Reds',
                  w=mag_vel_sigma**2,
                  mi=log_min,
                  ma=log_max,
                  alpha=alphavec)
tfh.plot('{}_tfun_neg_vrad.png'.format(args.infile))
so_neg_vrad.transfer_function = tfh.tf
else:
    alphavec = np.logspace(-2,0,args.num_layers)

tfh = TransferFunctionHelper(ds)
tfh.set_field('pos_enucdot')
mag_enuc_bounds = np.array([10.0**(pos_maxv-2*(pos_maxv-pos_minv)-3), 10.0**pos_maxv])
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_enuc_bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(args.num_layers, colormap='PiYG', w=mag_enuc_sigma**2, mi=pos_minv, ma=pos_maxv, alpha=alphavec)
try:
    tfh.plot('{}_tfun_pos_enucdot.png'.format(args.infile))
except:
    print('could not plot pos_enucdot transfer function.')
so_pos_enuc.transfer_function = tfh.tf

tfh = TransferFunctionHelper(ds)
tfh.set_field('neg_enucdot')
mag_enuc_bounds = np.array([10.0**(neg_maxv-2*(neg_maxv-neg_minv)-3), 10.0**neg_maxv])
tfh.set_log(True)
tfh.grey_opacity = False
tfh.set_bounds(mag_enuc_bounds)
tfh.build_transfer_function()
tfh.tf.add_layers(args.num_layers, colormap='PiYG_r', w=mag_enuc_sigma**2, mi=neg_minv, ma=neg_maxv, alpha=rat_neg_pos*alphavec)
try:
    tfh.plot('{}_tfun_neg_enucdot.png'.format(args.infile))
except:
    print('could not plot neg_enucdot transfer function.')
so_neg_enuc.transfer_function = tfh.tf