yt is an open-source, permissively-licensed python package for analyzing and visualizing volumetric data.

yt supports structured, variable-resolution meshes, unstructured meshes, and discrete or sampled data such as particles. Focused on driving physically-meaningful inquiry, yt has been applied in domains such as astrophysics, seismology, nuclear engineering, molecular dynamics, and oceanography. Composed of a friendly community of users and developers, we want to make it easy to use and develop — we'd love it if you got involved!

import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
9.98537989593e+12 Mjup
import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
def thermal_energy_dens(field, data):
    return (3/2)*data['gas', 'number_density'] * data['gas', 'kT']
ds.add_field(("gas", "thermal_energy_density"), units="erg/cm**3",
ad = ds.all_data()
ad.mean("thermal_energy_density", "z", weight="density").plot()
import yt
ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150",
slc = yt.SlicePlot(ds, 'z', "temperature", width=(600,"kpc"))
import yt
ds = yt.load("galaxy0030/galaxy0030")
sp = ds.sphere([0.5, 0.5, 0.5], (8, "kpc"))
sp.save_as_dataset("my_sphere.h5", ["density", "particle_mass"])
ds2 = yt.load("my_sphere.h5")
print (["particle_mass"].to("Msun"))
[ 213975.58440381 
  102981.94762343] Msun
import yt
ds = yt.load("snapshot_033/snap_033.0.hdf5")
ds.r[(12.4, 'Mpc'),:,:].plot("density")
import yt
ds = yt.load("D9p_500/10MpcBox_HartGal_csf_a0.500.d")
p = yt.ProjectionPlot(ds, "y", "density")
import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
import yt
ds = yt.load("snipshot_399_z000p000/snip_399_z000p000.0.hdf5")
ad = ds.all_data()
yt.ProfilePlot(ad, ("PartType0", "density"),
               ("PartType0", "temperature"),
               weight_field = ("PartType0", "particle_mass")).save()
import yt
ds = yt.load("HiresIsolatedGalaxy/DD0044/DD0044")
ad = ds.all_data()
yt.PhasePlot(ad, "density", "temperature", "cell_mass",
import yt
ds = yt.load("Enzo_64/DD0043/data0043")
ds.r[:].min(), ds.r[:].max()
(3.81289338015e-32 g/cm**3,
 6.27892369905e-27 g/cm**3)
import yt
ds = yt.load("output_00080/info_00080.txt")
ds.r[(10.0, "Mpc"):(20.0, "Mpc"),
     (30.0, "Mpc"):(40.0, "Mpc"),
     (50.0, "Mpc"):(60.0, "Mpc")].mean("temperature", weight="density")
296317.62046 K
import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
loc1 = ds.r[:].argmax("temperature")
loc2 = ds.r[:].argmax("density")
ray = ds.ray(loc1, loc2)
YTArray([ 22921344.10593038, 
          30989266.0493723 ,
          12222078.64819527]) cm/s

Learn: getting started.

To get started using yt to explore data, we provide resources including documentation, workshop material, and even a fully-executable quick start guide demonstrating many of yt's capabilities.

But if you just want to dive in and start using yt, we have a long list of recipes demonstrating how to do various tasks in yt. We even have sample datasets from all of our supported codes on which you can test these recipes. While yt should just work with your data, here are some instructions on loading in datasets from our supported codes and formats.

Get Started

Dev workshop 2013

Workshop Images

Community: yt's best feature.

yt is a friendly community. We like hearing about fun things you have done with the code, and we're happy to help you out if you have a question or some trouble. You can join us in IRC, on the mailing lists, and if you'd like, you can check out how to develop, too.

If you've got some code to share, or scripts that you'd like to share, start up a repo on GitHub or Bitbucket or share them on our pastebin. If you have any trouble, drop by the mailing list and we'll be happy to help out.

Join the Community

Participatory development.

If you're interested in getting started with helping out, the easiest way is to Fork us on GitHub, check out the developer guide, and stop by the development mailing list. yt is released under the modified BSD License.

There are lots of fun projects to work on, along with some open issues, and we'd particularly like if you'd help out by adding support for a a new data format or if you'd like to help out by shoring up support for a semi-supported output format.


Notebook KH

Get yt: all-in-one script.

yt is built on a stack of completely free and libre open source software, with no proprietary dependencies. It provides its own install script, to assist with constructing an isolated environment that can be upgraded and operated independently of the host operating system.

If you use yt in a publication, we request that you please consider citing our method paper (BibTeX).

Usually getting yt is as simple as running the installation script. Simply download the install script and run it. You can do this using wget or curl, or even just right click and choose Save As. Carefully read the instructions the script prints to your terminal since there might be special instructions for your operating system.


Once you've downloaded it, just run:

$ bash
$ export PATH=/path/to/YT_DEST/bin:$PATH

where YT_DEST will be the folder created by the install script containing a yt installation (usually yt-conda).

Get yt: using conda.

If you use the anaconda python distribution or use conda to manage python packages, you can install the latest stable version of yt with the following command:

$ conda install -c conda-forge yt

Or a nightly development build:

$ conda install -c yt

Get yt: from source.

If you are comfortable installing Python packages and have a build environment set up, you can install yt via pip:

$ pip install yt

If you would like to install the development version of yt, just clone the repository and execute the script:

$ git clone
$ cd yt
$ python develop