lib.Instrument.Qinstrument module

class lib.Instrument.Qinstrument.QubicInstrument(d, FRBW=None)[source]

Bases: Instrument

The QubicInstrument class. It represents the instrument setup.

Attributes:
comm

Methods

NEP_before_horns(noise, nu[, return_only, ...])

This method computes the noise for all the components before back-to-back array.

NEP_coldstop(noise, nu_low, nu_up[, ...])

This method calculates the noise of the cold stop.

NEP_combiner(noise, nu_low, nu_up[, ...])

This method calculates the noise of the optical combiner (consider 2 mirrors).

NEP_dichroic(noise, nu_low, nu_up[, ...])

This method calculates the noise of the dichroic.

NEP_environment(noise, names, nu_low, nu_up)

This method calculates the environment noise.

NEP_horns(noise, nu_low, nu_up[, ...])

This method calculates the noise of the array of horns.

NEP_lastfilter(noise[, return_only, sampling])

NEP_lowpassedge(noise, i, nu_low, nu_up[, ...])

This method calculates the noise of the low pass edge filter.

NEP_lpefilter_220(noise, i, nu_low, nu_up[, ...])

NEP_neutraldensityfilter(noise, nu_low, nu_up)

This method calculates the noise of the neutral density filter for 150GHz band.

get_aperture_integration_operator()

Integrate flux density in the telescope aperture.

get_convolution_peak_operator(**keywords)

Return an operator that convolves the Healpix sky by the gaussian kernel that, if used in conjonction with the peak sampling operator, best approximates the synthetic beam.

get_detector_integration_operator()

Integrate flux density in detector solid angles and take into account the secondary beam transmission.

get_detector_response_operator(sampling[, tau])

Return the operator for the bolometer responses.

get_filter_operator()

Return the filter operator.

get_hwp_operator(sampling, scene)

Return the rotation matrix for the half-wave plate.

get_invntt_operator(sampling)

Return the inverse time-time noise correlation matrix as an Operator.

get_noise(sampling, scene[, det_noise, ...])

Return a noisy timeline.

get_noise_detector(sampling[, out])

