Hi all!
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!)
Martin

Is there a way I could know what refinement level yt is accessing my data?
For e.g., I plot 1D profiles of density
> ts=yt.load([
> "/lunarc/nobackup/users/samvad/FINAL-50-0.5/output/output_00029/info_00029.txt"
> ,
> "/lunarc/nobackup/users/samvad/FINAL-50-0.5/output/output_00037/info_00037.txt"
> ,
> "/lunarc/nobackup/users/samvad/FINAL-50-0.5/output/output_00042/info_00042.txt"
> ])
>
for ds in ts:
ds.define_unit("H", (1.674*10**(-24), "g"))
ad=ds.all_data()
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

Hi all,
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
framerates than pure javascript rendering. Because WebAssembly was designed
to interface with javascript, widget features can be built out using
standard Python/javascript aspects of Jupyter widgets. You can read a
little bit more about WebAssembly here
<https://developer.mozilla.org/en-US/docs/WebAssembly> and here
<https://medium.com/javascript-scene/what-is-webassembly-the-dawn-of-a-new...>
if
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
<https://github.com/data-exp-lab/widgyts> repository.
Madicken Munk, Matthew Turk, and Nathanael Claussen

Hi,
I referred to the relevant part of the documentation about FLASH particle data on,
http://yt-project.org/doc/analyzing/particle_trajectories.html
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[0])
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
175
KeyError: 'particle_posx'
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.

Hello,
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
RockstarHaloFinder
File
"/opt/apps/yt/3.3.1/yt-conda/lib/python2.7/site-packages/yt/analysis_modules/halo_finding/rockstar/api.py",
line 16, in <module>
from .rockstar import RockstarHaloFinder
File
"/opt/apps/yt/3.3.1/yt-conda/lib/python2.7/site-packages/yt/analysis_modules/halo_finding/rockstar/rockstar.py",
line 26, in <module>
from . import rockstar_interface
ImportError: cannot import name rockstar_interface
Many thanks
Andy

Hi all,
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 *
import sys
for i in range(1,len(sys.argv)):
ds = load(sys.argv[i])
ds.print_stats()
#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)
#plot.set_cmap(field="Temperature", cmap='hot')
plot.save()
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.
Thanks,
Chris Jessop