Learn R Programming

cooltools (version 2.18)

Practical Tools for Scientific Computations and Visualizations

Description

Collection of routines for efficient scientific computations in physics and astrophysics. These routines include utility functions, numerical computation tools, as well as visualisation tools. They can be used, for example, for generating random numbers from spherical and custom distributions, information and entropy analysis, special Fourier transforms, two-point correlation estimation (e.g. as in Landy & Szalay (1993) ), binning & gridding of point sets, 2D interpolation, Monte Carlo integration, vector arithmetic and coordinate transformations. Also included is a non-exhaustive list of important constants and cosmological conversion functions. The graphics routines can be used to produce and export publication-ready scientific plots and movies, e.g. as used in Obreschkow et al. (2020, MNRAS Vol 493, Issue 3, Pages 4551–4569). These routines include special color scales, projection functions, and bitmap handling routines.

Copy Link

Version

Install

install.packages('cooltools')

Monthly Downloads

411

Version

2.18

License

GPL-3

Maintainer

Danail Obreschkow

Last Published

July 23rd, 2025

Functions in cooltools (2.18)

entropy

Information entropy
dpqr

d/p/q/r-family for a custom distribution
alp

Associated Legendre Polynomials
cooltools-package

Practical Tools for Scientific Computations and Visualizations
cosmofct

Fast cosmology conversion functions
errlines

Draw a line with uncertainty regions
dft

Discrete Fourier Transform
dftgrid

Produce coordinates for Discrete Fourier Transform
colorbar

Vertical color bar
makeframe

Display a single movie frame
approxfun2

Bilinear interpolation function of data on a regular grid
griddata

Distribute a point set onto a regular grid
grf

Gaussian Random Field generator
error

Stop code and produce an error message
makemovie

Produce a movie from frame-drawing function
jackknife

Jackknife Estimation
planckcolors

Planck CMB colour palette
kde2

Multi-dimensional adaptive kernel density estimation
landyszalay

Two-point correlation estimation
fibonaccisphere

Evenly distributed n points on a sphere
last

Last element of a vector
gradient

Compute gradient
paircount

Count the number of point-pairs in distance bins
contourlevel

Find contour levels of a d-dimensional density field
pol2car

Polar/cylindrical to Cartesian coordinate conversion
runif2

Generate randomly oriented vectors in 2D
sigmoid

Sigmoid function
spectrumcolors

Spectrum colour palette
rotation3

3D rotation matrix
sortlist

Sort List Entries Alphabetically
pdf2jpg

Convert pdf to jpg
tock

Stop timer
smartround

Round a vector of floating-point values while preserving their sum
transparent

Add transparency to a color
inertia

Inertia tensor
linuxspaces

Handle spaces in Linux filenames
cshift

Circularly shift each dimension of an array
cst

Scientific constants
loadbin

Read binary data into array
sph2car

Spherical to Cartesian coordinate conversion
rasterflip

Flip array to be displayed with rasterImage()
quiet

Suppress console output
mutual

Mutual information of two random variables
sphereplot

Plot a spherical function or point set
transzoom

Zoom, translate and rotate array image
uniquedouble

Map positive 64-bit integers onto unique doubles
histcoord

Generate histogram coordinates from mid points
.cooltools.env

Package environment
ndft

Non-uniform Discrete Fourier Transform
readhdf5

Read data from an HDF5 file
invert

Invert and shift colors of an image
rebindensity

Re-bin density histograms
runif3

Generate randomly oriented vectors in 3D
scalarproduct

Scalar product
yinyangyong

Yin-Yang-Yong image
smoothcontour

Draw smoothed contours
wavelength2col

Convert wavelength to RGB
is.equal

Numerical equality check
sphericalharmonics

Spherical Harmonics
stretch

Stretch values to a custom range
midseq

Mid-points of regular grid
rng

Random number generator for a custom d-dimensional distribution
mcintegral

Monte Carlo and Quasi-Monte Carlo integration in any dimension
vectorproduct

Vector product
mollweide

Mollweide projection
subplot

Insert a sub-panel into plot
rotation2

2D rotation matrix
moments

Second moment tensor
lightness

Change lightness of a color
ngon

Draw a regular n-gon
lim

Crop values to a custom range
nplot

Make empty plot area
progress

Show progress while timer in running
quadrupole

Quadrupole tensor
vectornorm

Vector norm
tick

Start timer
smoothfun

Smoothed Function
unitvector

Normalize vectors to unit length
userattributes

Retrieve Custom Object Attributes
writehdf5

Write structured list to an HDF5 file
car2pol

Cartesian to polar/cylindrical coordinate conversion
bindata

Bin two-dimensional data in one dimension
cubehelix

Cube Helix colour palette
cmplx2col

Convert complex numbers to color
car2sph

Cartesian to spherical coordinate conversion