util - Miscellaneous Utilities

Functions

large_poisson(lam[, thresh])

Draw samples from a Poisson distribution, taking care of large values of lam.

large_gamma(lam, theta[, thresh])

Draw samples from a Gamma distribution, taking care of large values of lam.

make_emccd_noise(photo_electron_flux, ...)

Draw samples from a Poisson-Gamma-Normal distribution, which is an accurate model of EMCCDs (following [R57dca7afaa11-Hirsch2013]).

inverse_truncated(M[, rcond, svd])

Invert M truncating the number of modes.

inverse_truncated_modal(M, num_modes[, svd])

Invert M with num_modes modes.

inverse_tikhonov(M[, rcond, svd])

Invert M using Tikhonov regularization.

read_fits(filename[, extension])

Read an array from a fits file.

write_fits(data, filename[, shape, overwrite])

Write the data to a fits-file.

read_grid(filename[, fmt])

Read a grid from a file.

write_grid(grid, filename[, fmt, overwrite])

Write a grid to a file.

read_field(filename[, fmt])

Read a field from a file.

write_field(field, filename[, fmt, overwrite])

Write a field to a file.

read_mode_basis(filename[, fmt])

Read a mode basis from a file.

write_mode_basis(mode_basis, filename[, ...])

Write a mode basis to a file.

generate_convolution_matrix(grid, kernel)

Create the matrix that applies a convolution with kernel.

make_laplacian_matrix(grid)

Make the Laplacian operator using the 5-point stencil approximation

make_derivative_matrix(grid[, axis])

Make the derivative operator using the central difference approximation.

Classes

SpectralNoiseFactory(psd, output_grid)

SpectralNoise()

A spectral noise object.

SpectralNoiseFactoryFFT(psd, output_grid[, ...])

A spectral noise factory based on FFTs.

SpectralNoiseFFT(factory, C)

A single realization of FFT spectral noise.

SpectralNoiseFactoryMultiscale(psd, ...)

A spectral noise factory based on multiscale Fourier transforms.

SpectralNoiseMultiscale(factory, C_1, C_2)

A single realization of multiscale spectral noise.

SVD([matrix, num_modes, M])

The Singular Value Decomposition for the provided matrix.