Bases: object
Initialize a class encodes all the nominal specifics of an experiment, i.e. resolution, sensitivity, size of the observational area, frequency channels.
Parameters
name of the experiment, needed for plotting and printing info.
the frequency of channels (assumed GHz)
number of frequency channels
the the Full Width at Half Maximum resolution, units can be deg, arcmin, or arcsec, set the keyword argument units_beam, (Default= arcmin)
the sensitivity at each channel. Default units are , but one can change different units by the units_sensitivity keyword.
percentage of the sky observed by the experiment.
Note
If units_sensitivity=uKsqrts then another keyword must be set, the observational time.
Bases: object
Given the specifics of an experiment, it forecasts the contribution of detected and undetected point sources (only Radio Quasars are considered so far). It inheritates the attributes from the Experiment, needed to be initialized, the level of point source detection. The forecasts start when the Forecaster class is called.
Parameters
Experiment:{Experiment}
set the level above one can consider point sources as detected.
path to the PS4C/data and PS4C/model folders
Given the size of the observational patch it computes how many sources should be detected above the detection flux limit.
Given the frequency channels finds the total intensity number counts from predictions of De Zotti et al. 2005 model (prediction at several frequencies are provided in ./PS4C/model directory) and computes the polarization number counts by deconvolving the intensity number counts with the probability distribution of fractional polarization.
Given the frequency channels finds the total intensity number counts from predictions of Tucci et al. 2011 model and computes the polarization number counts as in get_differential_number_counts().
By default, it computes how many polarized sources should be observed above the detection limit otherwise the sources whose flux >``minflux``.
Plot integral number counts, i.e. number of sources above the detection flux per square degree units.
Plot CMB and undetected Point sources Power spectra.
Parameters
a string among:
show the Galactic foreground levels, a string among:
keywords for matplotlib plots.
Convert physical temperature into the antenna one.
Convert antenna temperature ( Rayleigh-Jeans) into the physical one
Convert brightness temperature to brightness measured in [Jy /beam]
Given a FWHM resolution theta in radians, it computes the solid angle in steradians
Returns conversion factor to pass from Ib brightness units to physical temperature at a given frequency nu
Convert brightness to brightness temperature
Compute the confusion limit by means of the definition in Condon, 1974.
where we set for the truncation limit.
Parameters
Compute the convolution of differential number counts with the lognormal distribution function, i.e.
Parameters
lognormal best fit values computed from Stats.fitting_lognormal_from_fpol() and Stats.fitting_lognormal_from_fluxes().
interpolated differential number counts
flux densities
number of quadrature points.
Returns
polarized fluxes
interpolated polarized differential number counts.
Considering observations from several catalogues, it computes the observed polarization fractions
and fit a lognormal distribution in order to get from the best fit parameters the average values of and their errors. Once all the datasets have been fitted it computes the scaling of by means of a linear function.
Parameters
path to the PS4C data folder
if set to True it exclude the data from HFI channels of Planck.
We recommend you to use this option if you are running at low radio frequencies, i.e. GHz.
Returns
the slope and the error on the slope as computed from the linear fit
the constant term fitted from the linear function
Given a fraction of sky if computes the ratio of the variance of the synchrotron and dust maps within a patch with size fsky and the one within fsky0 which is the value from Planck collaboration et al. 2015.X . All the considered patches exclude the Galactic plane.
Parameters
fsky: {float}
path to the PS4C data folder
Returns
Given differential number counts , estimated at certain flux densities , it estimates the integral
Parameters
differential number counts interpolated by means of numpy.interpolate.interp1d()
frequency
solid angle of the beam
range of integration
Fit the differential number counts as a single power law up to a maximum flux density.
Parameters
- S: {array}
array of fluxes
- n: {function}
differential number counts computed from interpolating number counts from model
- Smax: {float}
the flux limit you may want to estimate the power law fit
Returns
Compute the Galactic contribution in multipole ell , frequency nu and fraction of sky fsky given eq.(22) of Planck 2015 X data are taken from table 4, table 5, table 11.
Parameters
Computes the spectral index of fluxes S1, S2 estimated at two different frequencies, v1 and v2.
Given polarized and intensity flux , P and I and their uncertainties sigmaP and sigmaI, propagates the uncertainties to polarization fraction .
Bases: object
Read PCCS2 catalog at a given frequency.
Parameters
Project the list of PointSources into a healpix map
Read a list of PointSources from a hdf5 binary file.
Look for point sources within and in a catalogue .
Returns
number of sources found
list of the point source found within the ranges
From a list of PointSources save the list into a hdf5 binary file.
It performs the bootstrap resampling from observations. For each group of values (I,P, sigmaI, sigmaP) it resamples nsamples values with Gaussian random values Isamples and Psamples with center around I, or P and width sigmaI and sigmaP. If data are upper limit it resamples by assuming a uniform
distribution of random number from 0 to .
Parameters
- `I, sigmaI, P, sigmaP`={floats}
values for resampling
- nsamples:{int}
how many resampling to do
upper_limit:{bool}
Returns
- f:{array}
resampled fractional polarization
Compute Poissonian upper and lower limit uncertainties from Gehrels 1986.
Parameters
counts within each bin
total number of data
the confidence level (CL) for uncertainties, we consider S=1, meaning 68% CL, S=2 for the 95%, etc...
array where upper and lower uncertainties are stored, shape= 2 x size(bc).
Fit logrnormal distribution of fractional polarization from catalog encoding total intensity and polarized fluxes.
Parameters
total intensity fluxes and errors
polarization flux and errors
string used for plotting
id of figure
fractional polarization histogram bins
if True resample the catalog with 1000 resampling, otherwise it does not.
path to store plots and files.
name and format to store the plot of the lognormal fit in workdir
save the computed best fit parameters, the average fractional polarizations to binary file *.npy in workdir.
Returns
errors on the computed quantities.
Fit logrnormal distribution of fractional polarization from catalog encoding fractional polarization and errors on it.
Parameters
fractional polarization
errors of fractional polariz.
if flag=1 ` or `flag=True it means that data are flagged and they are considered as upper limits.
The rest of the parameters are the very same as in fitting_lognormal_from_fluxes()
Compute log-normal distribution on X:
Parameters
polarization fraction array
constant
Xm:{float}
sigma:{float}
Compute from lognormal best fit parameters, following Battye et al. 2011.
Compute from lognormal best fit parameters, following Battye et al. 2011.
Compute from lognormal best fit parameters, following Battye et al. 2011.
Resampling a catalogue starting from fractional polarization values, errors and flags into the data. Flags identify which data have to be considered as upper limits.
Parameters
how many resampling to do
Returns
array of resampled fractional polarizations.