roman_shear_sims.catalog
Attributes
Classes
A simple galaxy catalog with a single galaxy type. |
|
Galaxy simulation from Sheldon et al. 2019 |
|
Build catalog based on the DiffSky simulation. |
|
A simple DiffSky catalog with galaxies arranged in a grid or random |
Functions
|
Those functions are taken from the descwl-shear-sims package, |
|
Generate a set of galaxy intrinsic ellipticities using the |
Module Contents
- class SimpleGalaxyCatalog(img_size, seed, simu_type='sca', gal_type='exp', hlr=DEFAULT_HLR, mag=DEFAULT_MAG, layout_kind='grid', buffer=0, spacing=5.0, n_gal=None, exp_time=roman.exptime, chromatic=False, gal_sed_path=None)[source]
A simple galaxy catalog with a single galaxy type.
- Parameters:
img_size (int) – Image size in pixels.
seed (int) – Random seed for the catalog.
simu_type (str, optional) – The type of simulation to run. Options are ‘sca’ for SCA simulation and ‘imcom’ for IMCOM simulation. Default: ‘sca’.
gal_type (str) – Galaxy type, one of [‘gauss’, ‘exp’, ‘dev’]. Default: ‘exp’.
hlr (float) – Half-light radius of the galaxy. Default: DEFAULT_HLR.
mag (float) – Magnitude of the galaxy. Default: DEFAULT_MAG.
layout_kind (str) – Layout kind, one of [‘grid’, ‘random’]. Default: ‘grid’.
buffer (int) – Buffer size in pixels. Default: 0.
spacing (float) – Spacing between galaxies in pixels. Default: 5.0.
n_gal (int or None) – Number of galaxies to draw. If None, will use as many as possible. Default: None.
exp_time (float) – Exposure time in seconds.
chromatic (bool) – Whether to use chromatic SEDs. Default: False.
gal_sed_path (str or None) – Path to the galaxy SED file. If None, will use a default SED. Default: None.
- getNObjects()[source]
Get the number of objects in the catalog.
- Returns:
The number of objects in the catalog.
- Return type:
int
- getObjList(bandpass)[source]
Get the object list to draw for a given bandpass.
- Parameters:
bandpass (galsim.Bandpass) – The bandpass to use for the objects.
- Returns:
A dictionary containing the object list.
- Return type:
dict
- get_gsobject_delta()[source]
Get a galsim DeltaFunction gsobject with the appropriate SED.
- Returns:
The galsim DeltaFunction gsobject.
- Return type:
galsim.DeltaFunction
- get_flux(index, zp)[source]
Get the flux of the object at a given index in the catalog.
- Parameters:
index (int) – The index of the object.
zp (float) – The zero point to use for the flux calculation.
- Returns:
The flux of the object.
- Return type:
float
- get_flux_scaling(band, target_zp=COMMON_ZERO_POINT)[source]
Get the flux scaling factor to convert from the current zeropoint to the target zeropoint.
- Parameters:
band (str) – The band to use for the flux scaling.
target_zp (float) – The target zero point.
- Returns:
The flux scaling factor.
- Return type:
float
- class GalaxyCatalog(img_size, seed, simu_type='sca', flux_range=None, layout_kind='grid', buffer=0, spacing=5.0, n_gal=None, exp_time=roman.exptime, chromatic=False, gal_sed_path=None, ref_band='Y106')[source]
Bases:
SimpleGalaxyCatalogGalaxy simulation from Sheldon et al. 2019 ref: https://arxiv.org/abs/1911.02505 Section 3.2
- Parameters:
img_size (int) – Image size in pixels.
seed (int) – Random seed for the catalog.
simu_type (str, optional) – The type of simulation to run. Options are ‘sca’ for SCA simulation and ‘imcom’ for IMCOM simulation. Default: ‘sca’.
flux_range (list or None) – Range of flux values for the galaxies. Default: None, which means no limit.
layout_kind (str) – Layout kind, one of [‘grid’, ‘random’]. Default: ‘grid’.
buffer (int) – Buffer size in pixels. Default: 0.
spacing (float) – Spacing between galaxies in pixels. Default: 5.0.
n_gal (int or None) – Number of galaxies to draw. If None, will use as many as possible. Default: None.
exp_time (float) – Exposure time in seconds.
chromatic (bool) – Whether to use chromatic SEDs. Default: False.
gal_sed_path (str or None) – Path to the galaxy SED file. If None, will use a default SED. Default: None.
ref_band (str) – Reference band for flux range selection. Default: “Y106”.
- getObjList(bandpass)[source]
Get the object list to draw for a given bandpass.
- Parameters:
bandpass (galsim.Bandpass) – The bandpass to use for the objects.
- Returns:
A dictionary containing the object list.
- Return type:
dict
- class DiffSkyCatalog(img_size, seed, skycatalog_config_path, simu_type='sca', object_types=None, do_knots=True, flux_range=None, cell_world_center=WORLD_ORIGIN, buffer=0, exp_time=roman.exptime, chromatic=False, gal_sed_path=None, ref_band='Y106')[source]
Bases:
GalaxyCatalogBuild catalog based on the DiffSky simulation.
- Parameters:
img_size (int) – Image size in pixels.
seed (int) – Random seed for the catalog.
skycatalog_config_path (str) – Path to the SkyCatalogs configuration file.
simu_type (str, optional) – The type of simulation to run. Options are ‘sca’ for SCA simulation and ‘imcom’ for IMCOM simulation. Default: ‘sca’.
object_types (list) – List of object types to include in the catalog. Default: [‘diffsky_galaxy’].
do_knots (bool) – Whether to include knots in the galaxy model. Default: True.
flux_range (list or None) – Range of flux values for the galaxies. Default: None, which means no limit.
cell_world_center (galsim.celestial.CelestialCoord) – Center of the cell in world coordinates (RA, Dec). Default: WORLD_ORIGIN.
buffer (int) – Buffer size around the image in pixels. Default: 0.
exp_time (float) – Exposure time in seconds. Default: roman.exptime.
chromatic (bool) – Whether to include chromatic effects in the galaxy model. Default: False.
gal_sed_path (str or None) – If provided, will use this SED for all galaxies. Path to the galaxy SED file. Default: None.
ref_band (str) – Reference band for flux range selection. Default: “Y106”.
- _init_catalog(coadd_center, img_size, skycatalog_config_path, simu_type='sca', buffer=0, chromatic=True, gal_sed_path=None)[source]
- class SimpleDiffSkyCatalog(img_size, seed, skycatalog_config_path, simu_type='sca', object_types=None, do_knots=True, flux_range=None, cell_world_center=WORLD_ORIGIN, layout_kind='grid', buffer=0, spacing=5.0, n_gal=None, exp_time=roman.exptime, chromatic=False, gal_sed_path=None, ref_band='Y106')[source]
Bases:
DiffSkyCatalogA simple DiffSky catalog with galaxies arranged in a grid or random layout.
- Parameters:
img_size (int) – Image size in pixels.
seed (int) – Random seed for the catalog.
skycatalog_config_path (str) – Path to the SkyCatalogs configuration file.
simu_type (str, optional) – The type of simulation to run. Options are ‘sca’ for SCA simulation and ‘imcom’ for IMCOM simulation. Default: ‘sca’.
object_types (list) – List of object types to include in the catalog. Default: [‘diffsky_galaxy’].
do_knots (bool) – Whether to include knots in the galaxy model. Default: True.
flux_range (list or None) – Range of flux values for the galaxies. Default: None, which means no limit.
cell_world_center (galsim.celestial.CelestialCoord) – Center of the cell in world coordinates (RA, Dec). Default: WORLD_ORIGIN.
layout_kind (str) – Layout kind, one of [‘grid’, ‘random’].
buffer (int) – Buffer size around the image in pixels. Default: 0.
spacing (float) – Spacing between galaxies in arcsec. Default: 5.0.
n_gal (int or None) – Number of galaxies to draw. If None, will use as many as possible. Default: None.
exp_time (float) – Exposure time in seconds. Default: roman.exptime.
chromatic (bool) – Whether to include chromatic effects in the galaxy model. Default: False.
gal_sed_path (str or None) – If provided, will use this SED for all galaxies. Path to the galaxy SED file. Default: None.
ref_band (str) – Reference band for flux range selection. Default: “Y106”.
- get_simple_pos(simu_type, img_size, rng, layout_kind='grid', buffer=0, spacing=5.0, n_gal=None)[source]
Those functions are taken from the descwl-shear-sims package, refs: https://github.com/LSSTDESC/descwl-shear-sims/blob/master/descwl_shear_sims/layout/shifts.py
- Parameters:
simu_type (str, optional) – The type of simulation to run. Options are ‘sca’ for SCA simulation and ‘imcom’ for IMCOM simulation. Default: ‘sca’.
img_size (int) – Image size in pixels.
rng (np.random.RandomState) – Random number generator.
layout_kind (str) – Layout kind, one of [‘grid’, ‘random’]. Default: ‘grid’.
buffer (int) – Buffer size in pixels. Default: 0.
spacing (float) – Spacing between galaxies in pixels. Default: 5.0.
n_gal (int or None) – Number of galaxies to draw. If None, will use as many as possible. Default: None.
- Returns:
xx (np.ndarray) – x-coordinates of the galaxies in arcsec.
yy (np.ndarray) – y-coordinates of the galaxies in arcsec.
- get_g_BA(rng, sigma=0.3, size=1)[source]
Generate a set of galaxy intrinsic ellipticities using the Bernstein & Armstrong (2014) equation 24.
\[p(e) = (1 - e^2)^2 e^{-e^2 / (2 \sigma^2)} 2 \pi e\]- Parameters:
rng (np.random.RandomState) – Random number generator.
sigma (float) – Sigma parameter of the function. Default: 0.3.
size (int) – Number of samples to generate. Default: 1.
- Returns:
Array of galaxy intrinsic ellipticities.
- Return type:
np.ndarray