snsim.hosts =========== .. py:module:: snsim.hosts .. autoapi-nested-parse:: This module contains the class which are used in the simulation. Classes ------- .. autoapisummary:: snsim.hosts.SnHosts Functions --------- .. autoapisummary:: snsim.hosts.model_host_noise Module Contents --------------- .. py:class:: SnHosts(config, z_range=None, geometry=None) Class containing the SN Host parameters. :param config: Configuration of host. | config | ├── host_file, 'PATH/TO/HOSTFILE' | ├── distrib, str, Optional, default = 'rate', options given by self._dist_options | ├── reweight_vol, bool, Optional, default = False, reweight input host distrib to volumetric | └── key_dic: {'column_name': 'new_column_name', etc}, Optional, only use to change columns names :type config: str :param z_range: The redshift range. :type z_range: list(float), opt :param Initialize SnHost class.: .. py:property:: config Get the configuration dic of host. .. py:property:: max_dz Get the maximum redshift gap. .. py:property:: df Get pandas Dataframe of host. .. py:method:: compute_weights(rate=None, sn_type=None, cosmology=None) Compute the weights for random choice. :param rate: rate function of z, by default None. :type rate: function, optional :returns: weigths for the random draw. :rtype: numpy.ndarray(float) .. py:method:: random_choice(n, seed=None, rate=None, sn_type=None, cosmology=None) Randomly select hosts. :param n: Number of hosts to select. :type n: int :param seed: Random seed. :type seed: int, opt :returns: Dataframe with selected hosts properties. :rtype: pandas.Dataframe .. py:function:: model_host_noise(sim_par, obs) Compute noise coming from host galaxy in photoelectron units (approximation)