Learn R Programming

cooltools (version 2.4)

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

296

Version

2.4

License

GPL-3

Maintainer

Danail Obreschkow

Last Published

July 18th, 2024

Functions in cooltools (2.4)

errlines

Draw a line with uncertainty regions
car2pol

Cartesian to polar/cylindrical coordinate conversion
dftgrid

Produce coordinates for Discrete Fourier Transform
car2sph

Cartesian to spherical coordinate conversion
.cooltools.env

Package environment
is.equal

Numerical equality check
approxfun2

Bilinear interpolation function of data on a regular grid
dpqr

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

Information entropy
makemovie

Produce a movie from frame-drawing function
cmplx2col

Convert complex numbers to color
cubehelix

Cube Helix colour palette
fibonaccisphere

Evenly distributed n points on a sphere
gradient

Compute gradient
colorbar

Vertical color bar
contourlevel

Find contour levels of a d-dimensional density field
mcintegral

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

Discrete Fourier Transform
kde2

Multi-dimensional adaptive kernel density estimation
cshift

Circularly shift each dimension of an array
jackknife

Jackknife Estimation
lim

Crop values to a custom range
inertia

Inertia tensor
stretch

Stretch values to a custom range
invert

Invert and shift colors of an image
landyszalay

Two-point correlation estimation
midseq

Mid-points of regular grid
last

Last element of a vector
loadbin

Read binary data into array
grf

Gaussian Random Field generator
nplot

Make empty plot area
linuxspaces

Handle spaces in Linux filenames
lightness

Change lightness of a color
mollweide

Mollweide projection
moments

Second moment tensor
subplot

Insert a sub-panel into plot
mutual

Mutual information of two random variables
rebindensity

Re-bin density histograms
rng

Random number generator for a custom d-dimensional distribution
cst

Scientific constants
paircount

Count the number of point-pairs in distance bins
smoothcontour

Draw smoothed contours
quiet

Suppress in-routine output
smoothfun

Smoothed Function
planckcolors

Planck CMB colour palette
runif2

Generate randomly oriented vectors in 2D
pdf2jpg

Convert pdf to jpg
runif3

Generate randomly oriented vectors in 3D
uniquedouble

Turn a 64-bit integer into a unique double value
wavelength2col

Convert wavelength to RGB
griddata

Distribute a point set onto a regular grid
makeframe

Display a single movie frame
ndft

Non-uniform Discrete Fourier Transform
ngon

Draw a regular n-gon
histcoord

Generate histogram coordinates from mid points
yinyangyong

Yin-Yang-Yong image
rasterflip

Flip array to be displayed with rasterImage()
unitvector

Normalize vectors to unit length
rotation2

2D rotation matrix
spectrumcolors

Spectrum colour palette
sph2car

Spherical to Cartesian coordinate conversion
tick

Start timer
rotation3

3D rotation matrix
tock

Stop timer
vectornorm

Vector norm
quadrupole

Quadrupole tensor
pol2car

Polar/cylindrical to Cartesian coordinate conversion
vectorproduct

Vector product
scalarproduct

Scalar product
sphereplot

Plot a spherical function or point set
sphericalharmonics

Spherical Harmonics
smartround

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

Add transparency to a color
transzoom

Zoom, translate and rotate array image
bindata

Bin two-dimensional data in one dimension
cooltools-package

Practical Tools for Scientific Computations and Visualizations
cosmofct

Fast cosmology conversion functions
alp

Associated Legendre Polynomials