roman_shear_sims.utils

Functions

random_ra_dec_in_healpix(rng, nside, pixel_index)

Generate a random (RA, Dec) coordinate uniformly within a given HEALPix

_get_sed_ind(gal_index)

Get the HEALPix and SED indices for a set of galaxy indices.

get_new_df_index(obj_id)

Get the new DataFrame index for a set of object IDs.

get_dl(cosmo, z)

Get the luminosity distance for a given redshift.

Module Contents

random_ra_dec_in_healpix(rng, nside, pixel_index)[source]

Generate a random (RA, Dec) coordinate uniformly within a given HEALPix pixel.

Parameters:
  • rng (np.random.Generator) – Random number generator instance.

  • nside (int) – The nside parameter of the HEALPix grid.

  • pixel_index (int) – The HEALPix pixel index.

Returns:

A tuple containing the RA and Dec in degrees.

Return type:

tuple of float

_get_sed_ind(gal_index)[source]

Get the HEALPix and SED indices for a set of galaxy indices.

Parameters:

gal_index (array-like) – The galaxy indices to get the HEALPix and SED indices for.

get_new_df_index(obj_id)[source]

Get the new DataFrame index for a set of object IDs. This is used to make faster query for the SEDs.

Parameters:

obj_id (array-like) – The object IDs to get the index for.

Returns:

A MultiIndex DataFrame index with ‘pixel’, ‘sed_ind’ and ‘index’ as levels.

Return type:

pd.MultiIndex

get_dl(cosmo, z)[source]

Get the luminosity distance for a given redshift. :param cosmo: The cosmology object. :type cosmo: astropy.cosmology.FlatLambdaCDM :param z: The redshift(s) for which to compute the luminosity distance. :type z: float or array-like

Returns:

The luminosity distance in megaparsecs.

Return type:

float