Thanks for all your help over the last couple of days. One more question:
- Can I plot particles on a volume rendered image?
I have stars and I want to show where they are!
Elizabeth Harper-Clark MA MSci
PhD Candidate, Canadian Institute for Theoretical Astrophysics, UofT
Sciences and Engineering Coordinator, Teaching Assistants' Training Program,
Astronomy office phone: +1-416-978-5759
Does anyone out there have a technique for getting the variance out of
a profile object? A profile object is good at getting <X> vs. B, I'd
then like to get < (X - <X>)^2 > vs B. Matt and I had spittballed the
possibility some time ago, but I was wondering if anyone out there had
successfully done it.
Sent from my computer.
Can current yt calculate 3-D Mass power spectra? I checked the website but
I didn't find any information. I think calculating 3-D Mass power
spectra is a very useful for cosmological simulations. So I guess maybe yt
supports this function now....?
Thanks in advance
Good morning YT-users,
I'm trying to take derivatives on a 2d dataset, below is what I do and the error I get:
# - - - - - - A SIMPLE TEST TO TRY GETTING A 2D DERIVATIVE - - - - - - - - - -
ds_list = [yt.load('%s/DD%04d/data%04d'%(base_directory,n1,n1)) for n1 in frame_list]
ds = ds_list
g = ds.index.grids
ds.periodicity = (True, True, True)
ad = ds.all_data()
# this is to access the grad operator and the added derived field which are found further below:
# the following line breaks down
# - - - - - - - - - - - - ANOTHER .PY FILE - - - - - - - - - -
iM2 = slice(None,-2)
iP2 = slice(2,None)
all = slice(1,-1)
out = np.zeros_like(data[fieldname])
Right = [all]*3
Left = [all]*3
if data.shape == 1:
Right[direction] = iP2
Left[direction] = iM2
out[all_all] = (data[fieldname][Right] - data[fieldname][Left]) * dxi[direction]
MyValidators = [yt.ValidateSpatial(1,['velocity_x', 'velocity_y','velocity_z'])]
target.add_field('deriv_vx', function=deriv_vx, units='cm/s', validators=MyValidators)
# this is the error: - - - - - - - - - - -
/home/luzlourdes/yt-conda/lib/python2.7/site-packages/yt/units/yt_array.py:1161: VisibleDeprecationWarning: boolean index did not match indexed array along dimension 2; dimension is 4 but corresponding boolean dimension is 1
ret = super(YTArray, self).__getitem__(item)
[ 0. 0. 0. ..., 0. 0. 0.] cm/s
# - - - - - - - - - - - - - - - - - - - - -
May I use your knowledge and help on knowing what is happening and/or how we could go about solving this?
Please let me know if I could provide you with anything further.
Luz Jimenez Vela
Graduate Student at FSU
When I do yt.off_axis_projection(…) I get an array as an output. My question is how I can get an output array for regular projection plots? And does the output array correspond to the actual image that it otherwise would have plotted?
I have recently started using YT to analyze my simulation data from RAMSES.
I would like to plot rotational curves for my simulated galaxy but am not
quite sure how to do it. Is there a specific function in YT to do so? Any
help is greatly appreciated.
I am a newbie in using YT. I read through the documentation of field types
but I still have some confusion in understanding when to use different
field types, as in:
(1) 'io' vs 'all' (from what I understand, both are used for particles but
I don't get the minute difference)
(2) 'ramses' vs 'index' vs 'gas' (fluids described on the grid, I suppose?)
It would be really helpful if someone could provide an elaborate
explanation on these.
I am rather new to yt and have recently tried using the gradient fields
functionality. I'm attempting to write a script which involves basic
calculations with the gradient of the velocity field, however I keep
coming across the same error when assigning the gradient field to a
My current version of yt is 3.3.1 and my version of Python is 2.7.12.
The data dumps I'm reading from were produced by an Enzo cosmology
simulation (version 2.5).
The following code is a simplified version of the script which runs
successfully and outputs a slice plot of the velocity gradient:
from yt import derived_field
ds = yt.load("DD0045/output_0045")
val, loc = ds.find_max('density')
ds.periodicity = (True, True, True)
#grad_x = ds['velocity_x_gradient_x']
plt = yt.SlicePlot(ds, 'z', 'velocity_x_gradient_x', center= loc, width=
However, when I try to assign this gradient field to a variable by
removing the comment and adding the line "grad_x =
ds['velocity_x_gradient_x']" and plotting this instead I come across the
line 352, in __getitem__
P015 yt : [ERROR ] 2018-01-25 10:49:00,443 KeyError:
I am unsure what I am doing wrong here. Any help will be very much
I'm trying to obtain a projection plot of temperature for RAMSES data using:
*plot = yt.ProjectionPlot(ds, "z", "temperature", weight_field=None)*
However, I get a blank plot as attached in the picture below. Could someone
help me figure out what could have gone wrong?