slsim.Sources.SourcePopulation package¶
Submodules¶
slsim.Sources.SourcePopulation.galaxies module¶
- class slsim.Sources.SourcePopulation.galaxies.Galaxies(galaxy_list, kwargs_cut, cosmo, sky_area, list_type='astropy_table', catalog_type=None, downsample_to_dc2=False, source_size='Bernardi', extended_source_type='single_sersic', extendedsource_kwargs={})[source]¶
Bases:
SourcePopBaseClass describing elliptical galaxies.
- draw_source(z_max=None, z_min=None, galaxy_index=None)[source]¶
Choose source at random.
- Parameters:
z_max – maximum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.
z_min – minimum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.
galaxy_index – index of galaxy to pic (if provided)
- Returns:
instance of Source class
- draw_source_dict(z_max=None, z_min=None, galaxy_index=None)[source]¶
Choose source at random.
- Parameters:
z_max – maximum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.
z_min – minimum redshift limit for the galaxy to be drawn. If no galaxy is found for this limit, None will be returned.
galaxy_index – index of galaxy to pic (if provided)
- Returns:
dictionary of source
- property source_number¶
Number of sources registered (within given area on the sky)
- Returns:
number of sources
- property source_number_selected¶
Number of sources selected (within given area on the sky)
- Returns:
number of sources passing the selection criteria
- slsim.Sources.SourcePopulation.galaxies.convert_to_slsim_convention(galaxy_catalog, light_profile, input_catalog_type='skypy', source_size=None, cosmo=None)[source]¶
This function converts scotch/catalog to slsim conventions. In slsim, sersic index are either n_sersic or (n_sersic_0 and n_sersic_1). Ellipticity are either ellipticity or (ellipticity0 and ellipticity1). These kewords can be read by Galaxies class. This function is written to convert scotch catalog to slsim convension and to change unit of angular size in skypy source catalog to arcsec.
- Parameters:
galaxy_catalog (astropy Table object.) – An astropy table of galaxy catalog in other conventions.
light_profile – keyword for number of sersic profile to use in source light model. accepted kewords: “single_sersic”, “double_sersic”.
input_catalog_type (str. eg: "scotch" or "skypy".) – type of the catalog. If someone wants to use scotch catalog or skypy catalog, they need to specify it.
source_size – Keyword for source size convention. If “Bernardi”, computes galaxy size using g-band magnitude otherwise rescales skypy source size to Shibuya et al.(2015): ht tps://iopscience.iop.org/article/10.1088/0067-0049/219/2/15/pdf
cosmo – astropy.cosmology instance
- Returns:
galaxy catalog in slsim convension.
- slsim.Sources.SourcePopulation.galaxies.down_sample_to_dc2(galaxy_pop, sky_area)[source]¶
Downsamples given galaxy pop above redshift 1.5 to DC2 galaxy population.
- Parameters:
galaxy_pop – Astropy table of galaxy population.
sky_area – Sky area over which galaxies are sampled. Must be in units of solid angle and it should be astropy unit object.
cosmo – astropy.cosmology instance
- Returns:
Astropy tables of downsampled galaxy population in different bins. Redshift bins for returned populations are: (2-2.5), (2.5-3), (3-3.5), (3.5-4), (4-4.5), (4.5-5)
- slsim.Sources.SourcePopulation.galaxies.galaxy_projected_eccentricity(ellipticity, rotation_angle=None)[source]¶
Projected eccentricity of elliptical galaxies as a function of other deflector parameters.
- Parameters:
ellipticity (float [0,1)) – eccentricity amplitude
rotation_angle – rotation angle of the major axis of elliptical galaxy in radian. The reference of this rotation angle is +Ra axis i.e towards the East direction and it goes from East to North. If it is not provided, it will be drawn randomly.
- Returns:
e1, e2 eccentricity components
slsim.Sources.SourcePopulation.point_plus_extended_sources module¶
- class slsim.Sources.SourcePopulation.point_plus_extended_sources.PointPlusExtendedSources(point_plus_extended_sources_list, cosmo, sky_area, kwargs_cut, list_type='astropy_table', catalog_type=None, source_size='Bernadi', point_source_type=None, extended_source_type=None, point_source_kwargs={}, extendedsource_kwargs={})[source]¶
Bases:
Galaxies,SourcePopBaseClass to describe point and extended sources.
slsim.Sources.SourcePopulation.point_sources module¶
- class slsim.Sources.SourcePopulation.point_sources.PointSources(point_source_list, cosmo, sky_area, kwargs_cut, list_type='astropy_table', point_source_type=None, point_source_kwargs={})[source]¶
Bases:
SourcePopBaseClass to describe point sources.
- draw_source()[source]¶
Choose source at random with the selected range.
- Returns:
dictionary of source
- property source_number¶
Number of sources registered (within given area on the sky)
- Returns:
number of sources
- property source_number_selected¶
Number of sources selected (within given area on the sky)
- Returns:
number of sources passing the selection criteria
slsim.Sources.SourcePopulation.source_pop_base module¶
- class slsim.Sources.SourcePopulation.source_pop_base.SourcePopBase(cosmo, sky_area)[source]¶
Bases:
ABCBase class with functions all source classes must have to be able to render populations.
- property kwargs_variability¶
- Returns:
dict of keyword arguments for the variability model.
- abstract property source_number¶
Number of sources registered (within given area on the sky)
- Returns:
number of sources
- abstract property source_number_selected¶
Number of sources selected (within given area on the sky)
- Returns:
number of sources passing the selection criteria
- property variability_model¶
- Returns:
keyword for the variability model