Map-making functions
Stripeline implements a few functions to produce maps out of time-ordered data.
Stripeline.tod2map_mpi
— Functiontod2map(pix_idx, tod, num_of_pixels; comm = nothing) -> binned_map
tod2map(pix_idx, tod, num_of_pixels, data_properties; comm = nothing) -> binned_map
This function creates a binned map from the time-ordered data kept in the array tod
, assuming that each sample is observing the pixel whose index is in pix_idx
. The parameter num_of_pixels
contains the number of pixels in the Healpix map, and it is used as an upper bound for the values in pix_idx
. The parameter comm
must be a MPI communicator, or nothing
if you are not using MPI.
If comm
is not nothing
, the function is parallelized using MPI, and each process computes a map from its available data. All partial maps are then combined together with MPI.Allreduce
. The function returns an array containing the binned map.
If Array of structures TodNoiseProperties
is passed to the function, the output binned map will be a weighted binned map. Each sample is weighted according to the inverse white noise variance sigma^2 of the corrispondingù polarimeter. In this way, the less noisy polarimeters will count more in the estimation of the map.
Requirements
- The length of the arrays
pix_idx
andtod
must be the same
Stripeline.baseline2map_mpi
— Functionbaseline2map_mpi(pix_idx, baselines, baseline_lengths, num_of_pixels; comm = nothing)-> noise_map
baseline2map_mpi(pix_idx, baselines, num_of_pixels, data_properties; comm = nothing) -> noise_map
This is a MPI based function: each MPI process computes a map from its available data. All partial maps are then combined together with MPI.Allreduce. The function returns an array containing the binned map.
If Array of structures TodNoiseProperties
is passed to the function (instead of baseline_lengths
) the output binned map will be a weighted binned map. Each sample will be weighted according to the inverse white noise variance sigma^2 of the corrisponding polarimeter. In this way, the less noisy polarimeters will count more in the estimation of the map.
Requirements
- The length of
baselines
andbaseline_lengths
must be the same; - The value
sum(baseline_lengths)
must be the same as the length ofpix_idx
.
Stripeline.destripe
— Functiondestripe(pix_idx, tod, num_of_pixels, data_properties, rank; comm = nothing, threshold = 1e-9, max_iter = 10000, save_baseline_history = false) -> DestripingResults
This MPI based function creates a map from a TOD and removes both 1/f and white noise, using the destriping technique.
The parameters passed to the function have the following meaning:
pix_idx
: array containing the indices of the pixels visited by the instrumenttod
: the values measured by the polarimeters for each pixel (either I, Q, or U)num_of_pixels
: the number of pixels in the map to be produced. This is used as an upper limit for the values inpix_idx
data_properties
: an array of structuresTodNoiseProperties
, holding information on each simulated polarimeter noise level, number and length of 1/f baselines and total number of samples. It can be obtained by using functionbuild_noise_properties
.rank
: the rank of the current MPI processcomm
: the MPI communicator object.
The following arguments are optional:
threshold
is used by the conjugated-gradient algorithm. When the residual error of the iteration goes below this value, the iteration stops. The smaller the value, the more accurate the solution.max_iter
is the maximum number of iterations to be executed in the conjugated-gradient algorithm. If the algorithm does not converge within this number of iterations, the process will quit without having reached the convergence threshold (see thethreshold
keyword above).If
save_baseline_history
istrue
, the return value will contain the sequence of baselines tested by the CG algorithm. Each MPI process will hold its own baselines.
The function returns a DestripingResults
object containings the destriped map, the sequence of baselines, and other information describing the convergence of the CG algorithm.
Remarks
- The length of the arrays
pix_idx
andtod
must be the same; - If you do not specify
comm
, no MPI will be used