lib.Qsamplings module

class lib.Qsamplings.QubicSampling(*args, **keywords)[source]

Bases: SamplingHorizontal

azimuth

The pointing azimuth [degrees].

Type:

array-like

elevation

The pointing elevation [degrees].

Type:

array-like

pitch

The instrument pitch angle [degrees].

Type:

array-like

angle_hwp

The half-wave plate angle [degrees].

Type:

array-like

time

Elapsed time for each pointing since the observation start date, in seconds.

Type:

array-like

date_obs

The observation start date.

Type:

string or astropy.time.Time

period

The sampling period [s].

Type:

float

latitude

Telescope latitude [degrees].

Type:

float

longitude

Telescope longitude [degrees].

Type:

float

Examples

pointing = QubicSampling(azimuth=azimuth, elevation=elevation,

angle_hwp=angle_hwp, period=…)

pointing = QubicSampling(azimuth, elevation, pitch, angle_hwp, period=…)

Attributes:
all

Give access to the unpacked attributes, without creating a cyclic reference.

cartesian2spherical

Return the cartesian-to-spherical transform.

cartesian_galactic2instrument

Return the galactic-to-instrument transform.

cartesian_horizontal2instrument

Return the galactic-to-instrument transform.

cartesian_instrument2galactic
cartesian_instrument2horizontal
equatorial

Return the spherical coordinates in the equatorial referential.

galactic

Return the spherical coordinates in the galactic referential.

index

Return the index as an int array.

removed
spherical2cartesian

Return the spherical-to-cartesian transform.

Methods

cartesian()

Return the cartesian coordinates in the equatorial referential.

copy()

Return a deep copy of the packed array.

gather(*args)

MPI-gather the (already scattered) table or a given array.

get_center()

Return the average pointing direction.

pack(x[, out, copy])

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

scatter([comm])

MPI-scatter of the table.

spherical()

Return the spherical coordinates as an (N, 2) ndarray.

split(n)

Split the table in partitioning groups.

unpack(x[, out, missing_value, copy])

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

healpix

time

velocity

DEFAULT_DATE_OBS = '2016-01-01 00:00:00'
DEFAULT_LATITUDE = -24.183333333333334
DEFAULT_LONGITUDE = -66.46666666666667
DEFAULT_PERIOD = 1
property cartesian_galactic2instrument

Return the galactic-to-instrument transform.

property cartesian_horizontal2instrument

Return the galactic-to-instrument transform.

property cartesian_instrument2galactic
property cartesian_instrument2horizontal
healpix(nside)[source]
lib.Qsamplings.create_random_pointings(center, npointings, dtheta, hwp_stepsize, date_obs=None, period=None, latitude=None, longitude=None, seed=None)[source]

Return pointings randomly and uniformly distributed in a spherical cap.

1) Creates random coordinates theta, phi. Range: 0 < theta < dtheta, 0 < phi < 360 (then are converted from spherical to cartesian coordinates), 2) It rotates the points to center them in direction (RA, DEC) using Rotation3dOperator (equatorial reference system) 3) Convertion: Equatorial to Horizontal reference system (using CartesianEquatorial2HorizontalOperator’s operator) 4) Back to cartesian coordinates (using Cartesian2SphericalOperator)

Parameters:
  • center (2-tuple) – The R.A. and declination of the center of the FOV, in degrees.

  • npointings (int) – The number of requested pointings

  • dtheta (float) – The maximum angular distance to the center.

  • hwp_stepsize (float) – Step angle size for the HWP.

  • date_obs (str or astropy.time.Time, optional) – The starting date of the observation (UTC).

  • period (float, optional) – The sampling period of the pointings, in seconds.

  • latitude (float, optional) – The observer’s latitude [degrees]. Default is DOMEC’s.

  • longitude (float, optional) – The observer’s longitude [degrees]. Default is DOMEC’s.

  • seed (int) – Random seed.

lib.Qsamplings.create_repeat_pointings(center, npointings, dtheta, nhwp_angles, date_obs=None, period=None, latitude=None, longitude=None, seed=None)[source]

Return pointings randomly and uniformly distributed in a spherical cap. The same pointing is repeated nhwp_angles times with a different hwp angle each time.

Parameters:
  • center (2-tuple) – The R.A. and declination of the center of the FOV, in degrees.

  • npointings (int) – The number of requested pointings

  • dtheta (float) – The maximum angular distance to the center.

  • nhwp_angles (int) – The number of HWP angles used.

  • date_obs (str or astropy.time.Time, optional) – The starting date of the observation (UTC).

  • period (float, optional) – The sampling period of the pointings, in seconds.

  • latitude (float, optional) – The observer’s latitude [degrees]. Default is DOMEC’s.

  • longitude (float, optional) – The observer’s longitude [degrees]. Default is DOMEC’s.

  • seed (int) – Random seed.

