roman_shear_sims.catalog

Attributes

LAYOUT_KINDS

GAL_TYPES

Classes

SimpleGalaxyCatalog

A simple galaxy catalog with a single galaxy type.

GalaxyCatalog

Galaxy simulation from Sheldon et al. 2019

DiffSkyCatalog

Build catalog based on the DiffSky simulation.

SimpleDiffSkyCatalog

A simple DiffSky catalog with galaxies arranged in a grid or random

Functions

get_simple_pos(simu_type, img_size, rng[, ...])

Those functions are taken from the descwl-shear-sims package,

get_g_BA(rng[, sigma, size])

Generate a set of galaxy intrinsic ellipticities using the

Module Contents

LAYOUT_KINDS = ['grid', 'random'][source]
GAL_TYPES = ['gauss', 'exp', 'dev'][source]
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.

_simu_type = 'sca'[source]
img_size[source]
rng[source]
gal_type = 'exp'[source]
_hlr = 0.5[source]
_mag = 25[source]
_exp_time = 139.8[source]
layout_kind = 'grid'[source]
buffer = 0[source]
spacing = 5.0[source]
n_gal = None[source]
_chromatic = False[source]
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

_init_catalog(chromatic=False, gal_sed_path=None)[source]
_get_gsobject(index)[source]
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

_set_gsobject(gal_sed=1)[source]
_set_gsobject_delta(gal_sed=None)[source]
_get_zeropoint(bp)[source]
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

_get_sed(gal_sed_path)[source]
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: SimpleGalaxyCatalog

Galaxy 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”.

_flux_range = None[source]
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(index)[source]
set_bandpass_ref(ref_band)[source]

Set the reference bandpass for the flux range selection.

Parameters:

ref_band (str) – The reference bandpass name.

_set_gsobject(gal_sed=1)[source]
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: GalaxyCatalog

Build 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”.

img_size[source]
_simu_type = 'sca'[source]
_do_knots = True[source]
_coadd_center[source]
_chromatic = False[source]
_exp_time = 139.8[source]
_gal_sed_path = None[source]
rng[source]
galsim_rng[source]
_init_catalog(coadd_center, img_size, skycatalog_config_path, simu_type='sca', buffer=0, chromatic=True, gal_sed_path=None)[source]
_init_pos()[source]
_get_gsobject(index, bandpass=None)[source]
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

_set_gsobject(gal_sed=None, gsparams=None, rng=None)[source]
_get_diffsky_gsobject(row, sed_row, gal_sed=None, gsparams=None, rng=None)[source]
abstractmethod _get_star_gsobject(row, sed_row, gsparams=None)[source]
_get_pos(i, ra, dec)[source]
_get_flux_components(sed_dict, bandpass, cache=True)[source]
_set_flux(flux_range)[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: DiffSkyCatalog

A 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”.

layout_kind = 'grid'[source]
buffer = 0[source]
spacing = 5.0[source]
n_gal = None[source]
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

_init_pos()[source]
_get_pos(i, ra, dec)[source]
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