Learn R Programming

rcosmo (version 1.1.6)

downloadCMBPS: Download CMB Power Spectra from Planck Legacy Archive.

Description

The function downloadCMBPS downloads CMB power spectra components from https://www.cosmos.esa.int/web/planck/pla.

Usage

downloadCMBPS(link = 1, destfile, save = TRUE)

Value

A data frame returned invisibly, containing multipoles in column L and the selected power spectrum and uncertainty columns described above. When save = TRUE, it is also written to destfile.

Arguments

link

The link code (an integer from 1 to 6) for the URL to download the file. See code details in this help file.

destfile

A character string with an explicit path and file name. Required when save = TRUE; unused when save = FALSE. No default destination is used. Tilde-expansion is performed.

save

A boolean indicating whether to save or not (since the downloaded data is returned anyway).

Details

link = 1: Best-fit LCDM CMB power spectra from the baseline Planck TT, TE, EE+lowE+lensing (2 <= ell <= 2508).

link = 2: Baseline high-ell Planck TT power spectra (2 <= ell <= 2508).

link = 3: Baseline high-ell Planck EE power spectra (2 <= ell <= 1996).

link = 4: Baseline high-ell Planck TE power spectra (2 <= ell <= 1996).

link = 5: Low-ell Planck EB power spectra (2 <= ell <= 29).

link = 6: Low-ell Planck BB power spectra (2 <= ell <= 29).

References

Planck Legacy Archive https://www.cosmos.esa.int/web/planck/pla

Examples

Run this code
## Requires internet access.
if (interactive()) {
  dest <- tempfile(fileext = ".txt")
  spectrum <- downloadCMBPS(link = 6, destfile = dest)
  unlink(dest)
  spectrum <- downloadCMBPS(link = 1, save = FALSE)
  plot(spectrum$L, spectrum$TT, type = "l")
}

Run the code above in your browser using DataLab