roman_shear_sims.skycatlog_parser
Attributes
Classes
Parse the OpenUniverse2024 SkyCatalog. |
|
Applies extinction to a SED |
Functions
Return the angular knot size. Knots are modelled as the same physical size. |
|
|
Return random value for number of knots based on galaxy sm. |
|
This is used to only load the part of the SED that is relevant for the |
Module Contents
- class SkyCatalogParser(skycatalog_config_path, img_world_center, img_size, simu_type='sca', buffer=0, object_types=None, read_sed=True)[source]
Parse the OpenUniverse2024 SkyCatalog.
- Parameters:
skycatalog_config_path (str) – The path to the SyCatalog .yaml configuration file.
img_world_center (galsim.CelestialCoord) – The celestial coordinates of the image center.
img_size (int) – The size of the image in pixels.
simu_type (str, optional) – The type of simulation to run. Options are ‘sca’ for SCA simulation and ‘imcom’ for IMCOM simulation. Default: ‘sca’.
buffer (int, optional) – The buffer size in pixels to extend the image region for catalog queries.
object_types (list of str, optional) – The list of object types to parse from the catalog. Default is [‘diffsky_galaxy’].
read_sed (bool, optional) – Whether to read the SEDs from the catalog. Default is True.
- _get_region(img_world_center, img_size, buffer=0)[source]
Get the region to query the catalog based on the image center and size. This reguion is used for the initial query of the catalog using: min_ra < ra < max_ra and min_dec < dec < max_dec The region is extended by a buffer to ensure that the entire image is covered by the catalog query.
- _get_in_img_footprint(ra, dec)[source]
Check if the given RA and Dec are within the image footprint. Compared to the _get_region method, this method uses the image WCS to check each object is within the image footprint + buffer.
- _get_cat_paths(object_type, get_sed=False)[source]
Get the catalog file paths for a given object type.
- set_catalog(object_type)[source]
Set the catalog for a given object type. This method queries the catalog files for the given object type and filters the objects based on the image region.
NOTE: Probably only works for the diffsky_galaxy object type at the moment.
- Parameters:
object_type (str) – The type of object to set the catalog for.
- set_sed_catalog(object_type)[source]
Set the SED catalog for a given object type. This method reads the SEDs from the catalog files for the given object type and stores them in the sed_catalog attribute.
NOTE: Probably only works for the diffsky_galaxy object type at the moment.
- Parameters:
object_type (str) – The type of object to set the catalog for.
- get_knot_size(z)[source]
Return the angular knot size. Knots are modelled as the same physical size.
- Parameters:
z (float) – The redshift of the galaxy.
- Returns:
The angular size of the knots in arcseconds, or None if the redshift is above 0.6 (where knots are treated as point sources).
- Return type:
float or None
- get_knot_n(um_source_galaxy_obs_sm, gal_id=None, rng=None)[source]
Return random value for number of knots based on galaxy sm.
- Parameters:
um_source_galaxy_obs_sm (float) – The observed stellar mass of the galaxy.
gal_id (int, optional) – The galaxy ID to use for the random number generator.
rng (galsim.BaseDeviate, optional) – The random number generator to use. If None, a new one is created using the gal_id.
- Returns:
The number of knots for the galaxy.
- Return type:
int
- get_redshift_ind(wave_list, redshift, blue_limit, red_limit)[source]
This is used to only load the part of the SED that is relevant for the given redshift and wavelength range covered by the bandpasses.
- Parameters:
wave_list (np.ndarray) – The original wavelength list of the SED.
redshift (float) – The redshift of the galaxy.
blue_limit (float) – The blue limit of the wavelength range.
red_limit (float) – The red limit of the wavelength range.
- Returns:
- startint
The starting index of the wavelength range.
- endint
The ending index of the wavelength range.
- z_wave_listnp.ndarray
The wavelength list after applying the redshift.
- Return type:
tuple