fgbuster.observation_helpers

Handy access to instrument configuration, map generation and other pysm3 functionalities

Functions

get_instrument([tag])

Get a pre-defined instrumental configuration

get_noise_realization(nside, instrument[, unit])

Generate noise maps for the instrument

get_observation([instrument, sky, noise, …])

Get a pre-defined instrumental configuration

get_sky(nside[, tag])

Get a pre-defined PySM sky

standardize_instrument(instrument)

fgbuster.observation_helpers.get_sky(nside, tag='c1d0s0')[source]

Get a pre-defined PySM sky

Parameters
  • nside (int) – healpix nside of the sky templates

  • tag (string) – See the pysm documentation for a complete list of available options. Default is ‘c1d0s0’, i.e. cmb (c1), dust with constant temperature and spectral index (d0), and synchrotron with constant spectral index (s0).

Returns

sky – See the pysm documentation

Return type

pysm3.Sky

fgbuster.observation_helpers.get_instrument(tag='')[source]

Get a pre-defined instrumental configuration

Parameters

tag (string) – name of the pre-defined experimental configurations. It can contain the name of multiple experiments separated by a space. Call the function with a random input to get the available instruments.

Returns

instr – It contains the experimetnal configuration of the desired instrument(s).

Return type

pandas.DataFrame

fgbuster.observation_helpers.get_observation(instrument='', sky=None, noise=False, nside=None, unit='uK_CMB')[source]

Get a pre-defined instrumental configuration

Parameters
  • instrument

    It can be either a str (see get_instrument()) or an object that provides the following as a key or an attribute.

    • frequency (required)

    • depth_p (required if noise=True)

    • depth_i (required if noise=True)

    They can be anything that is convertible to a float numpy array. If only one of depth_p or depth_i is provided, the other is inferred assuming that the former is sqrt(2) higher than the latter.

  • sky (str of pysm3.Sky) – Sky to observe. It can be a pysm3.Sky or a tag to create one.

  • noise (bool) – If true, add Gaussian, uncorrelated, isotropic noise.

  • nside (int) – Desired output healpix nside. It is optional if sky is a pysm3.Sky, and required if it is a str or None.

  • unit (str) – Unit of the output. Only K_CMB and K_RJ (and multiples) are supported.

Returns

observation – Shape is (n_freq, 3, n_pix)

Return type

array

fgbuster.observation_helpers.get_noise_realization(nside, instrument, unit='uK_CMB')[source]

Generate noise maps for the instrument

Parameters
  • nside (int) – Desired output healpix nside.

  • instrument

    Object that provides the following as a key or an attribute.

    • frequency (required)

    • depth_p (required if noise=True)

    • depth_i (required if noise=True)

    They can be anything that is convertible to a float numpy array. If only one of depth_p or depth_i is provided, the other is inferred assuming that the former is sqrt(2) higher than the latter.

  • unit (str) – Unit of the output. Only K_CMB and K_RJ (and multiples) are supported.

  • sky (str of pysm3.Sky) – Sky to observe. It can be a pysm3.Sky or a tag to create one.

  • noise (bool) – If true, add Gaussian, uncorrelated, isotropic noise.

Returns

observation – Shape is (n_freq, 3, n_pix).

Return type

array