Learn R Programming

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

Archived by CRAN

This package was recently archived by CRAN due to a temporary difficulty contacting the maintainer of geoR. The maintainer of geoR has now responded, so rcosmo will be back on CRAN soon.

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.2

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Fryer

Last Published

February 14th, 2020

Functions in rcosmo (1.1.2)

CMBDat

CMBDat class
assumedConvex

Check if a CMBWindow is assumed convex.
ancestor

Return index of \(k\)th ancestor pixel
as.CMBDataFrame

Convert objects to CMBDataFrame
CMBWindow

CMBWindow class.
assumedUniquePix

Check if object was assumed to have unique HEALPix indices
CMBDataFrame

CMBDataFrame class
areCompatibleCMBDFs

Check compatibleness of CMBDataFrames
assumedConvex<-

HPDataFrame

HPDataFrame class
baseNeighbours

Return neighbours of base pixels
cbind.CMBDataFrame

cbind for CMBDataFrames
coords<-.data.frame

chi2CMB

coords<-

Coordinate conversion generic
coords.CMBWindow

coords.CMBDataFrame

geo2sph

Convert geographic to spherical coordinates
geoAngle

Angle between two spherical directions
borderPattern

Border pattern is resolution independent
children

Return children of a pixel
coords.HPDataFrame

coords<-.CMBWindow

Assign new coordinate system to CMBWindow
coords<-.CMBDataFrame

corrCMB

Sample correlation function
downloadCMBPS

Download CMB Power Spectra from Planck Legacy Archive.
coords.data.frame

Create a new data.frame with a given coordinate system
coords<-.HPDataFrame

entropyCMB

CMB Entropy
geoArea.HPDataFrame

covmodelCMB

Computes values of covariance functions
covCMB

Sample covariance function
covPwSp

Covariance estimate via power spectra
geoArea

geoArea generic
displayPixels

Display the pixels and grandchildren
linesCMB

Adds lines of fitted variograms to variogram plots
downloadCMBMap

Download CMB Maps from Planck Public Data Release.
jacobiPol

Calculate Jacobi polynomial values
is.CMBDataFrame

Check if an object is of class CMBDataFrame
displayPixelBoundaries

Plot HEALPix pixel boundaries
is.CMBDat

Check if an object is of class CMBDat
nside

nside generic
maxDist

Get the maximum geodesic distance between points
fmf

First Minkowski functional
fRen

Sample Renyi function
numeric2col

numeric2col
p2ibp

Return pixel index within its base pixel
geoArea.CMBDataFrame

geoArea.CMBWindow

maxWindowDist

parent

Return index of parent pixel
geoDist

Geodesic distance on the unit sphere
header

plot.CMBCorrelation

Plot sample CMBCorrelation
nestSearch

Finds the closest pixel center to a point
minDist

Get the minimum geodesic distance between points
minDist2nside

minDist2nside
plot.CMBCovariance

Plot sample CMBCovariance
coords

Coordinate conversion generic
plotAngDis

Plot angular scatterplots and means
nestSearch_step

nestSearch_step
plotcovmodelCMB

Plot theoretical CMBCovariance
qqplotWin

qqnormWin

neighbours

Return neighbouring pixels
nest2ring

Convert nest to ring ordering
ordering.CMBDataFrame

HEALPix ordering scheme from a CMBDataFrame
ordering.HPDataFrame

HEALPix ordering scheme from a HPDataFrame
ordering<-.CMBDataFrame

onBPBoundary

a version of onBPBoundary to use with neighbours
ordering

ordering generic
p2bp

Return base pixel to which pixel belongs
sphericalHarmonics

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

pix generic
ordering<-.HPDataFrame

Assign new ordering scheme to HPDataFrame
pix2coords

Convert pixel indices to cartesian/spherical coordinates
pixelArea

Area of a HEALPix pixel
qstat

q-statistic
rbind.CMBDataFrame

rbind for CMBDataFrames
print.CMBDataFrame

Print CMBDataFrame
pixelWindow

Find high resolution pixels falling in a lower resolution window
print.summary.CMBDataFrame

Print a summary of a CMBDataFrame
ordering<-

ordering generic
print.summary.CMBWindow

variogramCMB

Sample variogram
variofitCMB

Estimates parameters of variograms
print.HPDataFrame

rcosmo

Handling and Analysing CMB data
resolution

exprob

Threshold exceedance probability
extrCMB

Extreme values
pix<-.CMBDataFrame

Assign new pixel indices to a CMBDataFrame
pix<-

pix generic
plot.HPDataFrame

Plot HPDataFrame
plotvariogram

Plot theoretical variogram
window.HPDataFrame

plot.variogram

Plot sample variogram
practicalRangeCMB

Practical range for covariance function
ring2nest

Convert ring to nest ordering.
summary.CMBDataFrame

is.HPDataFrame

ibp2p

Computes pixel's index using its subindex within base resolution
is.CMBWindow

Check if an object is a CMBWindow
healpixCentered

Check if object is assumed to have HEALPix centered coordinates
nside.CMBDataFrame

HEALPix Nside parameter from a CMBDataFrame
nside.HPDataFrame

pix.CMBDataFrame

pix.HPDataFrame

plot.CMBDataFrame

Plot CMB Data
pwSpCorr

Power spectra estimate via correlation
siblings

Return siblings of pixel
plot.CMBWindow

subWindow

subWindow
sampleCMB

print.summary.HPDataFrame

Print a summary of a HPDataFrame
window

window generic
summary.CMBWindow

separatingNside

separatingNside
window.data.frame

Get a sub window from a data.frame
triangulate

window.CMBDat

summary.HPDataFrame

window.CMBDataFrame

window<-.CMBDataFrame

winType

Get/change winType
window<-

window generic
winType<-