Galaxy
- class dysmalpy.galaxy.Galaxy(z=0, cosmo=FlatLambdaCDM(H0=70.0 km / (Mpc s), Om0=0.3, Tcmb0=0.0 K, Neff=3.04, m_nu=None, Ob0=None), obs_list=None, model=None, name='galaxy')[source]
Bases:
object
Container for simulating or modelling a galaxy
Galaxy
holds the observed data, model, observing instrument, and general information for a galaxy. This can be a simulated or real galaxy.- Parameters:
z (float) – Redshift of the galaxy
cosmo (
cosmology
object) – The cosmology to use for modelling. Default is astropy.cosmology.FlatLambdaCDM with H0=70., and Om0=0.3.model (
ModelSet
object) – A dysmalpy model to use for simulating and/or fitting data. This generates the intrinsic observables of the galaxy based on the components included in the ModelSet.obs_list (list) – List of
Observation
objects, which holdInstrument
,ObsModOptions
, andData
instances. For eachobs
,obs.instrument
andobs.mod_options
describes howmodel
is converted to observed space data.name (str, optional) – Name of the galaxy. Default is “galaxy.”
Attributes Summary
Methods Summary
add_observation
(obs)Add an observation to the galaxy.observations ordered dict.
copy
()create_model_data
([obs_list])Function to simulate data for the galaxy
get_observation
(obs_name)Retrieve an observation from the galaxy.observations ordered dict.
load_self
([filename])Load a saved Galaxy from a pickle file
preserve_self
([filename, save_data, overwrite])save_model_data
([filenames, overwrite])Attributes Documentation
- cosmo
- dscale
- z
Methods Documentation
- create_model_data(obs_list=None)[source]
Function to simulate data for the galaxy
The function will initially generate a data cube that will then be optionally reduced to 2D, 1D, or single spectrum data if specified. The generated cube can be accessed via
Galaxy.model_cube
and the generated final data products viaGalaxy.model_data
. Both of these attributes aredata_classes.Data
instances.Calls the per-observation
Observation.create_single_obs_model_data
method- Parameters:
obs_list (list, optional) – List of observations to make models for. If omitted, will default to making models for all observations in the galaxy.
- get_observation(obs_name)[source]
Retrieve an observation from the galaxy.observations ordered dict.