lib.Qsamplings.create_sweeping_pointings(center, duration, period, angspeed, delta_az, nsweeps_per_elevation, angspeed_psi, maxpsi, hwp_stepsize, date_obs=None, latitude=None, longitude=None, fix_azimuth=None, random_hwp=True)[source]

Return pointings according to the sweeping strategy: Sweep around the tracked FOV center azimuth at a fixed elevation, and update elevation towards the FOV center at discrete times.

Parameters:
  • center (array-like of size 2) – The R.A. and Declination of the center of the FOV.

  • duration (float) – The duration of the observation, in hours.

  • period (float) – The sampling period of the pointings, in seconds.

  • angspeed (float) – The pointing angular speed, in deg / s.

  • delta_az (float) – The sweeping extent in degrees.

  • nsweeps_per_elevation (int) – The number of sweeps during a phase of constant elevation.

  • angspeed_psi (float) – The pitch angular speed, in deg / s.

  • maxpsi (float) – The maximum pitch angle, in degrees.

  • latitude (float, optional) – The observer’s latitude [degrees]. Default is DOMEC’s.

  • longitude (float, optional) – The observer’s longitude [degrees]. Default is DOMEC’s.

  • fix_azimuth (bool)

  • hwp_stepsize (float) – Step angle size for the HWP.

  • date_obs (str or astropy.time.Time, optional) – The starting date of the observation (UTC).

  • random_hwp (bool)

Returns:

pointings – Structured array containing the azimuth, elevation and pitch angles, in degrees.

Return type:

QubicSampling

lib.Qsamplings.equ2gal(ra, dec) l, b[source]

Equatorial to galactic spherical conversion. Angles are in degrees.

lib.Qsamplings.equ2hor(ra, dec, time[, date_obs[, latitude[, longitude]]]) az, el[source]

Equatorial to horizontal spherical conversion. Angles are in degrees.

Parameters:
  • ra (float) – Right ascension in degrees.

  • dec (float) – Declination in degrees.

  • time (array-like) – Elapsed time in seconds since date_obs.

  • date_obs (string) – The starting date, UTC.

  • latitude (float) – The observer’s latitude geolocation. Default is Dome C.

  • longitude (float) – The observer’s longitude geolocation. Default is Dome C.

Example

>>> equ2hor(0, 0, 0, date_obs='2000-01-01 00:00:00')
(array(135.71997181016644), array(-10.785386358099927))
lib.Qsamplings.gal2equ(l, b) ra, dec[source]

Galactic to equatorial spherical conversion. Angles are in degrees.

lib.Qsamplings.gal2hor(l, b, time[, date_obs[, latitude[, longitude]]]) az, el[source]

Galactic to horizontal spherical conversion. Angles are in degrees.

Parameters:
  • time (array-like) – Elapsed time in seconds since date_obs.

  • date_obs (string) – The starting date, UTC.

  • latitude (float) – The observer’s latitude geolocation. Default is Dome C.

  • longitude (float) – The observer’s longitude geolocation. Default is Dome C.

Example

>>> gal2hor(0, 0, 0)
(array(50.35837815921487), array(39.212362279976155))
lib.Qsamplings.get_pointing(d)[source]
lib.Qsamplings.hor2equ(az, el, time[, date_obs[, latitude[, longitude]]]) ra, dec[source]

Horizontal to equatorial spherical conversion. Angles are in degrees.

Parameters:
  • azimuth (float)

  • elevation (float)

  • time (array-like) – Elapsed time in seconds since date_obs.

  • date_obs (string) – The starting date, UTC.

  • latitude (float) – The observer’s latitude geolocation. Default is Dome C.

  • longitude (float) – The observer’s longitude geolocation. Default is Dome C.

Example

>>> hor2equ(135.71997181016644, -10.785386358099927, 0,
...         date_obs='2000-01-01 00:00:00')
(array(1.1927080055488187e-14), array(-1.2722218725854067e-14))
lib.Qsamplings.hor2gal(az, el, time[, date_obs[, latitude[, longitude]]]) l, b[source]

Horizontal to galactic spherical conversion. Angles are in degrees.

Parameters:
  • azimuth (float)

  • elevation (float)

  • time (array-like) – Elapsed time in seconds since date_obs.

  • date_obs (string) – The starting date, UTC.

  • latitude (float) – The observer’s latitude geolocation. Default is Dome C.

  • longitude (float) – The observer’s longitude geolocation. Default is Dome C.

Example

>>> hor2gal(50.35837815921487, 39.212362279976155, 0)
(array(4.452776554048925e-14), array(-7.63333123551244e-14))