rcosmo v1.1.2


Monthly downloads



Cosmic Microwave Background Data Analysis

Handling and Analysing Spherical, HEALPix and Cosmic Microwave Background data on a HEALPix grid.


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.

Travis-CI Build Status CRAN Versions CRAN release dates CRAN downloads CRAN downloads Lifecycle Status

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.


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.


From CRAN:

## Uncomment to install



View the CMBDataFrame help file:


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:

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

Produce a summary of the map:


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:


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


Functions in rcosmo

Name Description
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<- Change the assumedConvex boolean of a CMBWindow
HPDataFrame HPDataFrame class
baseNeighbours Return neighbours of base pixels
cbind.CMBDataFrame cbind for CMBDataFrames
coords<-.data.frame Assign new coordinate system to a data.frame
chi2CMB Chi-squared statistic for two CMBWindows
coords<- Coordinate conversion generic
coords.CMBWindow Coordinate system from a CMBWindow
coords.CMBDataFrame Coordinate system from a 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 Coordinate system from a HPDataFrame
coords<-.CMBWindow Assign new coordinate system to CMBWindow
coords<-.CMBDataFrame Assign new coordinate system to a 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 Assign new coordinate system to a HPDataFrame
entropyCMB CMB Entropy
geoArea.HPDataFrame Geodesic area covered by a 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 Geodesic area covered by a CMBDataFrame
geoArea.CMBWindow Geodesic area of a CMBWindow
maxWindowDist Get the maximum distance between all points in a CMBWindow
parent Return index of parent pixel
geoDist Geodesic distance on the unit sphere
header Get the FITS headers from a CMBDataFrame
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 Quantile-Quantile plots for CMBWindows
qqnormWin Normal QQ plot for CMBWindow
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 Assign a new ordering scheme to a 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 Print a summary of a CMBWindow
variogramCMB Sample variogram
variofitCMB Estimates parameters of variograms
print.HPDataFrame Print a HPDataFrame
rcosmo Handling and Analysing CMB data
resolution Get the arcmin resolution from a CMBDataFrame
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 Get a sub window from a HPDataFrame
plot.variogram Plot sample variogram
practicalRangeCMB Practical range for covariance function
ring2nest Convert ring to nest ordering.
summary.CMBDataFrame Summarise a CMBDataFrame
is.HPDataFrame Check if an object is of class 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 HEALPix Nside parameter from a HPDataFrame
pix.CMBDataFrame HEALPix pixel indices from CMBDataFrame
pix.HPDataFrame HEALPix pixel indices from HPDataFrame
plot.CMBDataFrame Plot CMB Data
pwSpCorr Power spectra estimate via correlation
siblings Return siblings of pixel
plot.CMBWindow Visualise a CMBWindow
subWindow subWindow
sampleCMB Take a simple random sample from a CMBDataFrame
print.summary.HPDataFrame Print a summary of a HPDataFrame
window window generic
summary.CMBWindow Summarise a CMBWindow
separatingNside separatingNside
window.data.frame Get a sub window from a data.frame
triangulate Triangulate a polygonal CMBWindow
window.CMBDat Get a sub window from a CMBDat object
summary.HPDataFrame Summarise a HPDataFrame
window.CMBDataFrame Get a sub window from CMBDataFrame
window<-.CMBDataFrame Assign a new CMBWindow to a CMBDataFrame
winType Get/change winType
window<- window generic
winType<- Assign new winType to a CMBWindow
No Results!

Last month downloads


URL https://github.com/frycast/rcosmo
BugReports https://github.com/frycast/rcosmo/issues
License GPL-3 | file LICENSE
Encoding UTF-8
LazyData true
LinkingTo Rcpp
RoxygenNote 6.1.1
NeedsCompilation yes
Packaged 2020-02-14 09:49:52 UTC; Doony
Repository CRAN
Date/Publication 2020-02-14 10:50:02 UTC

Include our badge in your README