Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from yt.mods import *
- pf = load('DD0179/DD0179')
- N = 512 # Pixels (512^2)
- c = (pf.domain_right_edge + pf.domain_left_edge)/2. # Center
- radius = (pf.domain_right_edge - pf.domain_left_edge)/2.
- fov = 180.0
- field='Density'
- mi,ma = pf.h.all_data().quantities['Extrema']('Density')[0]
- mi,ma = np.log10(mi), np.log10(ma)
- # Construct transfer function
- tf = ColorTransferFunction((mi-1, ma+1),nbins=1024)
- # Sample transfer function with Nc gaussians. Use col_bounds keyword to limit
- # the color range to the min and max values, rather than the transfer function
- # bounds.
- Nc = 5
- tf.add_layers(Nc,w=0.005, col_bounds = (mi,ma), alpha=np.logspace(-2,0,Nc),
- colormap='RdBu_r')
- # Create the camera object. Use the keyword: no_ghost=True if a lot of time is
- # spent creating vertex-centered data. In this case I'm running with 8
- # processors, and am splitting the image plane into 4 pieces and using 2
- # processors on each piece.
- cam = FisheyeCamera(c, radius, fov, N,
- transfer_function = tf,
- sub_samples = 5,
- pf=pf)
- # Take a snapshot
- im = cam.snapshot()
- # Save the image
- cam.save_image('figures/fisheye_mosaic.png')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement