Hi guys, I’m Alex from Hull University.
We’re hosting the UK’s National Astronomy Meeting in July and I’ve been asked to run the hack day.
I’ve managed to procure some VR headsets (HTC Vive, Oculus Rift and MS Hololens) and want to try and see if we could use them for visualising some of our simulation data.
I hear you guys may have been playing with VR, is that true? Is there anything that we could use/play-with at this point?
Thanks
Alex
**************************************************
To view the terms under which this email is
distributed, please go to
http://www2.hull.ac.uk/legal/disclaimer.aspx
**************************************************
Hi all,
I'm trying to use the volume renderer right now, but I'm not getting the
results I'm expecting. I'm trying to plot two fields at once by adding them
independently as VolumeSources, but when I render the image they seem
flipped relative to one another on the x-axis. Everything seems fine when I
plot the fields as slices, so it's something going on in how I'm doing the
volume rendering.
Here's a script that shows what I'm talking about (
https://pastebin.com/ci3u68C9) and the corresponding output (
http://imgur.com/a/JeFkN). I'm using yt version 3.3.5, installed via pip.
Does anyone have any insight? Hopefully I'm just misunderstanding how the
volume renderer works- it's been awhile since I've used it!
Thanks,
--
Hilary Egan
Astrophysical and Planetary Science Department
University of Colorado Boulder
Hi Nathan,
Could you kindly let me know how do you define:
1. sphere (sph object),
2. surface (Surface structure)
It seems me you defined in code unit.
Best Regards,
kazem
Hi people,
I am trying to define curl of a vector field in yt, but first I needed to
see if correct derivatives are taken at the boundary. I am starting with a
mock data set and followed yt tutorial:
import yt
from yt import YTArray
import numpy as np
posx = np.linspace(-1.0,1.0,12)
posy = np.linspace(-1.0,1.0,12)
posz = np.linspace(-1.0,1.0,12)
X, Y, Z = np.meshgrid(posx, posy, posz, indexing='ij') # From gradient
output, yt seems to use ij indexing
psi = X
data_dict = {"psi":(psi,'kg/cm**3'),
"number_of_particles":12,
"particle_position_x":(posx, 'kg/cm**3'),
"particle_position_y":(posy, 'kg/cm**3'),
"particle_position_z":(posz, 'kg/cm**3')}
bbox = np.array([[-1.0, 1.0], [-1.0, 1.0], [-1.0, 1.0]])
y = yt.load_uniform_grid(data_dict,domain_dimensions=(12,12,12),bbox=bbox)
grad_fields = y.add_gradient_fields(("stream","psi"))
ad = y.all_data()
print( ad["psi_gradient_x"] )
print( ad["psi_gradient_y"] )
print( ad["psi_gradient_z"] )
Output:
yt : [INFO ] 2017-05-17 19:40:16,410 Parameters: current_time
= 0.0
yt : [INFO ] 2017-05-17 19:40:16,410 Parameters: domain_dimensions
= [12 12 12]
yt : [INFO ] 2017-05-17 19:40:16,411 Parameters: domain_left_edge
= [-1. -1. -1.]
yt : [INFO ] 2017-05-17 19:40:16,411 Parameters: domain_right_edge
= [ 1. 1. 1.]
yt : [INFO ] 2017-05-17 19:40:16,412 Parameters:
cosmological_simulation = 0.0
[-5.45454545 -5.45454545 -5.45454545 ..., -5.45454545 -5.45454545
-5.45454545] kg/cm**4
[ 0. 0. 0. ..., 0. 0. 0.] kg/cm**4
[ 0. 0. 0. ..., 0. 0. 0.] kg/cm**4
Now my question is, since psi(x,y,z) = x, the gradient should be
(1,0,0)...and it is everywhere except the boundaries of the box. Can you
please explain to me what is going wrong here? I don't
think YT is interpreting the bbox and grid points as I am.
Best
Dear All,
I have a question about calculating the Mdot in yt.
I tried to set some concentric spheres shells with deferent radius and calculate the mdot through them.==>> Mdot vs R
I used an object in yt as:
surf = ds.surface(sph,"radius",r)
where
sph = ds.sphere(cmax, (2, "kpc"))
and r is radius of each shell.
After that I used:
flux = surf.calculate_flux("x-velocity","y-velocity","z-velocity","density")
which calculate the flux density, Mdot.
However it gives the mdot zero which is wrong.
If I set the surfaces as the density iso surface, then I got the mdot as function of density, which it work. However, as a function of radius it fives zero.
Does anyone has idea about this issue? how to fix it?
Best Regards,
kazem
Hi yt-users:
I want to ask you a question about the figures' resolution, I handled
Gadget file -- hdf5.
I used the 'ProjectionPlot' to plot the surface brightness map which is
integrated along the 'z' axis, please see the figure 1; And I plot
another surface brightness map by 'OffAxisProjectionPlot' with the
normal_vector is [0, 0, 1], please see the figure 2.
# I can't upload attachments ??? #
Comparing two figures, we can find the structures of them is same, but
the resolution is different! The 'OffAxisProjectionPlot' is obviously
worse than 'ProjectionPlot', I don't know why!
Below are the process I created two figures:
======================================================================
import yt
import numpy as np
import yt.units as units
import pylab
fname = "snap_206.hdf5"
unit_base = {'UnitLength_in_cm' : 3.08568e+21,
'UnitMass_in_g' : 1.989e+43,
'UnitVelocity_in_cm_per_s' : 100000}
bbox_lim = 1e5 # kpc
bbox = [[-bbox_lim,bbox_lim],
[-bbox_lim,bbox_lim],
[-bbox_lim,bbox_lim]]
ds = yt.load(fname,unit_base=unit_base,bounding_box=bbox)
ds.index
ad= ds.all_data()
## For 'ProjectionPlot' ##
pz = yt.ProjectionPlot(ds, 'z', ('gas', 'surface_brightness'), 'max',
width=(0.4,'Mpc'))
## For 'OffAxisProjectionPlot' ##
L = [0,0,1]
north_vector = [0,1,0]
pz = yt.OffAxisProjectionPlot(ds, L, ('gas', 'surface_brightness'),
'max', north_vector = north_vector, width=(0.4,'Mpc'))
pz.set_buff_size((3200,3200))
pz.save()
=========================================================================
What can i do to fix this difference of resolution between two plot ways?
Thanks a lot!
Regards,
Dan
==================================
Department of Physics, Shanghai Jiao Tong University
800 Dongchuan Road, Minhang, Shanghai 200240, PRC
E-mail : hudan_bazhaoyu(a)163.com
hudan_bazhaoyu(a)sjtu.edu.cn
==================================
Hi people,
I am trying to define curl of a vector field in yt, but first I needed to
see if correct derivatives are taken at the boundary. I am starting with a
mock data set and followed yt tutorial:
import yt
from yt import YTArray
import numpy as np
posx = np.linspace(-1.0,1.0,12)
posy = np.linspace(-1.0,1.0,12)
posz = np.linspace(-1.0,1.0,12)
X, Y, Z = np.meshgrid(posx, posy, posz, indexing='ij') # From gradient
output, yt seems to use ij indexing
psi = X
data_dict = {"psi":(psi,'kg/cm**3'),
"number_of_particles":12,
"particle_position_x":(posx, 'kg/cm**3'),
"particle_position_y":(posy, 'kg/cm**3'),
"particle_position_z":(posz, 'kg/cm**3')}
bbox = np.array([[-1.0, 1.0], [-1.0, 1.0], [-1.0, 1.0]])
y = yt.load_uniform_grid(data_dict,domain_dimensions=(12,12,12),bbox=bbox)
grad_fields = y.add_gradient_fields(("stream","psi"))
ad = y.all_data()
print( ad["psi_gradient_x"] )
print( ad["psi_gradient_y"] )
print( ad["psi_gradient_z"] )
Output:
yt : [INFO ] 2017-05-17 19:40:16,410 Parameters: current_time
= 0.0
yt : [INFO ] 2017-05-17 19:40:16,410 Parameters: domain_dimensions
= [12 12 12]
yt : [INFO ] 2017-05-17 19:40:16,411 Parameters: domain_left_edge
= [-1. -1. -1.]
yt : [INFO ] 2017-05-17 19:40:16,411 Parameters: domain_right_edge
= [ 1. 1. 1.]
yt : [INFO ] 2017-05-17 19:40:16,412 Parameters:
cosmological_simulation = 0.0
[-5.45454545 -5.45454545 -5.45454545 ..., -5.45454545 -5.45454545
-5.45454545] kg/cm**4
[ 0. 0. 0. ..., 0. 0. 0.] kg/cm**4
[ 0. 0. 0. ..., 0. 0. 0.] kg/cm**4
Now my question is, since psi(x,y,z) = x, the gradient should be
(1,0,0)...and it is everywhere except the boundaries of the box. Can you
please explain to me what is going wrong here? I don't
think YT is interpreting the bbox and grid points as I am.
Best