Loading Tipsy Data¶
Alright, let’s start with some basics. Before we do anything, we will need to load a snapshot. You can do this using the load_sample
convenience function. yt will autodetect that you want a tipsy snapshot and download it from the yt hub.
[1]:
import yt
We will be looking at a fairly low resolution dataset.
This dataset is available for download at https://yt-project.org/data/TipsyGalaxy.tar.gz (10 MB).
[2]:
ds = yt.load_sample("TipsyGalaxy")
We now have a TipsyDataset
object called ds
. Let’s see what fields it has.
[3]:
ds.field_list
[3]:
[('DarkMatter', 'Coordinates'),
('DarkMatter', 'Epsilon'),
('DarkMatter', 'FeMassFrac'),
('DarkMatter', 'Mass'),
('DarkMatter', 'Phi'),
('DarkMatter', 'Velocities'),
('Gas', 'Coordinates'),
('Gas', 'Density'),
('Gas', 'Epsilon'),
('Gas', 'FeMassFrac'),
('Gas', 'Mass'),
('Gas', 'Metals'),
('Gas', 'Phi'),
('Gas', 'Temperature'),
('Gas', 'Velocities'),
('Gas', 'smoothing_length'),
('Stars', 'Coordinates'),
('Stars', 'Epsilon'),
('Stars', 'FeMassFrac'),
('Stars', 'FormationTime'),
('Stars', 'Mass'),
('Stars', 'Metals'),
('Stars', 'Phi'),
('Stars', 'Velocities'),
('all', 'Coordinates'),
('all', 'Epsilon'),
('all', 'FeMassFrac'),
('all', 'Mass'),
('all', 'Phi'),
('all', 'Velocities'),
('nbody', 'Coordinates'),
('nbody', 'Epsilon'),
('nbody', 'FeMassFrac'),
('nbody', 'Mass'),
('nbody', 'Phi'),
('nbody', 'Velocities')]
yt also defines so-called “derived” fields. These fields are functions of the on-disk fields that live in the field_list
. There is a derived_field_list
attribute attached to the Dataset
object - let’s take look at the derived fields in this dataset:
[4]:
ds.derived_field_list
[4]:
[('DarkMatter', 'Coordinates'),
('DarkMatter', 'Epsilon'),
('DarkMatter', 'FeMassFrac'),
('DarkMatter', 'Fe_fraction'),
('DarkMatter', 'Mass'),
('DarkMatter', 'Phi'),
('DarkMatter', 'Velocities'),
('DarkMatter', 'particle_angular_momentum'),
('DarkMatter', 'particle_angular_momentum_magnitude'),
('DarkMatter', 'particle_angular_momentum_x'),
('DarkMatter', 'particle_angular_momentum_y'),
('DarkMatter', 'particle_angular_momentum_z'),
('DarkMatter', 'particle_mass'),
('DarkMatter', 'particle_ones'),
('DarkMatter', 'particle_position'),
('DarkMatter', 'particle_position_cylindrical_radius'),
('DarkMatter', 'particle_position_cylindrical_theta'),
('DarkMatter', 'particle_position_cylindrical_z'),
('DarkMatter', 'particle_position_relative_x'),
('DarkMatter', 'particle_position_relative_y'),
('DarkMatter', 'particle_position_relative_z'),
('DarkMatter', 'particle_position_spherical_phi'),
('DarkMatter', 'particle_position_spherical_radius'),
('DarkMatter', 'particle_position_spherical_theta'),
('DarkMatter', 'particle_position_x'),
('DarkMatter', 'particle_position_y'),
('DarkMatter', 'particle_position_z'),
('DarkMatter', 'particle_radial_velocity'),
('DarkMatter', 'particle_radius'),
('DarkMatter', 'particle_specific_angular_momentum'),
('DarkMatter', 'particle_specific_angular_momentum_x'),
('DarkMatter', 'particle_specific_angular_momentum_y'),
('DarkMatter', 'particle_specific_angular_momentum_z'),
('DarkMatter', 'particle_velocity'),
('DarkMatter', 'particle_velocity_cylindrical_radius'),
('DarkMatter', 'particle_velocity_cylindrical_theta'),
('DarkMatter', 'particle_velocity_cylindrical_z'),
('DarkMatter', 'particle_velocity_los'),
('DarkMatter', 'particle_velocity_magnitude'),
('DarkMatter', 'particle_velocity_relative_x'),
('DarkMatter', 'particle_velocity_relative_y'),
('DarkMatter', 'particle_velocity_relative_z'),
('DarkMatter', 'particle_velocity_spherical_phi'),
('DarkMatter', 'particle_velocity_spherical_radius'),
('DarkMatter', 'particle_velocity_spherical_theta'),
('DarkMatter', 'particle_velocity_x'),
('DarkMatter', 'particle_velocity_y'),
('DarkMatter', 'particle_velocity_z'),
('DarkMatter', 'relative_particle_position'),
('DarkMatter', 'relative_particle_position_x'),
('DarkMatter', 'relative_particle_position_y'),
('DarkMatter', 'relative_particle_position_z'),
('DarkMatter', 'relative_particle_velocity'),
('DarkMatter', 'relative_particle_velocity_x'),
('DarkMatter', 'relative_particle_velocity_y'),
('DarkMatter', 'relative_particle_velocity_z'),
('Gas', 'Coordinates'),
('Gas', 'Density'),
('Gas', 'Epsilon'),
('Gas', 'FeMassFrac'),
('Gas', 'Fe_fraction'),
('Gas', 'Mass'),
('Gas', 'Metals'),
('Gas', 'Phi'),
('Gas', 'Temperature'),
('Gas', 'Velocities'),
('Gas', 'angular_momentum'),
('Gas', 'angular_momentum_magnitude'),
('Gas', 'angular_momentum_x'),
('Gas', 'angular_momentum_y'),
('Gas', 'angular_momentum_z'),
('Gas', 'cylindrical_radius'),
('Gas', 'cylindrical_theta'),
('Gas', 'cylindrical_z'),
('Gas', 'density'),
('Gas', 'mass'),
('Gas', 'metallicity'),
('Gas', 'ones'),
('Gas', 'particle_angular_momentum'),
('Gas', 'particle_angular_momentum_magnitude'),
('Gas', 'particle_angular_momentum_x'),
('Gas', 'particle_angular_momentum_y'),
('Gas', 'particle_angular_momentum_z'),
('Gas', 'particle_mass'),
('Gas', 'particle_ones'),
('Gas', 'particle_position'),
('Gas', 'particle_position_cylindrical_radius'),
('Gas', 'particle_position_cylindrical_theta'),
('Gas', 'particle_position_cylindrical_z'),
('Gas', 'particle_position_relative_x'),
('Gas', 'particle_position_relative_y'),
('Gas', 'particle_position_relative_z'),
('Gas', 'particle_position_spherical_phi'),
('Gas', 'particle_position_spherical_radius'),
('Gas', 'particle_position_spherical_theta'),
('Gas', 'particle_position_x'),
('Gas', 'particle_position_y'),
('Gas', 'particle_position_z'),
('Gas', 'particle_radial_velocity'),
('Gas', 'particle_radius'),
('Gas', 'particle_specific_angular_momentum'),
('Gas', 'particle_specific_angular_momentum_x'),
('Gas', 'particle_specific_angular_momentum_y'),
('Gas', 'particle_specific_angular_momentum_z'),
('Gas', 'particle_velocity'),
('Gas', 'particle_velocity_cylindrical_radius'),
('Gas', 'particle_velocity_cylindrical_theta'),
('Gas', 'particle_velocity_cylindrical_z'),
('Gas', 'particle_velocity_los'),
('Gas', 'particle_velocity_magnitude'),
('Gas', 'particle_velocity_relative_x'),
('Gas', 'particle_velocity_relative_y'),
('Gas', 'particle_velocity_relative_z'),
('Gas', 'particle_velocity_spherical_phi'),
('Gas', 'particle_velocity_spherical_radius'),
('Gas', 'particle_velocity_spherical_theta'),
('Gas', 'particle_velocity_x'),
('Gas', 'particle_velocity_y'),
('Gas', 'particle_velocity_z'),
('Gas', 'position'),
('Gas', 'radial_velocity'),
('Gas', 'radius'),
('Gas', 'relative_particle_position'),
('Gas', 'relative_particle_position_x'),
('Gas', 'relative_particle_position_y'),
('Gas', 'relative_particle_position_z'),
('Gas', 'relative_particle_velocity'),
('Gas', 'relative_particle_velocity_x'),
('Gas', 'relative_particle_velocity_y'),
('Gas', 'relative_particle_velocity_z'),
('Gas', 'relative_x'),
('Gas', 'relative_y'),
('Gas', 'relative_z'),
('Gas', 'smoothing_length'),
('Gas', 'specific_angular_momentum'),
('Gas', 'specific_angular_momentum_x'),
('Gas', 'specific_angular_momentum_y'),
('Gas', 'specific_angular_momentum_z'),
('Gas', 'spherical_phi'),
('Gas', 'spherical_radius'),
('Gas', 'spherical_theta'),
('Gas', 'temperature'),
('Gas', 'velocity'),
('Gas', 'velocity_cylindrical_radius'),
('Gas', 'velocity_cylindrical_theta'),
('Gas', 'velocity_cylindrical_z'),
('Gas', 'velocity_los'),
('Gas', 'velocity_magnitude'),
('Gas', 'velocity_relative_x'),
('Gas', 'velocity_relative_y'),
('Gas', 'velocity_relative_z'),
('Gas', 'velocity_spherical_phi'),
('Gas', 'velocity_spherical_radius'),
('Gas', 'velocity_spherical_theta'),
('Gas', 'velocity_x'),
('Gas', 'velocity_y'),
('Gas', 'velocity_z'),
('Gas', 'x'),
('Gas', 'y'),
('Gas', 'z'),
('Stars', 'Coordinates'),
('Stars', 'Epsilon'),
('Stars', 'FeMassFrac'),
('Stars', 'Fe_fraction'),
('Stars', 'FormationTime'),
('Stars', 'Mass'),
('Stars', 'Metals'),
('Stars', 'Phi'),
('Stars', 'Velocities'),
('Stars', 'creation_time'),
('Stars', 'metallicity'),
('Stars', 'particle_angular_momentum'),
('Stars', 'particle_angular_momentum_magnitude'),
('Stars', 'particle_angular_momentum_x'),
('Stars', 'particle_angular_momentum_y'),
('Stars', 'particle_angular_momentum_z'),
('Stars', 'particle_mass'),
('Stars', 'particle_ones'),
('Stars', 'particle_position'),
('Stars', 'particle_position_cylindrical_radius'),
('Stars', 'particle_position_cylindrical_theta'),
('Stars', 'particle_position_cylindrical_z'),
('Stars', 'particle_position_relative_x'),
('Stars', 'particle_position_relative_y'),
('Stars', 'particle_position_relative_z'),
('Stars', 'particle_position_spherical_phi'),
('Stars', 'particle_position_spherical_radius'),
('Stars', 'particle_position_spherical_theta'),
('Stars', 'particle_position_x'),
('Stars', 'particle_position_y'),
('Stars', 'particle_position_z'),
('Stars', 'particle_radial_velocity'),
('Stars', 'particle_radius'),
('Stars', 'particle_specific_angular_momentum'),
('Stars', 'particle_specific_angular_momentum_x'),
('Stars', 'particle_specific_angular_momentum_y'),
('Stars', 'particle_specific_angular_momentum_z'),
('Stars', 'particle_velocity'),
('Stars', 'particle_velocity_cylindrical_radius'),
('Stars', 'particle_velocity_cylindrical_theta'),
('Stars', 'particle_velocity_cylindrical_z'),
('Stars', 'particle_velocity_los'),
('Stars', 'particle_velocity_magnitude'),
('Stars', 'particle_velocity_relative_x'),
('Stars', 'particle_velocity_relative_y'),
('Stars', 'particle_velocity_relative_z'),
('Stars', 'particle_velocity_spherical_phi'),
('Stars', 'particle_velocity_spherical_radius'),
('Stars', 'particle_velocity_spherical_theta'),
('Stars', 'particle_velocity_x'),
('Stars', 'particle_velocity_y'),
('Stars', 'particle_velocity_z'),
('Stars', 'relative_particle_position'),
('Stars', 'relative_particle_position_x'),
('Stars', 'relative_particle_position_y'),
('Stars', 'relative_particle_position_z'),
('Stars', 'relative_particle_velocity'),
('Stars', 'relative_particle_velocity_x'),
('Stars', 'relative_particle_velocity_y'),
('Stars', 'relative_particle_velocity_z'),
('all', 'Coordinates'),
('all', 'Epsilon'),
('all', 'FeMassFrac'),
('all', 'Fe_fraction'),
('all', 'Mass'),
('all', 'Phi'),
('all', 'Velocities'),
('all', 'particle_angular_momentum'),
('all', 'particle_angular_momentum_magnitude'),
('all', 'particle_angular_momentum_x'),
('all', 'particle_angular_momentum_y'),
('all', 'particle_angular_momentum_z'),
('all', 'particle_mass'),
('all', 'particle_ones'),
('all', 'particle_position'),
('all', 'particle_position_cylindrical_radius'),
('all', 'particle_position_cylindrical_theta'),
('all', 'particle_position_cylindrical_z'),
('all', 'particle_position_relative_x'),
('all', 'particle_position_relative_y'),
('all', 'particle_position_relative_z'),
('all', 'particle_position_spherical_phi'),
('all', 'particle_position_spherical_radius'),
('all', 'particle_position_spherical_theta'),
('all', 'particle_position_x'),
('all', 'particle_position_y'),
('all', 'particle_position_z'),
('all', 'particle_radial_velocity'),
('all', 'particle_radius'),
('all', 'particle_specific_angular_momentum'),
('all', 'particle_specific_angular_momentum_x'),
('all', 'particle_specific_angular_momentum_y'),
('all', 'particle_specific_angular_momentum_z'),
('all', 'particle_velocity'),
('all', 'particle_velocity_cylindrical_radius'),
('all', 'particle_velocity_cylindrical_theta'),
('all', 'particle_velocity_cylindrical_z'),
('all', 'particle_velocity_los'),
('all', 'particle_velocity_magnitude'),
('all', 'particle_velocity_relative_x'),
('all', 'particle_velocity_relative_y'),
('all', 'particle_velocity_relative_z'),
('all', 'particle_velocity_spherical_phi'),
('all', 'particle_velocity_spherical_radius'),
('all', 'particle_velocity_spherical_theta'),
('all', 'particle_velocity_x'),
('all', 'particle_velocity_y'),
('all', 'particle_velocity_z'),
('all', 'relative_particle_position'),
('all', 'relative_particle_position_x'),
('all', 'relative_particle_position_y'),
('all', 'relative_particle_position_z'),
('all', 'relative_particle_velocity'),
('all', 'relative_particle_velocity_x'),
('all', 'relative_particle_velocity_y'),
('all', 'relative_particle_velocity_z'),
('deposit', 'DarkMatter_cic'),
('deposit', 'DarkMatter_cic_velocity_x'),
('deposit', 'DarkMatter_cic_velocity_y'),
('deposit', 'DarkMatter_cic_velocity_z'),
('deposit', 'DarkMatter_count'),
('deposit', 'DarkMatter_density'),
('deposit', 'DarkMatter_mass'),
('deposit', 'DarkMatter_nn_velocity_x'),
('deposit', 'DarkMatter_nn_velocity_y'),
('deposit', 'DarkMatter_nn_velocity_z'),
('deposit', 'Gas_cic'),
('deposit', 'Gas_cic_velocity_x'),
('deposit', 'Gas_cic_velocity_y'),
('deposit', 'Gas_cic_velocity_z'),
('deposit', 'Gas_count'),
('deposit', 'Gas_density'),
('deposit', 'Gas_mass'),
('deposit', 'Gas_nn_velocity_x'),
('deposit', 'Gas_nn_velocity_y'),
('deposit', 'Gas_nn_velocity_z'),
('deposit', 'Stars_cic'),
('deposit', 'Stars_cic_velocity_x'),
('deposit', 'Stars_cic_velocity_y'),
('deposit', 'Stars_cic_velocity_z'),
('deposit', 'Stars_count'),
('deposit', 'Stars_density'),
('deposit', 'Stars_mass'),
('deposit', 'Stars_nn_velocity_x'),
('deposit', 'Stars_nn_velocity_y'),
('deposit', 'Stars_nn_velocity_z'),
('deposit', 'all_cic'),
('deposit', 'all_cic_velocity_x'),
('deposit', 'all_cic_velocity_y'),
('deposit', 'all_cic_velocity_z'),
('deposit', 'all_count'),
('deposit', 'all_density'),
('deposit', 'all_mass'),
('deposit', 'all_nn_velocity_x'),
('deposit', 'all_nn_velocity_y'),
('deposit', 'all_nn_velocity_z'),
('deposit', 'nbody_cic'),
('deposit', 'nbody_cic_velocity_x'),
('deposit', 'nbody_cic_velocity_y'),
('deposit', 'nbody_cic_velocity_z'),
('deposit', 'nbody_count'),
('deposit', 'nbody_density'),
('deposit', 'nbody_mass'),
('deposit', 'nbody_nn_velocity_x'),
('deposit', 'nbody_nn_velocity_y'),
('deposit', 'nbody_nn_velocity_z'),
('gas', 'Fe_fraction'),
('gas', 'angular_momentum'),
('gas', 'angular_momentum_magnitude'),
('gas', 'angular_momentum_x'),
('gas', 'angular_momentum_y'),
('gas', 'angular_momentum_z'),
('gas', 'cutting_plane_velocity_x'),
('gas', 'cutting_plane_velocity_y'),
('gas', 'cutting_plane_velocity_z'),
('gas', 'cylindrical_radius'),
('gas', 'cylindrical_theta'),
('gas', 'cylindrical_z'),
('gas', 'density'),
('gas', 'dynamical_time'),
('gas', 'four_velocity_magnitude'),
('gas', 'four_velocity_t'),
('gas', 'four_velocity_x'),
('gas', 'four_velocity_y'),
('gas', 'four_velocity_z'),
('gas', 'jeans_mass'),
('gas', 'kT'),
('gas', 'kinetic_energy_density'),
('gas', 'lorentz_factor'),
('gas', 'mass'),
('gas', 'mean_molecular_weight'),
('gas', 'metal_mass'),
('gas', 'metallicity'),
('gas', 'momentum_density_x'),
('gas', 'momentum_density_y'),
('gas', 'momentum_density_z'),
('gas', 'momentum_x'),
('gas', 'momentum_y'),
('gas', 'momentum_z'),
('gas', 'number_density'),
('gas', 'ones'),
('gas', 'particle_mass'),
('gas', 'particle_position'),
('gas', 'particle_position_cylindrical_radius'),
('gas', 'particle_position_cylindrical_theta'),
('gas', 'particle_position_cylindrical_z'),
('gas', 'particle_position_relative_x'),
('gas', 'particle_position_relative_y'),
('gas', 'particle_position_relative_z'),
('gas', 'particle_position_spherical_phi'),
('gas', 'particle_position_spherical_radius'),
('gas', 'particle_position_spherical_theta'),
('gas', 'particle_position_x'),
('gas', 'particle_position_y'),
('gas', 'particle_position_z'),
('gas', 'position'),
('gas', 'radial_velocity'),
('gas', 'radial_velocity_absolute'),
('gas', 'radius'),
('gas', 'relative_velocity_x'),
('gas', 'relative_velocity_y'),
('gas', 'relative_velocity_z'),
('gas', 'relative_x'),
('gas', 'relative_y'),
('gas', 'relative_z'),
('gas', 'smoothing_length'),
('gas', 'specific_angular_momentum'),
('gas', 'specific_angular_momentum_magnitude'),
('gas', 'specific_angular_momentum_x'),
('gas', 'specific_angular_momentum_y'),
('gas', 'specific_angular_momentum_z'),
('gas', 'spherical_phi'),
('gas', 'spherical_radius'),
('gas', 'spherical_theta'),
('gas', 'tangential_over_velocity_magnitude'),
('gas', 'tangential_velocity'),
('gas', 'temperature'),
('gas', 'velocity'),
('gas', 'velocity_cylindrical_radius'),
('gas', 'velocity_cylindrical_theta'),
('gas', 'velocity_cylindrical_z'),
('gas', 'velocity_los'),
('gas', 'velocity_magnitude'),
('gas', 'velocity_relative_x'),
('gas', 'velocity_relative_y'),
('gas', 'velocity_relative_z'),
('gas', 'velocity_spherical_phi'),
('gas', 'velocity_spherical_radius'),
('gas', 'velocity_spherical_theta'),
('gas', 'velocity_x'),
('gas', 'velocity_y'),
('gas', 'velocity_z'),
('gas', 'x'),
('gas', 'y'),
('gas', 'z'),
('index', 'cell_volume'),
('index', 'cylindrical_radius'),
('index', 'cylindrical_theta'),
('index', 'cylindrical_z'),
('index', 'dx'),
('index', 'dy'),
('index', 'dz'),
('index', 'grid_indices'),
('index', 'grid_level'),
('index', 'morton_index'),
('index', 'ones'),
('index', 'ones_over_dx'),
('index', 'path_element_x'),
('index', 'path_element_y'),
('index', 'path_element_z'),
('index', 'radius'),
('index', 'spherical_phi'),
('index', 'spherical_radius'),
('index', 'spherical_theta'),
('index', 'virial_radius_fraction'),
('index', 'volume'),
('index', 'x'),
('index', 'y'),
('index', 'z'),
('index', 'zeros'),
('nbody', 'Coordinates'),
('nbody', 'Epsilon'),
('nbody', 'FeMassFrac'),
('nbody', 'Fe_fraction'),
('nbody', 'Mass'),
('nbody', 'Phi'),
('nbody', 'Velocities'),
('nbody', 'particle_angular_momentum'),
('nbody', 'particle_angular_momentum_magnitude'),
('nbody', 'particle_angular_momentum_x'),
('nbody', 'particle_angular_momentum_y'),
('nbody', 'particle_angular_momentum_z'),
('nbody', 'particle_mass'),
('nbody', 'particle_ones'),
('nbody', 'particle_position'),
('nbody', 'particle_position_cylindrical_radius'),
('nbody', 'particle_position_cylindrical_theta'),
('nbody', 'particle_position_cylindrical_z'),
('nbody', 'particle_position_relative_x'),
('nbody', 'particle_position_relative_y'),
('nbody', 'particle_position_relative_z'),
('nbody', 'particle_position_spherical_phi'),
('nbody', 'particle_position_spherical_radius'),
('nbody', 'particle_position_spherical_theta'),
('nbody', 'particle_position_x'),
('nbody', 'particle_position_y'),
('nbody', 'particle_position_z'),
('nbody', 'particle_radial_velocity'),
('nbody', 'particle_radius'),
('nbody', 'particle_specific_angular_momentum'),
('nbody', 'particle_specific_angular_momentum_x'),
('nbody', 'particle_specific_angular_momentum_y'),
('nbody', 'particle_specific_angular_momentum_z'),
('nbody', 'particle_velocity'),
('nbody', 'particle_velocity_cylindrical_radius'),
('nbody', 'particle_velocity_cylindrical_theta'),
('nbody', 'particle_velocity_cylindrical_z'),
('nbody', 'particle_velocity_los'),
('nbody', 'particle_velocity_magnitude'),
('nbody', 'particle_velocity_relative_x'),
('nbody', 'particle_velocity_relative_y'),
('nbody', 'particle_velocity_relative_z'),
('nbody', 'particle_velocity_spherical_phi'),
('nbody', 'particle_velocity_spherical_radius'),
('nbody', 'particle_velocity_spherical_theta'),
('nbody', 'particle_velocity_x'),
('nbody', 'particle_velocity_y'),
('nbody', 'particle_velocity_z'),
('nbody', 'relative_particle_position'),
('nbody', 'relative_particle_position_x'),
('nbody', 'relative_particle_position_y'),
('nbody', 'relative_particle_position_z'),
('nbody', 'relative_particle_velocity'),
('nbody', 'relative_particle_velocity_x'),
('nbody', 'relative_particle_velocity_y'),
('nbody', 'relative_particle_velocity_z')]
All of the field in the field_list
are arrays containing the values for the associated particles. These haven’t been smoothed or gridded in any way. We can grab the array-data for these particles using ds.all_data()
. For example, let’s take a look at a temperature-colored scatterplot of the gas particles in this output.
[5]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
[6]:
ad = ds.all_data()
xcoord = ad["Gas", "Coordinates"][:, 0].v
ycoord = ad["Gas", "Coordinates"][:, 1].v
logT = np.log10(ad["Gas", "Temperature"])
plt.scatter(
xcoord, ycoord, c=logT, s=2 * logT, marker="o", edgecolor="none", vmin=2, vmax=6
)
plt.xlim(-20, 20)
plt.ylim(-20, 20)
cb = plt.colorbar()
cb.set_label(r"$\log_{10}$ Temperature")
plt.gcf().set_size_inches(15, 10)
Making Smoothed Images¶
yt will automatically generate smoothed versions of these fields that you can use to plot. Let’s make a temperature slice and a density projection.
[7]:
yt.SlicePlot(ds, "z", ("gas", "density"), width=(40, "kpc"), center="m")
[7]:
[8]:
yt.ProjectionPlot(ds, "z", ("gas", "density"), width=(40, "kpc"), center="m")
[8]:
Not only are the values in the tipsy snapshot read and automatically smoothed, the auxiliary files that have physical significance are also smoothed. Let’s look at a slice of Iron mass fraction.
[9]:
yt.SlicePlot(ds, "z", ("gas", "Fe_fraction"), width=(40, "kpc"), center="m")
[9]: