Unlimited learning, half price | 50% off
Get 50% off unlimited learning

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.

Publication

Daniel Fryer, Ming Li and Andriy Olenko, rcosmo: R Package for Analysis of Spherical, HEALPix and Cosmological Data, The R Journal (2020) 12:1, pages 206-225.

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

22

Version

1.1.3

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Fryer

Last Published

December 1st, 2021

Functions in rcosmo (1.1.3)

assumedConvex

Check if a CMBWindow is assumed convex.
coords<-.data.frame

assumedUniquePix

Check if object was assumed to have unique HEALPix indices
coords.HPDataFrame

coords<-

Coordinate conversion generic
coords

Coordinate conversion generic
assumedConvex<-

as.CMBDataFrame

Convert objects to CMBDataFrame
children

Return children of a pixel
is.CMBDat

Check if an object is of class CMBDat
chi2CMB

coords.data.frame

Create a new data.frame with a given coordinate system
cbind.CMBDataFrame

cbind for CMBDataFrames
CMBDat

CMBDat class
covmodelCMB

Computes values of covariance functions
coords<-.CMBDataFrame

corrCMB

Sample correlation function
displayPixelBoundaries

Plot HEALPix pixel boundaries
extrCMB

Extreme values
exprob

Threshold exceedance probability
minDist

Get the minimum geodesic distance between points
geoDist

Geodesic distance on the unit sphere
header

coords<-.CMBWindow

Assign new coordinate system to CMBWindow
CMBDataFrame

CMBDataFrame class
minDist2nside

minDist2nside
geo2sph

Convert geographic to spherical coordinates
geoAngle

Angle between two spherical directions
coords.CMBWindow

coords<-.HPDataFrame

coords.CMBDataFrame

is.CMBDataFrame

Check if an object is of class CMBDataFrame
linesCMB

Adds lines of fitted variograms to variogram plots
nside.CMBDataFrame

HEALPix Nside parameter from a CMBDataFrame
ancestor

Return index of kth ancestor pixel
jacobiPol

Calculate Jacobi polynomial values
areCompatibleCMBDFs

Check compatibleness of CMBDataFrames
pix.CMBDataFrame

plot.CMBCorrelation

Plot sample CMBCorrelation
ordering.CMBDataFrame

HEALPix ordering scheme from a CMBDataFrame
print.summary.HPDataFrame

Print a summary of a HPDataFrame
ordering.HPDataFrame

HEALPix ordering scheme from a HPDataFrame
plot.CMBCovariance

Plot sample CMBCovariance
nside.HPDataFrame

pwSpCorr

Power spectra estimate via correlation
ibp2p

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

nside generic
maxWindowDist

healpixCentered

Check if object is assumed to have HEALPix centered coordinates
downloadCMBMap

Download CMB Maps from Planck Public Data Release.
maxDist

Get the maximum geodesic distance between points
displayPixels

Display the pixels and grandchildren
CMBWindow

CMBWindow class.
baseNeighbours

Return neighbours of base pixels
qqplotWin

summary.CMBWindow

qqnormWin

summary.CMBDataFrame

covPwSp

Covariance estimate via power spectra
covCMB

Sample covariance function
borderPattern

Border pattern is resolution independent
fRen

Sample Renyi function
numeric2col

numeric2col
fmf

First Minkowski functional
geoArea.HPDataFrame

ordering<-.CMBDataFrame

ordering

ordering generic
onBPBoundary

a version of onBPBoundary to use with neighbours
p2bp

Return base pixel to which pixel belongs
downloadCMBPS

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

HPDataFrame

HPDataFrame class
entropyCMB

CMB Entropy
is.CMBWindow

Check if an object is a CMBWindow
geoArea

geoArea generic
plotvariogram

Plot theoretical variogram
practicalRangeCMB

Practical range for covariance function
pix.HPDataFrame

geoArea.CMBWindow

plot.CMBWindow

plot.CMBDataFrame

Plot CMB Data
summary.HPDataFrame

triangulate

window.data.frame

Get a sub window from a data.frame
window.HPDataFrame

winType<-

winType

Get/change winType
ring2nest

Convert ring to nest ordering.
sampleCMB

neighbours

Return neighbouring pixels
nest2ring

Convert nest to ring ordering
ordering<-

ordering generic
pixelArea

Area of a HEALPix pixel
ordering<-.HPDataFrame

Assign new ordering scheme to HPDataFrame
window

window generic
plot.variogram

Plot sample variogram
p2ibp

Return pixel index within its base pixel
parent

Return index of parent pixel
plot.HPDataFrame

Plot HPDataFrame
pixelWindow

Find high resolution pixels falling in a lower resolution window
plotAngDis

Plot angular scatterplots and means
plotcovmodelCMB

Plot theoretical CMBCovariance
print.summary.CMBDataFrame

Print a summary of a CMBDataFrame
separatingNside

separatingNside
print.summary.CMBWindow

siblings

Return siblings of pixel
nestSearch

Finds the closest pixel center to a point
pix<-.CMBDataFrame

Assign new pixel indices to a CMBDataFrame
is.HPDataFrame

nestSearch_step

nestSearch_step
rcosmo

Handling and Analysing CMB data
resolution

window.CMBDataFrame

window.CMBDat

subWindow

subWindow
sphericalHarmonics

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

q-statistic
print.CMBDataFrame

Print CMBDataFrame
pix

pix generic
pix2coords

Convert pixel indices to cartesian/spherical coordinates
rbind.CMBDataFrame

rbind for CMBDataFrames
print.HPDataFrame

pix<-

pix generic
variofitCMB

Estimates parameters of variograms
window<-.CMBDataFrame

variogramCMB

Sample variogram
window<-

window generic