Analysis
- opencosmo.analysis.create_yt_dataset(data, compute_xray_fields=False, return_source_model=False, source_model_kwargs={})
Converts particle data to a yt dataset. Note that yt is generally developed with AMR codes in mind, but support for SPH codes is continually being added. yt’s documentation can be found here.
If compute_xray_fields is enabled, X-ray emissivity and luminosity fields will be added using pyxsim, which generates photon samples from gas properties.
- Parameters:
data (dict of astropy.table.Table) – A dictionary of particle datasets. Must include at least positions and masses.
compute_xray_fields (bool, optional) – Whether or not to compute X-ray luminosities with pyxsim. Uses CIESourceModel, which considers thermal emission from gas assuming collisional ionization equilibrium.
return_source_model (bool, optional) – Whether or not to return the pyxsim source model for further interaction, such as computing additional luminosities in different frequency bands or generating synthetic observations.
source_model_kwargs (dict, optional) – Keyword arguments passed to the CIESourceModel constructor in pyxsim. These can include parameters like emin, emax, nbins, abund_table, etc., to control the spectral resolution and emission model behavior. If None, default values will be used for all source model parameters.
- Returns:
ds (yt.data_objects.static_output.Dataset) – A yt dataset built from the input particle data, with additional fields (e.g., X-ray luminosities) if requested.
source_model (pyxsim.source_models.CIESourceModel, optional) – Returned only if return_source_model=True.
- Return type:
Dataset | Tuple[Dataset, CIESourceModel]
- opencosmo.analysis.ParticleProjectionPlot(*args, **kwargs)
Wrapper for yt.ParticleProjectionPlot.
Creates a 2D projection plot of particle-based data along a specified axis.
- Parameters:
*args – Positional arguments passed directly to yt.ParticleProjectionPlot.
**kwargs – Keyword arguments passed directly to yt.ParticleProjectionPlot.
- Returns:
A ParticleProjectionPlot object containing the particle projection plot.
- Return type:
yt.visualization.plot_window.ParticleProjectionPlot
- opencosmo.analysis.ProjectionPlot(*args, **kwargs)
Wrapper for yt.ProjectionPlot.
Creates a 2D projection plot of particle-based data along a specified axis. Smoothing is applied to SPH particle data over the smoothing length
- Parameters:
*args – Positional arguments passed directly to yt.ProjectionPlot.
**kwargs – Keyword arguments passed directly to yt.ProjectionPlot.
- Returns:
A ProjectionPlot object containing the smoothed particle projection plot.
- Return type:
yt.visualization.plot_window.ProjectionPlot
- opencosmo.analysis.SlicePlot(*args, **kwargs)
Wrapper for yt.SlicePlot.
Creates a 2D slice plot of particle-based data along a specified axis. Smoothing is applied to SPH particle data over the smoothing length
- Parameters:
*args – Positional arguments passed directly to yt.SlicePlot.
**kwargs – Keyword arguments passed directly to yt.SlicePlot.
- Returns:
A SlicePlot object containing the smoothed particle slice plot.
- Return type:
yt.visualization.plot_window.SlicePlot
- opencosmo.analysis.ProfilePlot(*args, **kwargs)
Wrapper for yt.ProfilePlot.
Creates a bin-averaged profile of a dependent variable as a function of one or more independent variables.
- Parameters:
*args – Positional arguments passed directly to yt.ProfilePlot.
**kwargs – Keyword arguments passed directly to yt.ProfilePlot.
- Returns:
A ProfilePlot object containing the profile plot.
- Return type:
yt.visualization.profile_plotter.ProfilePlot
- opencosmo.analysis.PhasePlot(*args, **kwargs)
Wrapper for yt.PhasePlot.
Creates a 2D histogram (phase plot) showing how one quantity varies as a function of two others, useful for visualizing thermodynamic or structural relationships (e.g., temperature vs. density colored by mass).
- Parameters:
*args – Positional arguments passed directly to yt.PhasePlot.
**kwargs – Keyword arguments passed directly to yt.PhasePlot.
- Returns:
A PhasePlot object containing the phase plot.
- Return type:
yt.visualization.profile_plotter.PhasePlot