cooltools2.18 package

Practical Tools for Scientific Computations and Visualizations

alp

Associated Legendre Polynomials

approxfun2

Bilinear interpolation function of data on a regular grid

bindata

Bin two-dimensional data in one dimension

car2pol

Cartesian to polar/cylindrical coordinate conversion

car2sph

Cartesian to spherical coordinate conversion

cmplx2col

Convert complex numbers to color

colorbar

Vertical color bar

contourlevel

Find contour levels of a d-dimensional density field

cooltools-package

Practical Tools for Scientific Computations and Visualizations

cosmofct

Fast cosmology conversion functions

cshift

Circularly shift each dimension of an array

cst

Scientific constants

cubehelix

Cube Helix colour palette

dft

Discrete Fourier Transform

dftgrid

Produce coordinates for Discrete Fourier Transform

dot-cooltools.env

Package environment

dpqr

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

entropy

Information entropy

errlines

Draw a line with uncertainty regions

error

Stop code and produce an error message

fibonaccisphere

Evenly distributed n points on a sphere

gradient

Compute gradient

grf

Gaussian Random Field generator

griddata

Distribute a point set onto a regular grid

histcoord

Generate histogram coordinates from mid points

inertia

Inertia tensor

invert

Invert and shift colors of an image

is.equal

Numerical equality check

jackknife

Jackknife Estimation

kde2

Multi-dimensional adaptive kernel density estimation

landyszalay

Two-point correlation estimation

last

Last element of a vector

lightness

Change lightness of a color

lim

Crop values to a custom range

linuxspaces

Handle spaces in Linux filenames

loadbin

Read binary data into array

makeframe

Display a single movie frame

makemovie

Produce a movie from frame-drawing function

mcintegral

Monte Carlo and Quasi-Monte Carlo integration in any dimension

midseq

Mid-points of regular grid

mollweide

Mollweide projection

moments

Second moment tensor

mutual

Mutual information of two random variables

ndft

Non-uniform Discrete Fourier Transform

ngon

Draw a regular n-gon

nplot

Make empty plot area

paircount

Count the number of point-pairs in distance bins

pdf2jpg

Convert pdf to jpg

planckcolors

Planck CMB colour palette

pol2car

Polar/cylindrical to Cartesian coordinate conversion

progress

Show progress while timer in running

quadrupole

Quadrupole tensor

quiet

Suppress console output

rasterflip

Flip array to be displayed with rasterImage()

readhdf5

Read data from an HDF5 file

rebindensity

Re-bin density histograms

rng

Random number generator for a custom d-dimensional distribution

rotation2

2D rotation matrix

rotation3

3D rotation matrix

runif2

Generate randomly oriented vectors in 2D

runif3

Generate randomly oriented vectors in 3D

scalarproduct

Scalar product

sigmoid

Sigmoid function

smartround

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

smoothcontour

Draw smoothed contours

smoothfun

Smoothed Function

sortlist

Sort List Entries Alphabetically

spectrumcolors

Spectrum colour palette

sph2car

Spherical to Cartesian coordinate conversion

sphereplot

Plot a spherical function or point set

sphericalharmonics

Spherical Harmonics

stretch

Stretch values to a custom range

subplot

Insert a sub-panel into plot

tick

Start timer

tock

Stop timer

transparent

Add transparency to a color

transzoom

Zoom, translate and rotate array image

uniquedouble

Map positive 64-bit integers onto unique doubles

unitvector

Normalize vectors to unit length

userattributes

Retrieve Custom Object Attributes

vectornorm

Vector norm

vectorproduct

Vector product

wavelength2col

Convert wavelength to RGB

writehdf5

Write structured list to an HDF5 file

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) <doi:10.1086/172900>), 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.

  • Maintainer: Danail Obreschkow
  • License: GPL-3
  • Last published: 2025-07-23