Return the detector noise (#det, #sampling).

get_noise_photon(sampling, scene[, out])

Return the photon noise (#det, #sampling).

get_operator(sampling, scene)

Return the acquisition model for the specified sampling and scene as an operator.

get_polarizer_operator(sampling, scene)

Return operator for the polarizer grid.

get_projection_operator(sampling, scene[, ...])

Return the peak sampling operator.

get_synthbeam(scene[, idet, theta_max, ...])

Return the detector synthetic beams, computed from the superposition of the electromagnetic fields.

get_transmission_operator()

Return the operator that multiplies by the cumulative instrumental transmission.

load_NEP_parameters(scene)

This method loads the parameters for the photon noise (NEP) computation.

pack(x)

Convert a multi-dimensional array into a 1-dimensional array which only includes the selected components, potentially ordered according to a given ordering.

plot(**keywords)

Plot the instrument detector footprint.

scatter([comm])

MPI-scatter of the instrument.

split(n)

Split the instrument in partitioning groups.

unpack(x)

Convert a 1-dimensional array into a multi-dimensional array which includes the non-selected components, mimicking the multi-dimensional layout.

detector_subset

remove_significant_peaks

synthbeam_file

NEP_before_horns(noise, nu, return_only=False, sampling=None)[source]

This method computes the noise for all the components before back-to-back array.

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • nu – frequency

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot_nobunch” “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_coldstop(noise, nu_low, nu_up, return_only=False, sampling=None)[source]

This method calculates the noise of the cold stop.

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_combiner(noise, nu_low, nu_up, return_only=False, sampling=None)[source]

This method calculates the noise of the optical combiner (consider 2 mirrors).

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_dichroic(noise, nu_low, nu_up, return_only=False, sampling=None)[source]

This method calculates the noise of the dichroic. It’s only accounted for the FI configuration.

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_environment(noise, names, nu_low, nu_up, return_only=False, sampling=None)[source]

This method calculates the environment noise.

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • names – (noise.names attribute) names of the components considered in the instrument model for the noise.

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2_env” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_horns(noise, nu_low, nu_up, return_only=False, sampling=None)[source]

This method calculates the noise of the array of horns.

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_lastfilter(noise, return_only=False, sampling=None)[source]
Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_lowpassedge(noise, i, nu_low, nu_up, return_only=False, sampling=None)[source]

This method calculates the noise of the low pass edge filter. In the case of the 220GHz the ndf is considered in an independent method called NEP_lastfilters_220.

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • i – index for the low pass edge filters (lpe1 or lpe2 attr of noise)

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_lpefilter_220(noise, i, nu_low, nu_up, return_only=False, sampling=None)[source]
Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • i – noise component index

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

NEP_neutraldensityfilter(noise, nu_low, nu_up, return_only=False, sampling=None)[source]

This method calculates the noise of the neutral density filter for 150GHz band. In the case of the 220GHz the ndf is considered in an independent method called NEP_lastfilters_220.

Parameters:
  • noise – parameters for the computation of the noise. It is loaded from load_NEP_parameters method

  • return_only – if True, the method returns a dictionary with the components of the noise sampled using sampling in Instrument.get_noise() method from pysimulators if False, the method just load the components of the photon noise in the noise argument

  • sampling – qubic.get_sampling(dict) object

Returns:

“power” –> photon power “NEP_phot2” –> NEP squared. shape = (#det,) “NEP_array” –> NEP array sampled. shape = (#det,#samples)

Return type:

if return_only –> dictionary with the following keys

detector_subset(dets)[source]
get_aperture_integration_operator()[source]

Integrate flux density in the telescope aperture. Convert signal from W / m^2 / Hz into W / Hz.

get_convolution_peak_operator(**keywords)[source]

Return an operator that convolves the Healpix sky by the gaussian kernel that, if used in conjonction with the peak sampling operator, best approximates the synthetic beam.

get_detector_integration_operator()[source]

Integrate flux density in detector solid angles and take into account the secondary beam transmission.

get_detector_response_operator(sampling, tau=None)[source]

Return the operator for the bolometer responses.

get_filter_operator()[source]

Return the filter operator. Convert units from W/Hz to W.

get_hwp_operator(sampling, scene)[source]

Return the rotation matrix for the half-wave plate.

get_invntt_operator(sampling)[source]

Return the inverse time-time noise correlation matrix as an Operator.

get_noise(sampling, scene, det_noise=True, photon_noise=True, out=None, operation=<function operation_assignment>)[source]

Return a noisy timeline.

get_noise_detector(sampling, out=None)[source]

Return the detector noise (#det, #sampling).

get_noise_photon(sampling, scene, out=None)[source]

Return the photon noise (#det, #sampling).

get_polarizer_operator(sampling, scene)[source]

Return operator for the polarizer grid. When the polarizer is not present a transmission of 1 is assumed for the detectors on the first focal plane and of 0 for the other. Otherwise, the signal is split onto the focal planes.

get_projection_operator(sampling, scene, verbose=True, interp_projection=False)[source]

Return the peak sampling operator. Convert units from W to W/sr.

Parameters:
  • sampling (QubicSampling) – The pointing information.

  • scene (QubicScene) – The observed scene.

  • verbose (bool, optional) – If true, display information about the memory allocation.

get_synthbeam(scene, idet=None, theta_max=45, external_A=None, hwp_position=0, detector_integrate=None, detpos=None)[source]

Return the detector synthetic beams, computed from the superposition of the electromagnetic fields.

The synthetic beam B_d = (B_d,i) of a given detector d is such that the power I_d in [W] collected by this detector observing a sky S=(S_i) in [W/m^2/Hz] is:

I_d = (S | B_d) = sum_i S_i * B_d,i.

Example

>>> scene = QubicScene(1024)
>>> inst = QubicInstrument()
>>> sb = inst.get_synthbeam(scene, 0)

The power collected by the bolometers in W, given a sky in W/m²/Hz is: >>> sb = inst.get_synthbeam(scene) >>> sky = scene.ones() # [W/m²/Hz] >>> P = np.dot(sb, sky) # [W]

Parameters:
  • scene (QubicScene) – The scene.

  • idet (int, optional) – The detector number. By default, the synthetic beam is computed for all detectors.

  • theta_max (float, optional) – The maximum zenithal angle above which the synthetic beam is assumed to be zero, in degrees.

  • external_A (list of tables describing the phase and amplitude at each point of the focal) – plane for each of the horns: [0] : array, X coordinates with shape (n) in GRF [m] [1] : array, Y coordinates with shape (n) in GRF [m] [2] : array, amplitude on X with shape (n, nhorns) [3] : array, amplitude on Y with shape (n, nhorns) [4] : array, phase on X with shape (n, nhorns) [rad] [5] : array, phase on Y with shape (n, nhorns) [rad]

  • hwp_position (int) – HWP position from 0 to 7.

  • detector_integrate (Optional, number of subpixels in x direction for integration over detectors) – default (None) is no integration => uses the center of the pixel

  • detpos (Optional, position in the focal plane at which the Synthesized Beam is desired as np.array([x,y,z]))

get_transmission_operator()[source]

Return the operator that multiplies by the cumulative instrumental transmission.

load_NEP_parameters(scene)[source]

This method loads the parameters for the photon noise (NEP) computation. The attributes are loaded into a Noise() class. The attributes are:

temperatures, transmissions, emissivities, gp (polarization) of each component of the instrument, names: name of each component, tr_prod: cumulative multiplication of the transmissions of each components, dnu: bandwidth, S_det: detector area, omega_det: solid angle sustained by a given detector on the sky, S_horns: physical horn area, S_horns_eff: effective horn area, sec_beam: secondary beam QubicInstrument.secondary_beam,

P_phot, NEP_phot: empty arrays to be loaded by NEP-like methods (below), indexes for each component,

remove_significant_peaks(phis, vals, synthbeam)[source]
synthbeam_file(d)[source]
class lib.Instrument.Qinstrument.QubicMultibandInstrument(d)[source]

Bases: object

The QubicMultibandInstrument class Represents the QUBIC multiband features as an array of QubicInstrumet objects

Methods

detector_subset

direct_convolution

get_synthbeam

detector_subset(dets)[source]
direct_convolution(scene, idet=None)[source]
get_synthbeam(scene, idet=None, theta_max=45, detector_integrate=None, detpos=None)[source]
class lib.Instrument.Qinstrument.QubicMultibandInstrumentTrapezoidalIntegration(d)[source]

Bases: object

The QubicMultibandInstrument class Represents the QUBIC multiband features as an array of QubicInstrumet objects

Methods

detector_subset

direct_convolution

get_synthbeam

detector_subset(dets)[source]
direct_convolution(scene, idet=None)[source]
get_synthbeam(scene, idet=None, theta_max=45, detector_integrate=None, detpos=None)[source]