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 hold Instrument, ObsModOptions, and Data instances. For each obs, obs.instrument and obs.mod_options describes how model is converted to observed space data.

  • name (str, optional) – Name of the galaxy. Default is “galaxy.”

Attributes Summary

cosmo

dscale

z

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

add_observation(obs)[source]

Add an observation to the galaxy.observations ordered dict.

copy()[source]
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 via Galaxy.model_data. Both of these attributes are data_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.

load_self(filename=None)[source]

Load a saved Galaxy from a pickle file

Parameters:

filename (str) – Name of the file with saved Galaxy

preserve_self(filename=None, save_data=True, overwrite=False)[source]
save_model_data(filenames=None, overwrite=False)[source]