Learn R Programming

⚠️There's a newer version (1.1.3) of this package.Take me there.

rcosmo: Handle and Analyse Spherical, HEALPix and Cosmic Microwave Background data on a HEALPix grid.

Use this R package as an advanced toolkit for performing Cosmic Microwave Background (CMB) data analytics. The CMB is remnant electromagnetic radiation from the epoch of recombination. As an ancient source of data on the early universe, the CMB is helping us unlock the mysteries of the Big Bang and the structure of time and space. With increasingly high resolution satellite data, intensive investigations in the past few years have resulted in many physical and mathematical results to characterize CMB radiation.

Features

rcosmo addresses various data processing and statistical analysis needs for the present generation of CMB experiments. These needs fall into the following broad categories:

  • Importing and transforming HEALPix data in convenient CMBDataFrame class objects,
  • Geometric tools suited to spherical geometry,
  • Statistical tools suited to spherical random fields,
  • Interactive visualisation.

The current version of rcosmo includes the following functionality:

  • Tidy organisation of CMB data, including HEALPix indices, metadata, CMB intensities and their

corresponding spherical and/or cartesian coordinates, as well as polarization data,

  • window subsetting tools for investigating circular, convex and non-convex polygonal sub-regions on the sphere,
  • fast empirical covariance and variogram estimation,
  • implementation and analysis of spherical harmonics, spherical wavelets, etc,
  • various methods for CMB map visualization, such as interactive 3D full sky maps rendered with OpenGL, polygon boundary visualisation, and HEALPix pixel boundary plotting,
  • spherical geometry tools, such as calculation of spherical angles, shortest distance between a point and a region, and shortest distance between two points, etc.

Installation

From CRAN:

## Uncomment to install
#install.packages('rcosmo')

Usage

library(rcosmo)

View the CMBDataFrame help file:

?CMBDataFrame

Download a CMB map from NASA archives (which may take some time to download). Then, take an approximately uniform random sample and create an interactive 3D plot:

downloadCMBMap()
sky <- CMBDataFrame("CMB_map_smica1024.fits", sample.size = 1e6)
plot(sky)

Produce a summary of the map:

summary(sky)

Extract a region of the sky:

win <- CMBWindow(theta = c(pi/2,pi/2,pi/3, pi/3), phi = c(0,pi/3,pi/3,0))
sky_win <- window(sky, new.window = win)
plot(sky_win); plot(win)

Summarise the region of the sky:

summary(sky_win)

More documentation on the way, for now view examples in the help files. There are many functions, see:

lsf.str("package:rcosmo")

Copy Link

Version

Install

install.packages('rcosmo')

Monthly Downloads

36

Version

1.1.0

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Fryer

Last Published

June 2nd, 2019

Functions in rcosmo (1.1.0)

CMBDat

CMBDat class
areCompatibleCMBDFs

Check compatibleness of CMBDataFrames
CMBDataFrame

CMBDataFrame class
CMBWindow

CMBWindow class.
ancestor

Return index of \(k\)th ancestor pixel
assumedConvex

Check if a CMBWindow is assumed convex.
HPDataFrame

HPDataFrame class
assumedConvex<-

as.CMBDataFrame

Convert objects to CMBDataFrame
assumedUniquePix

Check if object was assumed to have unique HEALPix indices
geo2sph

Convert geographic to spherical coordinates
geoArea.HPDataFrame

children

Return children of a pixel
coords.CMBWindow

coords.CMBDataFrame

geoArea

geoArea generic
coords<-.CMBDataFrame

geoAngle

Angle between two spherical directions
cbind.CMBDataFrame

cbind for CMBDataFrames
coords<-.CMBWindow

Assign new coordinate system to CMBWindow
minDist

Get the minimum geodesic distance between points
borderPattern

Border pattern is resolution independent
covPwSp

Covariance estimate via power spectra
baseNeighbours

Return neighbours of base pixels
covCMB

Sample covariance function
geoArea.CMBDataFrame

geoArea.CMBWindow

fmf

First Minkowski functional
fRen

Sample Renyi function
chi2CMB

covmodelCMB

Computes values of covariance functions
minDist2nside

