When I get a field out of an frb, is it possible to specify the weight
field separately for different fields? EG if I do
>>> proj = ds.proj('density',0)
>>> frb = proj.to_frb(1,2)
>>> frb['vx', weight_field='cell_mass']
or something like that? So I make an un-weighted projection, the get a
weighted average for a different field.
The reason I'm asking is we're making phase plots of projected quantities,
using the export_frb functionality. We'd like to have one axis a weighted
quantity, and the other unweighted.
-- Sent from a computer.
I have a dumb question. I'm trying to plot a 1d Zeldovich Pancake with
enzo-3.0, and I keep getting "Not Implemented" errors when trying to access
data. If I change Version in the parameter file from 2.2 to 2.4, it works
fine. Is this a known bug, or am I doing something dumb?
I'm on yt changeset 60bd0bc6b0a9, a totally fresh install as per the
announcement. I'm on the tip of enzo-3.0. Below is what I do:
Thanks a ton!
Parsing Hierarchy 100% |||||||||||||||||||||||||||||||||||||||||||||||||
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
line 246, in __getitem__
f = self._determine_fields([key])
line 518, in _determine_fields
finfo = self.ds._get_field_info("unknown", fname)
line 505, in _get_field_info
line 321, in index
line 217, in __init__
GridIndex.__init__(self, ds, dataset_type)
line 57, in __init__
line 59, in _setup_geometry
line 324, in _parse_index
self._fill_arrays(ei, si, LE, RE, npart, nap)
line 648, in _fill_arrays
-- Sent from a computer.
I'm making a movie of dark matter density from an Enzo simulation, and am
doing so using the arbitrary_grid mechanism. However, when I'm making the
movies, I get some annoying flickering in the color map at early times. As
an example, look at the first 3 Gyr or so of this movie (warning: 122 mb):
I am pretty sure that the flickering is due to an unfortunate interplay
between whatever grid deposition is being used by the arbitrary_grid
functionality and a moving image center. I'd like to test this theory by
forcing the particles to be deposited in a different way - say, by
nearest-grid-point instead of cloud-in-cell. Is it possible to do this? I
can't find anything in the documentation that makes it clear how to do this
with the arbitrary_grid mechanism, but on the other hand there are other
places in yt (the particle plotting tools, for example) where one can
specify ngp vs. cic.
Any suggestions would be greatly appreciated!
p.s. If anybody's interested, the (hacktacular and ugly) script I'm using
to generate movie frames can be found here:
We are proud to announce the release of yt 3.2!
yt (http://yt-project.org) is an open source, community-developed toolkit
for analysis and visualization of volumetric data of all types, with a
particular emphasis on astrophysical simulations and nuclear engineering
Particle-Only Plots - a series of new plotting functions for visualizing
particle data. See here
for more information.
Late-stage beta support for Python 3 - unit tests and answer tests pass
for all the major frontends under python 3.4, and yt should now be mostly
if not fully usable. Because many of the yt developers are still on Python
2 at this point, this should be considered a “late stage beta” as there may
be remaining issues yet to be identified or worked out.
Now supporting Gadget Friend-of-Friends/Subfind catalogs - see here
to learn how to load halo catalogs as regular yt datasets.
Custom colormaps can now be easily defined and added - see here
Now supporting Fargo3D data
Performance improvements throughout the code base for memory and speed
Various updates to the following frontends: ART, Athena, Castro, Chombo,
Gadget, GDF, Maestro, Pluto, RAMSES, Rockstar, SDF, Tipsy
Numerous documentation updates
Generic hexahedral mesh pixelizer
Adding annotate_ray() callback for plots
AbsorptionSpectrum returned to full functionality and now using faster
SciPy Voigt profile
Add a color_field argument to annotate_streamline
Smoothing lengths auto-calculated for Tipsy Datasets
Adding SimulationTimeSeries support for Gadget and OWLS.
Generalizing derived quantity outputs to all be YTArrays or lists of
YTArrays as appropriate
Star analysis returned to full functionality
FITS image writing refactor
Adding gradient fields on the fly
Adding support for Gadget Nx4 metallicity fields
Updating value of solar metal mass fraction to be consistent with Cloudy.
Gadget raw binary snapshot handling & non-cosmological simulation units
Adding support for LightRay class to work with Gadget+Tipsy
Add support for subclasses of frontends
Serialization for projections using minimal representation
Adding Grid visitors in Cython
Improved semantics for derived field units
Add a yaw() method for the PerspectiveCamera + switch back to LHS
Adding annotate_clear() function to remove previous callbacks from a plot
Added documentation for hexahedral mesh on website
Speed up nearest neighbor evaluation
Add a convenience method to create deposited particle fields
UI and docs updates for 3D streamlines
Ensure particle fields are tested in the field unit tests
Allow a suffix to be specified to save()
Add profiling using airspeed velocity
Various plotting enhancements and bugfixes
Use hglib to update
Various minor updates to halo_analysis toolkit
Docker-based tests for install_script.sh
Adding support for single and non-cosmological datasets to LightRay
Adding the Pascal unit
Add weight_field to PPVCube
FITS reader: allow HDU in auxiliary
Fixing electromagnetic units
Specific Angular Momentum [xyz] computed relative to a normal vector
Adding ability to create union fields from alias fields
Small fix to allow enzo AP datasets to load in parallel when no APs
Use proper cell dimension in gradient function.
Minor memory optimization for smoothed particle fields
Fix thermal_energy for Enzo HydroMethod==6
Make sure annotate_particles handles unitful widths properly
Improvements for add_particle_filter and particle_filter
Specify registry in off_axis_projection's image finalization
Apply fix for particle momentum units to the boxlib frontend
Avoid traceback in "yt version" when python-hglib is not installed
Expose no_ghost from export_sketchfab down to
Fix broken magnetic_unit attribute
Fixing an off-by-one error in the set x/y lim methods for profile plots
Providing better error messages to PlotWindow callbacks
Updating annotate_timestamp to avoid auto-override
Updating callbacks to consistently define coordinate system
Fixing species fields for OWLS and tipsy
Fix extrapolation for vertex-centered data
Fix periodicity check in FRBs
Rewrote project_to_plane() in PerspectiveCamera for draw_domain()
Fix intermittent failure in test_add_deposited_particle_field
Improve minorticks for a symlog plot with one-sided data
Fix smoothed covering grid cell computation
Absorption spectrum generator now 3.0 compliant
Fix off-by-one-or-more in particle smallest dx
Fix dimensionality mismatch error in covering grid
Fix curvature term in cosmology calculator
Fix geographic axes and pixelization
Ensure axes aspect ratios respect the user-selected plot aspect ratio
Avoid clobbering field_map when calling profile.add_fields
Fixing the arbitrary grid deposit code
Fix spherical plotting centering
Make the behavior of to_frb consistent with the docstring
Ensure projected units are initialized when there are no chunks.
Removing "field already exists" warnings from the Owls and Gadget
Various photon simulator bugs
Fixed use of LaTeX math mode
Enforce plot width in CSS when displayed in a notebook
Fix cStringIO.StringIO -> cStringIO in png_writer
Add some input sanitizing and error checking to covering_grid initializer
Fix for geographic plotting
Use the correct filename template for single-file OWLS datasets.
Fix Enzo IO performance for 32 bit datasets
Adding a number density field for Enzo MultiSpecies=0 datasets.
Fix RAMSES block ordering
Fix ART star particle masses to correctly reflect current and initial
Updating ragged array tests for NumPy 1.9.1
Force returning lists for HDF5FileHandler
The next major release of yt will be version 3.3, which is slated to
include an overhaul of the volume rendering system and support for
analyzing and visualizing unstructured mesh data.
Standard Installation Methods
As with previous releases, you can install yt from source using one of the
1) From the install script (http://yt-project.org/#getyt ):
Note, many of the dependencies have been updated since version 3.1. If you
previously installed yt from the install script, it is advised that you
re-install yt from scratch.
$ wget http://bitbucket.org/yt_analysis/yt/raw/stable/doc/install_script.sh
$ bash install_script.sh
$ yt update
2) From pip (source or binary wheel, see below for more details):
$ pip install yt
$ pip install -U yt
3) From the Anaconda Python Distribution (
$ conda install yt
$ conda update yt
Note that it might take a day or two for the conda package to be updated.
If you are on the “stable” branch, updating will bring you from yt 3.1 to
3.2, incorporating all
changes since 3.1, whereas if you are on the “dev” or “yt” branch, only the
your last update should be incorporated.
Installing Binary Packages via pip
New to this release is the ability to install binary packages (“wheels”)
using pip on Windows and Mac OS X (64-bit only for both). This has the
advantage of not needing to install yt from source using a proper compiler
setup, which has caused occasional problems on both of these platforms and
prevented us from installing yt easily on other Python distributions.
We have so far been able to install and run the binary distribution via pip
on the following platforms and Python stacks:
Note that it might take a day or two for the pip wheels to be updated.
Enthought Canopy Python (https://www.enthought.com/products/canopy/)
Mac OS X x86_64:
Enthought Canopy Python (https://www.enthought.com/products/canopy/)
Homebrew Python (http://brew.sh/)
Mac OS X’s system Python
MacPorts Python (https://www.macports.org/)
This is somewhat experimental, so other distributions may work (or not),
please submit bug reports or successes to the mailing list or to the
Bitbucket issues page (http://bitbucket.org/yt_analysis/yt/issues).
All distributions are recommended to be Python v. 2.7, although with yt 3.2
there is late-stage beta support for Python 3.4. The requirements for
installing yt via this method are the same as from source:
IPython (not required, but strongly recommended)
To install a new version of yt on one of these platforms, simply do
$ pip install yt
and you should get the binary distribution automatically. Also, if your
python installation is system-wide (e.g., the Mac system Python) you might
need to run pip with administrator privileges.
For more information, including more installation instructions, links to
community resources, and information on contributing to yt’s development,
please see the yt homepage at http://yt-project.org and the documentation
for yt-3.2 at http://yt-project.org/docs/3.2.
yt is the product of a large community of developers and users and we are
extraordinarily grateful for and proud of their contributions. Please
forward this announcement on to any interested parties.
As always, if you have any questions, concerns, or run into any trouble
updating please don't hesitate to send a message to the mailing list or
stop by our IRC channel.
All the best,
The yt development team
I am working on FLASH datasets with particles. I have some self-defined
fields (specifically Lorentz factors) that are stored in the particle data
and would like to map them onto the mesh grid. I've been trying the
"add_deposited_particle_field" that is in the dev version. Currently I use
the "cic" method, in which a particle will populate the nearby 8 cells (in
3D). However, since my particles are sparser than the mesh cells, many of
the cells do not have particles nearby and thus are empty.
I would like to find a way to interpolate for those empty cells, i.e. to
smooth the particle field. Are there any suggestions or directions I should
It would also be very helpful if I can get the list of N nearest neighbor
particles for each cell. I've looked into the nearest neighbor function
But it seems that it is implemented only for octree-based data objects (and
can only perform in a particle-to-particle fashion?), while FLASH data are
loaded into yt as "patch-based" data object.
Is there any function that can get the nearest particle neighbors of each
Department of Astronomy
University of Wisconsin-Madison
I am using yt2.6. I was trying to define a field of the temperature
gradient like gradPressureX, but I got an error message:
new_field[1:-1,1:-1,1:-1] = data["Temperature"][sl_right,1:-1,1:-1]/ds
ValueError: could not broadcast input array from shape (62,62,64) into
I then tried to re-define gradPressureX by copying the original definition (
giving it a different name, and I got the same error. The original
gradPressureX works fine.
Is it because I did not load some specific module or something?
My yt installation quits at matplotlib. The machine is
Any idea how may I solve/bypass the following error:
Processing dependencies for matplotlib==1.4.0
Searching for mock
Best match: mock 1.2.0
Running mock-1.2.0/setup.py -q bdist_egg --dist-dir
mock requires setuptools>=17.1. Aborting installation
error: Setup script exited with 1
I am trying to create two new derived fields and then make a simple phase plot using one of these fields, but I am running into a pretty consistent error involving “convert_to_units". I get basically the same error when using the ds.sphere object and a ds.all_data object, so if there’s something I’ve messed up on, it’s not obvious to me and I would appreciate any help figuring out what’s wrong.
I am running yt on a MacBook Pro with OS 10.10.4. I have the newest version of stable yt (3.1 and changeset 665e2b6cdf78), and you can find my script at this link (http://paste.yt-project.org/show/5733/ <http://paste.yt-project.org/show/5733/>) and my error output at this link (http://paste.yt-project.org/show/5734/ <http://paste.yt-project.org/show/5734/>).
Thank you very much,
Astrophysics | Lyman Briggs College
Women’s & Gender Studies | College of Arts & Letters
LGBTQ and Sexuality Studies Specialization
Women in Science, President
Undergraduate Teaching Assistant
Undergraduate Research Assistant
Department of Physics and Astronomy
Michigan State University