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
Is there any possible way to modify a (non-derived) field in a Gadget Binary Dataset and update the computation of the derived (in particular, deposited) fields to reflect this change?
For example, I would like to substract a fixed velocity from all Gas particles (as to account for the Sun's velocity) and recalculate the smoothed velocity fields accordingly.
As a reference, modifying the in-disk fields the following way works, but has no effect on the derived_fields:
ds = yt.load('path/to/dataset', unit_base = unit_base)
for i in range(num_particles):
ds.r['Gas', 'Velocities'][i] -= ds.arr([100,100,100], 'code_velocity') #substracting some fixed array
Any help would be very much appreciated.
Thanks is advance (and happy holidays!)
Is there a way I could know what refinement level yt is accessing my data?
For e.g., I plot 1D profiles of density
for ds in ts:
ds.define_unit("H", (1.674*10**(-24), "g"))
dens=ad.cut_region(["obj[('gas','density')].in_units('H/cm**3') > 0"
> profiles.append(yt.create_profile(ad, ("gas","density"), [("gas",
> "cell_mass")], weight_field=None, fractional=True))
My data has highest refinement level of 15 from simulations. However, I'm
not sure if this is the same level at which the profiles are being plotted
We’re proud to announce the first release of the yt-widgets package,
widgyts, which is a growing collection of Jupyter widgets for use in yt.
The package is on PyPI so you can install it with:
pip install widgyts
This package was designed so that you can interactively explore your data
with the goal of making data exploration more accessible to yt users. You
can pan, zoom, and update view parameters (like the colormap or the
colormap bounds) quickly and learn where interesting features of your data
are. We’ve uploaded a couple of demonstration notebooks to give you a feel
of the widget, one with IsolatedGalaxy and the others with slices and
projections (made using yt) of Britton’s Pop II Prime dataset (thanks for
making this dataset available Britton!). You can experiment and play around
with the notebooks on the yt hub
<https://girder.hub.yt/#raft/5c1ab9f5323d12000134e095>. Alternatively, you
can watch <https://www.youtube.com/watch?v=5dl_m_6T2bU> or look at the
slides <https://munkm.github.io/2018-07-13-scipy/> from Madicken’s talk at
SciPy 2018 about the initial stages of this project.
At present, widgyts consists of a few components. The foundational widget
is that of a variable-mesh image viewer, using Rust compiled to
WebAssembly. The WebAssembly code is used to do the most
performant-limiting calculations in the widget, resulting in much higher
little bit more about WebAssembly here
<https://developer.mozilla.org/en-US/docs/WebAssembly> and here
you’d like to learn more about it. Widgyts also currently has a widget that
quickly converts data arrays to rgba colormapped arrays, and a tool to set
up a standard set of widget controls.
This should work in all major browsers in the Jupyter notebook; at present
Jupyterlab does not have support for easy distribution of wasm binaries.
When able, we will build out support for this widget with Jupyterlab.
We’d like to thank the hard work done on other projects to make the
development of widgyts possible. In particular, we’d like to thank the
Jupyter team and the developers of ipywidgets. We’d also like to thank the
rust core team and the wasm-pack developers for their awesome platforms.
Thanks for reading! If you’d like to give us any feedback on the widget,
please don’t hesitate to reach out via e-mail, slack, or in either the rust
<https://github.com/data-exp-lab/rust-yt-tools> or the widgyts
Madicken Munk, Matthew Turk, and Nathanael Claussen
I referred to the relevant part of the documentation about FLASH particle data on,
and managed to post process a series of data files that have just 1 single particle in it.
When I used multiple particles in the simulation,
at the step where we do the following,
ds = yt.load(my_fns)
dd = ds.all_data()
indices = dd["particle_index"].astype("int")
I got the following error:
~/.local/lib/python3.6/site-packages/yt/frontends/flash/io.py in <listcomp>(.0)
171 self._particle_fields = determine_particle_fields(self._handle)
172 self._position_fields = [self._particle_fields["particle_pos%s" % ax]
--> 173 for ax in 'xyz']
174 self._chunksize = 32**3
I am new to YT in general and facing a difficulty in understanding what's the problem. As per the documentation, the syntax should work for multiple particles. Do you think that it could be FLASH issue? What are the ways you would go about debugging it? Thanks.
I'm trying to run Rockstar Halo Finder using yt 3.5.0 and Enzo 2.5 but I
keep getting an error whenever I run it saying it can't import name
rockstar interface? Full transcript of the error is below:
Traceback (most recent call last):
File "rockstar.py", line 4, in <module>
from yt.analysis_modules.halo_finding.rockstar.api import
line 16, in <module>
from .rockstar import RockstarHaloFinder
line 26, in <module>
from . import rockstar_interface
ImportError: cannot import name rockstar_interface
I have what is probably quite a basic problem to solve, however I am not very experienced using yt and have only managed basic density and temperature plots. I am having issues plotting metallicity, using this script:
from yt import *
for i in range(1,len(sys.argv)):
ds = load(sys.argv[i])
#val, loc = ds.find_max("density")
#plot = SlicePlot(ds, 2, ["density","Temperature"]
plot = SlicePlot(ds, 2, ("metallicity_fraction"), center= [0.4913024902343750, 0.5008239746093750, 0.4982604980468750], width= (10, 'kpc'))
#plot = SlicePlot(ds, 'z', ('all', metallicity),center=[0.4913024902343750, 0.5008239746093750, 0.4982604980468750],width = (10,'kpc'))
#plot.set_zlim('all', 1e1, 1e5)
plot.annotate_timestamp(corner='upper_left', redshift=True, draw_inset_box=True)
This script works fine when for plotting density and temperature but I get this error when using the un-commented line above: "_MPL.error: data is of incorrect type (wanted 1D float)"
I've been trying to get this to work for a while now so any help would be greatly appreciated.
I am trying to create a filter for the field and apply it to a data in the
def density_threshold(field, data):
> dens=data["gas", "density"].in_units('H/cm**3')
> dens[dens < 50] = 0
> return dens
> ds.add_field(name=("gas", "density_threshold"),
> function=density_threshold, units="H/cm**3")
> "kpc"),((com_y_1.value-1), "kpc"):((com_y_1.value+1), "kpc"),:]
But cannot find the field:
Traceback (most recent call last):
File "inflows-dense.py", line 68, in <module>
line 274, in __getitem__
f = self._determine_fields([key])
line 1121, in _determine_fields
finfo = self.ds._get_field_info(ftype, fname)
line 753, in _get_field_info
raise YTFieldNotFound((ftype, fname), self)
> yt.utilities.exceptions.YTFieldNotFound: Could not find field
> '('density_threshold', 'cell_mass')' in info_00019.
Is this not how the field data is to be accessed? Thanks in advance