minDist2nside
onBPBoundary

a version of onBPBoundary to use with neighbours
maxDist

Get the maximum geodesic distance between points
ordering

ordering generic
p2bp

Return base pixel to which pixel belongs
ordering<-.CMBDataFrame

plot.CMBCorrelation

Plot sample CMBCorrelation
coords<-.data.frame

coords.data.frame

Create a new data.frame with a given coordinate system
numeric2col

numeric2col
pix2coords

Convert pixel indices to cartesian/spherical coordinates
pix

pix generic
coords<-

Coordinate conversion generic
nside

nside generic
pix.HPDataFrame

pix.CMBDataFrame

maxWindowDist

plot.CMBCovariance

Plot sample CMBCovariance
displayPixelBoundaries

Plot HEALPix pixel boundaries
downloadCMBPS

Download CMB Power Spectra from Planck Legacy Archive.
is.CMBDataFrame

Check if an object is of class CMBDataFrame
linesCMB

Adds lines of fitted variograms to variogram plots
is.CMBDat

Check if an object is of class CMBDat
corrCMB

Sample correlation function
downloadCMBMap

Download CMB Maps from Planck Public Data Release.
jacobiPol

Calculate Jacobi polynomial values
displayPixels

Display the pixels and grandchildren
coords<-.HPDataFrame

entropyCMB

CMB Entropy
nside.CMBDataFrame

HEALPix Nside parameter from a CMBDataFrame
print.summary.HPDataFrame

Print a summary of a HPDataFrame
pwSpCorr

Power spectra estimate via correlation
qqnormWin

p2ibp

Return pixel index within its base pixel
nside.HPDataFrame

parent

Return index of parent pixel
qqplotWin

summary.CMBDataFrame

plot.HPDataFrame

Plot HPDataFrame
summary.CMBWindow

coords.HPDataFrame

rcosmo

Handling and Analysing CMB data
print.summary.CMBWindow

print.summary.CMBDataFrame

Print a summary of a CMBDataFrame
sphericalHarmonics

Compute spherical harmonic values at given points on the sphere.
resolution

exprob

Threshold exceedance probability
extrCMB

Extreme values
coords

Coordinate conversion generic
healpixCentered

Check if object is assumed to have HEALPix centered coordinates
subWindow

subWindow
ibp2p

Computes pixel's index using its subindex within base resolution
nestSearch

Finds the closest pixel center to a point
neighbours

Return neighbouring pixels
nest2ring

Convert nest to ring ordering
pixelArea

Area of a HEALPix pixel
nestSearch_step

nestSearch_step
pix<-.CMBDataFrame

Assign new pixel indices to a CMBDataFrame
pix<-

pix generic
plot.variogram

Plot sample variogram
pixelWindow

Find high resolution pixels falling in a lower resolution window
plotAngDis

Plot angular scatterplots and means
geoDist

Geodesic distance on the unit sphere
plotvariogram

Plot theoretical variogram
window<-.CMBDataFrame

window<-

window generic
qstat

q-statistic
practicalRangeCMB

Practical range for covariance function
rbind.CMBDataFrame

rbind for CMBDataFrames
winType

Get/change winType
winType<-

header

window.data.frame

Get a sub window from a data.frame
ordering<-.HPDataFrame

Assign new ordering scheme to HPDataFrame
is.CMBWindow

Check if an object is a CMBWindow
is.HPDataFrame

ordering.HPDataFrame

HEALPix ordering scheme from a HPDataFrame
ordering<-

ordering generic
ordering.CMBDataFrame

HEALPix ordering scheme from a CMBDataFrame
print.CMBDataFrame

Print CMBDataFrame
plot.CMBDataFrame

Plot CMB Data
plot.CMBWindow

print.HPDataFrame

plotcovmodelCMB

Plot theoretical CMBCovariance
separatingNside

separatingNside
siblings

Return siblings of pixel
ring2nest

Convert ring to nest ordering.
sampleCMB

variofitCMB

Estimates parameters of variograms
window.CMBDataFrame

variogramCMB

Sample variogram
window.CMBDat

window

window generic
window.HPDataFrame

summary.HPDataFrame

triangulate