Hi everyone,
In conjunction with the release of yt 3.5, I'm pleased to announce the
inaugural release of the yt_astro_analysis package.
yt_astro_analysis is an extension of yt for astro-specific analysis
modules. This functionality previously existed in yt as the
analysis_modules submodule, but has been spun off into its own package
to allow development to occur on its own timeline independent of yt.
yt_astro_analysis includes:
- halo finding
- halo analysis
- light cones
- data export to RADMC-3D radiative transfer code
Switching from yt's analysis_modules to yt_astro_analysis should be
straightforward. yt_astro_analysis can be installed with pip:
pip install yt_astro_analysis
Then, analysis scripts need only change their import lines from
"yt.analysis_modules" to "yt.extensions.astro_analysis".
The yt_astro_analysis package lives at:
https://github.com/yt-project/yt_astro_analysis
Documentation can be found at:
https://yt-astro-analysis.readthedocs.io
Just like yt, contributions to yt_astro_analysis are highly
encouraged!
Regards,
The yt development team
yt_astro_analysis has received contributions from the following
people:
Pengfei Chen
Bili Dong
Hilary Egan
Nathan Goldbaum
Cameron Hummels
Kacper Kowalik
Matthew Krafczyk
Michael Kuhlen
Sam Leitner
Joshua Moloney
Christopher Moody
Andrew Myers
Mark Richardson
Douglas Rudd
Anthony Scopatz
Sam Skillman
Stephen Skory
Britton Smith
Geoffrey So
Casey W. Stark
Stephanie Tonnesen
Matthew Turk
Miguel de Val-Borro
Mike Warren
John Wise
John ZuHone
Hello yt users,
I'm trying to write my own rudimentary clump finding script: the script
will iteratively find the index of the densest unmasked cell, record its
density and position and then update the mask as to exclude all cells
within 0.2pc of this position. The script should then find the position
and density of the next densest clump since all clumps with higher
densities have already been masked. However, the densities in the output
file aren't ordered from densest to least dense as expected, but instead
the order appears completely random.
Does anybody have any insight as to why this is? I've included the
relevant part of my script below. I'm running Python version 2.7.12,
numpy version 1.11.1 and am reading from an Enzo dataset. Any help is
much appreciated.
Many thanks,
Sam Patrick
import yt
import sys
import numpy as np
from yt.units import Msun, Myr, pc
from yt.units.yt_array import YTQuantity, YTArray
yt.enable_parallelism()
N_CLUMPS = 20
ds = yt.load("DD0306/output_0306")
densities = [0 for i in range (N_CLUMPS)]
val, loc = ds.find_max('density')
sp = ds.sphere(loc, 4*pc)
densities[0] = val
far = sp['radius'] > 0.2*pc
for i in range (1, N_CLUMPS, 1):
max_index = np.argmax(sp['density'][far])
densities[i] = sp['density'][max_index]
position = YTArray([sp[coord][max_index].in_units('pc').value
for coord in ['x', 'y', 'z']], 'pc')
distances = np.sqrt((sp['x'] - position[0])**2 + (sp['y'] -
position[1])**2 + (sp['z'] - position[2])**2)
far = far & (distances > 0.2*pc)
The yt community is proud to announce the release of yt 3.5.0. This is a
major
release and includes a number of new features, minor improvements, and
bugfixes.
yt (http://yt-project.org) is an open source, community developed toolkit
for
the analysis and visualization of volumetric data.
If you are interested in contributing to yt, please see our repository on
GitHub
at http://github.com/yt-project/yt.
Since yt 3.4.0 we have merged 328 pull requests from 41 contributors,
including
23 new contributors. We would like to thank the following people who made
code
contributions to this release, new contributors are marked with an asterisk.
Ashley Kelly *
Fabian Koller
Enrico Garaldi *
Hugo Pfister *
Josh Borrow *
Kiran Eiden *
Matthew Turk
Prateek Gupta *
Ricarda Beckmann
Kacper Kowalik
Andrew Myers
Brandon Qiao *
Britton Smith
Christoph Behrens *
Cameron Hummels
Claire Kopenhafer *
Clayton Strawn *
Corentin Cadiou
David Pérez-Suárez *
Donald E Willcox *
Hilary Egan
Abhishek Singh *
Hsi-Yu Scive
Suoqing Ji
Josh Soref *
John ZuHone
Max Gronke *
Max Katz
Miguel de Val-Borro
Marianne Corvellec *
Madicken Munk *
Clément Robert *
Nick Gnedin *
Nathan Goldbaum
Philip Grete *
Bili Dong
Sean Larkin *
Stephanie Ho *
Yi-Hao Chen
Ying-Chao Lu *
Mike Zingale
We would also like to thank everyone who has contributed in other ways,
including by reporting issues, participating on the mailing list, and
evangelizing yt to your colleagues.
Additionally, we would like to highlight the contributions of Ashley Kelly
and
Abhishek Singh, who contributed to this release in the context of Google
Summery
of Code projects. Both students passed their evaluations and made
substantial
improvements to yt. You can find out more about Ashley and Abhishek's
projects
on the Summer of Code website:
https://summerofcode.withgoogle.com/projects/#5101882905722880https://summerofcode.withgoogle.com/projects/#5325639024902144
Finally, we would also like to highlight the contributions of Corentin
Cadiou, who has
made substantial performance and functionality improvements to the RAMSES
frontend as part of this release. Corentin's contributions came in on a
volunteer basis and we thank him for his tireless efforts to improve yt's
support for RAMSES data.
Binaries for yt 3.5.0 are available via pip and conda. If you installed via
the
install script or use conda to manage your python installation, you can
update
yt via:
$ conda update -c conda-forge yt
Conda-forge package updates may not be up quite yet but should be uploaded
by
the end of the day.
And if you manage your python installation with pip:
$ pip install -U yt
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
Slack
or IRC channel.
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.
Best,
The yt development team
What's new?
-----------
Please see the release notes for full details
(http://yt-project.org/docs/3.5.0/reference/changelog.html#version-3-5-0),
but
we highlight a few major changes and improvements here.
* yt.analysis_modules has been deprecated in favor of the new
yt_astro_analysis
package. New features and new astronomy-specific analysis modules will go
into
yt_astro_analysis and importing from yt.analysis_modules will raise a
noisy
warning. We will remove yt.analysis_modules in a future release
* Vector fields and derived fields depending on vector fields have been
systematically updated to account for a bulk correction field parameter.
For
example, for the velocity field, all derived fields that depend on
velocity
will now account for the "bulk_velocity" field parameter. In addition, we
have
defined "relative_velocity" and "relative_magnetic_field" fields that
include
the bulk correction. Both of these are vector fields, to access the
components, use e.g. "relative_velocity_x". The
"particle_position_relative"
and "particle_velocity_relative" fields have been deprecated.
* The RAMSES frontend has seen considerable improvements, with support for
the
new RAMSES self-describing particle output format, considerable speed
improvements for I/O and initially loading data, and support for
restricting
the domain to a subset of the full simulation volume for imrpoved speed
and
reduced memory usage for large datasets.
* Aliases to spatial fields with the "gas" field type will now be
returned in the default unit system for the dataset. As an example the "x"
field might resolve to the field tuples ("index", "x") or ("gas",
"x"). Accessing the former will return data in code units while the latter
will return data in whatever unit system the dataset is configured to use
(CGS, by default). This means that to ensure the units of a spatial field
will
always be consistent, one must access the field as a tuple, explicitly
specifying the field type. Accessing a spatial field using a string field
name
may return data in either code units or the dataset’s default unit system
depending on the history of field accesses prior to accessing that field.
In
the future accessing fields using an ambiguous field name will raise an
error.
* The max_level and min_level attributes of yt data objects now correctly
update
the state of the underlying data objects when set. In addition we have
added
an example to the cookbook that shows how to downsample AMR data using
this
functionality.
* It is now possible to customize the formatting of
labels for ion species fields. Rather than using the default spectroscopic
notation, one can call ds.set_field_label_format("ionization_label",
"plus_minus") to use the more traditional notation where ionization state
is
indicated with + and - symbols.
Hi,
I have a query regarding how the newly formed particles are assigned the
identifiers (particle_identifier). Say, I have particles from 1 to 10
initially, when the new particles are formed, are they assigned ids in
between 1-10 changing all the existing particles’ ids or are they assigned
ids starting from 11?
Hello yt users,
Is there an easy way to change the number of ticks (or just tick labels) on
a slice plot? When I increase the font size, the number of ticks does not
change, and now the labels on my x axis are overlapping.
I know I can save everything to fixed resolution buffer and make the plots
outside of yt, but would like to be able to do it in the easier way :).
Thank you!
Yuan
Dear yt users,
I am trying to compute the mass flux through a plane (parallel to the yz
plane in my simulation). This is my script:
surf_x=ds.surface(box,"x",(0.5,"code_length"))
flux_x=surf_x.calculate_flux("x-velocity","y-velocity","z-velocity","density")
Maybe I made an obvious mistake, but here is the error message:
File "yt/utilities/lib/marching_cubes.pyx", line 351, in
yt.utilities.lib.marching_cubes.march_cubes_grid_flux
ZeroDivisionError: float division by zero
I can compute flux through a sphere just fine. Does this method only work
for a closed surface?
Right now because this surface method does not work, I am using a rather
clumsy way of calculating flux along my x-axis. I first get the cell-area
weighted rho*v (defined field) profile along x. Then I multiply this rho*v
by the total area. I think I am getting the right flux, but would like to
verify using another method (the surface flux thing).
Thank you!
Yuan
Hi,
I have written some new fields in yt/yt/fileds file named as XXX.py, but I have no idea how to make it work correctly like kinetic-energy, thermal-energy etc which can be projected and sliced.
Please help me to work it out!!!
Hi,
I am trying to make a projection plot of a cut region with the following
script:
> import yt
>
> from yt.units import kpc
>
> import matplotlib.pyplot as plt
>
> import numpy as np
>
> import yt.visualization.eps_writer as eps
>
>
> filename=
> "/lunarc/nobackup/users/samvad/BIG-12-new/output/output_00044/info_00044.txt"
>
> ds = yt.load(filename)
>
> ds.define_unit("hpc", (1.674*10**(-24), "g/cm**3"))
>
> ad=ds.all_data()
>
> dens=ad.cut_region(["obj['density'].in_units('hpc') > 600"])
>
> a=dens.quantities.extrema("density").in_units('hpc')
>
plot = yt.ProjectionPlot(ds, 'z', "density", weight_field="density",
> data_source=dens)
> plot.set_unit("density", "hpc")
> plot.set_zlim("density", 1e-7, 1e8)
plot.save("density.png")
I find that my cut region is not empty and has some values, however, when I
look at the plot, it is empty. I get the following error in the output:
> /home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py:785:
> RuntimeWarning: All-NaN axis encountered
>
> elif np.nanmax(image) == np.nanmin(image):
>
> /home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py:788:
> RuntimeWarning: All-NaN axis encountered
>
> elif np.nanmax(image) <= 0:
>
> yt : [WARNING ] 2018-10-09 17:56:15,001 Plot image for field ('gas',
> 'density') is filled with NaNs.
>
> yt : [WARNING ] 2018-10-09 17:56:15,001 Switching to linear colorbar
> scaling.
>
> yt : [INFO ] 2018-10-09 17:56:15,513 Saving plot density.png
>
Hi yt-users,
I would like to see the total volume of clumps I have selected using the
clump finder. I am just not sure how to actually call the value.
#So I have defined total_volume:
def _total_volume(clump):
total_vol = clump.data.quantities.total_quantity(
["cell_volume"]).in_units('cm**3')
return "Cell Volume: %6e cm**3." % total_vol
add_clump_info("total_volume",_total_volume)
#then later on I calculate it for my clumps:
master_clump.add_info_item("total_volume")
# Begin clump finding.
find_clumps(master_clump, c_min, c_max, step)
# Traverse the clump hierarchy to get a list of all of the 'leaf' clumps
leaf_clumps = get_lowest_clumps(master_clump)
my problem is that I don't know how to get my script to print out the
total_volume value!
Modifying the example, I thought
print (leaf_clumps["clump","total_volume"])
might work, but I get this error:
Traceback (most recent call last):
File "yt_clump_fingert.py", line 121, in <module>
print (leaf_clumps["clump","total_volume"])
TypeError: list indices must be integers or slices, not tuple
Then I tried looping through my clumps (j):
print (leaf_clumps[j]["total_volume"])
and get this error message:
File "yt_clump_fingert.py", line 121, in <module>
print (leaf_clumps[j]["total_volume"])
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/level_sets/clump_handling.py",
line 402, in __getitem__
return self.data[request]
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/data_containers.py", line
248, in __getitem__
f = self._determine_fields([key])[0]
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/data_containers.py", line
1165, in _determine_fields
finfo = self.ds._get_field_info("unknown", fname)
File "/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/static_output.py",
line 796, in _get_field_info
raise YTFieldNotFound((ftype, fname), self)
yt.utilities.exceptions.YTFieldNotFound: Could not find field '('io',
'total_volume')' in JO204cw0025.
Rather than just continuing to guess, I thought I would ask for help!
Thanks,
Stephanie
--
Dr. Stephanie Tonnesen
Associate Research Scientist
CCA, Flatiron Institute
New York, NY
stonnes(a)gmail.com
Ah, thank you - this is a great idea.
On 10/5/2018 8:05 PM, Britton Smith wrote:
> You can create a particle filter to use only the dark matter particles
> in the calculation.
>
> On Fri, Oct 5, 2018 at 10:58 AM Nick Gnedin <gnedin(a)fnal.gov
> <mailto:gnedin@fnal.gov>> wrote:
>
>
> Thanks for the heads up. It may not work then, I have 3 DM species
> in my
> simulations, although all the particles belong to the third one.
>
>
>
> On 10/5/2018 7:23 PM, Britton Smith wrote:
> > Hi Nick,
> >
> > Ok, good luck. It should be noted that the version of Rockstar
> that runs
> > with yt is not the latest version of Rockstar, known as
> > Rockstar-Galaxies. yt's Rockstar does not support multi-mass
> > simulations. You may also find different i/o performance between
> the two
> > versions, so it's worth experimenting, if both options are available.
> >
> > Britton
> >
> > On Fri, Oct 5, 2018 at 10:10 AM Nick Gnedin <gnedin(a)fnal.gov
> <mailto:gnedin@fnal.gov>
> > <mailto:gnedin@fnal.gov <mailto:gnedin@fnal.gov>>> wrote:
> >
> >
> > Britton,
> >
> > Thank you very much, I will try Rockstar first.
> >
> > n
> >
> >
> > On 10/5/2018 7:06 PM, Britton Smith wrote:
> > > HI Nick,
> > >
> > > Sadly, yt's FoF and HOP finders don't output member particle
> > information
> > > for the halos, so it might not be possible to use those
> catalogs
> > to make
> > > merger trees. ytree's merger-tree creation works with FoF
> catalogs
> > > generated by the inline Gadget halo finder, for which yt
> supports
> > > extracting member particle information. If you're looking
> to make
> > > merger-trees, the best route currently is probably
> > > Rockstar/consistent-trees, the outputs of which can be
> loaded by
> > ytree.
> > >
> > > It is probably a week's worth of work to fix up yt's HOP/FoF
> > finders to
> > > output particle information and then to add support for
> loading that
> > > into yt.
> > >
> > > Britton
> > >
> > > On Fri, Oct 5, 2018 at 6:07 AM Nick Gnedin
> <gnedin(a)fnal.gov <mailto:gnedin@fnal.gov>
> > <mailto:gnedin@fnal.gov <mailto:gnedin@fnal.gov>>
> > > <mailto:gnedin@fnal.gov <mailto:gnedin@fnal.gov>
> <mailto:gnedin@fnal.gov <mailto:gnedin@fnal.gov>>>> wrote:
> > >
> > >
> > > Folks,
> > >
> > > I am confused about how to compute merger trees with yt.
> > Documentation
> > >
> >
> (https://yt-project.org/doc/analyzing/analysis_modules/halo_merger_tree.html… <https://urldefense.proofpoint.com/v2/url?u=https-3A__yt-2Dproject.org_doc_a…> <https://urldefense.proofpoint.com/v2/url?u=https-3A__yt-2Dproject.org_doc_a…>
> > >
> >
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__yt-2Dproject.org_doc_a…>)
> > >
> > > refers to ytree package, but that package
> documentation seems to
> > > indicate that only FoF or Subfind halo catalogs can be
> > converted into a
> > > merger tree, while the halo finder in yt is HOP.
> > >
> > > I have run HOP for several snapshots from a
> simulation. What
> > would you
> > > recommend to use to make a merger tree from such a
> data set?
> > >
> > > Thank you,
> > >
> > > Nick Gnedin
> > >
> > > _______________________________________________
> > > yt-users mailing list -- yt-users(a)python.org
> <mailto:yt-users@python.org>
> > <mailto:yt-users@python.org <mailto:yt-users@python.org>>
> > > <mailto:yt-users@python.org
> <mailto:yt-users@python.org> <mailto:yt-users@python.org
> <mailto:yt-users@python.org>>>
> > > To unsubscribe send an email to
> yt-users-leave(a)python.org <mailto:yt-users-leave@python.org>
> > <mailto:yt-users-leave@python.org
> <mailto:yt-users-leave@python.org>>
> > > <mailto:yt-users-leave@python.org
> <mailto:yt-users-leave@python.org>
> > <mailto:yt-users-leave@python.org
> <mailto:yt-users-leave@python.org>>>
> > >
> > >
> > >
> >
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_cam… <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsig…>
> >
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsig…>>
> >
> > > Virus-free. www.avg.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=…>
> >
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=…>
> >
> > >
> >
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_cam… <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsig…>
> >
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsig…>>
> >
> > >
> > >
> > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
>