"""
This is a simple recipe to show how to open a dataset and then plot a couple
phase diagrams, save them, and quit.  Note that this recipe will take advantage
of multiple CPUs if executed with mpirun and supplied the --parallel command
line argument.  For more information, see :ref:`methods-profiles`.
"""
from yt.mods import * # set up our namespace

fn = "RedshiftOutput0005" # parameter file to load

pf = load(fn) # load data
dd = pf.h.all_data() # This is an object that describes the entire box
pc = PlotCollection(pf) # defaults to center at most dense point

# We plot the average x-velocity (mass-weighted) in our object as a function of
# Electron_Density and Temperature
plot=pc.add_phase_object(dd, ["Electron_Density","Temperature","x-velocity"]
                lazy_reader = True)

# We now plot the average value of x-velocity as a function of temperature
plot=pc.add_profile_object(dd, ["Temperature", "x-velocity"],
                lazy_reader = True)

# Finally, the average electron density as a function of the magnitude of the
# velocity
plot=pc.add_profile_object(dd, ["Electron_Density", "VelocityMagnitude"],
                lazy_reader = True)
pc.save() # save all plots
