imUtil - EranOfek/AstroPack GitHub Wiki
Description
The imUtil package contains functions for image and catalog analysis. All the functions work directly on images in matrix format or catalogs in matrix format (i.e., functions that do not use classes like AstroImage). ImUtil contains low-level functions that are being used by the functions in imProc.
Sub packages
imUtil.art
Basic, low-level, tools for creating artificial images (See imUtil.art page).
imUtil.asteroids
Search moving sources in catalogs using KD-tree and generate MPC reports.
imUtil.background
Estimate background and variance of images.
- imUtil.background.annulus_filter - Apply annulus filters to an image
- imUtil.background.background - Estimate the background and its variance for an astronomical image
- imUtil.background.backgroundMeanColRow - Given an image and a background image, refine the background image
- imUtil.background.collapse_stat - Collapse an image on one dimension and calc line statistics
- imUtil.background.fill_sparse - given a list of sparse 2D positions and values, fill an image by interpolation.
- imUtil.background.flag_badcol - Flag a bad column/row in an image
- imUtil.background.mode - Mode and variance of a distribution
- imUtil.background.rmeanCol - Robust mean/median on rows or columns of a 2D array.
- imUtil.background.rstd - robust std (default is for a matrix) calculated using scaled iqr.
- imUtil.background.rstdL1 - Robust estimaror of sample std using L1 statustics (abs dev. from mean).
- imUtil.background.rvar - robust variance (default is for a matrix) calculated using scaled iqr.
- imUtil.background.subtractMeanColRow - Subtract the collapsed median of rows and columns from an image.
imUtil.calib
Photometric calibration of catalogs.
imUtil.cat
Catalog related functions.
imUtil.ccdsec
Catalogs for generating and reading the CCDSEC. CCDSEC is a vector of [Xmin Xmax Ymin Ymax].
- imUtil.ccdsec.ccdsec2str - Conver a CCDSEC [Xmin Xmax Ymin Ymax] to a string.
- imUtil.ccdsec.center_ccdsec - Calculate the [X, Y] centers of lines in CCDSEC
- imUtil.ccdsec.flag_ccdsec - Flag the pixels within or outside a ccd section
- imUtil.ccdsec.remove_edge_section - Remove a CCDSEC region located at an edge of another CCDSEC
- imUtil.ccdsec.selectNearEdges - construct a vector of matrix indices for pixels near the edge of the CCDSEC
- imUtil.ccdsec.trim_ccdsec - trim edges from a CCDSEC vector
imUtil.cut
Tools for cut/crop images.
- imUtil.cut.partition_subimage - Partition image into sub-images
- imUtil.cut.subimage_grid - Partition image size into a grid of sub-images
- imUtil.cut.subimages2image - construct the full image from sub-images
- imUtil.cut.trim - Trim an image or a cube using CCDSEC coordinates.
- imUtil.cut.image_partitioning - Partition a 2D image into sub-images. OBSOLETE: use
- imUtil.cut.subimage_boundries - Define boundaries (CCDSEC) for image subsections.
imUtil.dimm
Tools for DIMM analysis.
imUtil.filter
Filtering, convolution, and auto-correlation of 2D images.
Convolution
- conv2_fast - Convolution of a 2D image with a kernel. The function uses either direction convolution (i.e., using MATLAB conv2 function), or using fft. The fft convolution is implemented in imUtil.filter.conv2_fft.
- conv2_fft - Convolution using fft.
- conv2_nan - 2D convolution ignoring NaNs in the first input matrix.
- conv2_svd - Fast 2-D convolution using SVD approximation.
Cross-correlation
- filter2_fast - Filtering of a 2D image with a kernel. The function uses either direction convolution (i.e., using MATLAB conv2 function), or using fft. The fft convolution is implemented in imUtil.filter.filter2_fft.
- filter2_fft - Filtering using fft.
- filter2_fftfft - Filtering using fft, where the inputs may be ffted.
- filter2_sn - Filter an image with a PSF and calculate the S/N and Flux estimators
- filter2_snBank - Filter an image with a bank of PSFs and calculate the S/N and Flux estimators
- filter2_var - Calculate the variance and mean filter of an image.
- filter_sources - Generate a background image filtered from sources using successive filtering
- xcorr2_fft - Cross-correlation of two matrices using fft, and search local maxima.
Additional functions
- autocor - Autocorrelation of a matrix.
- crdetect_lacos - Cosmic ray detection using an algorithm similar to LACOS
- imlaplacian - Laplacian filter.
- threshold_fluctuations - Estimate the number of random events above a threshold.
- unpad_array - unpad array.
imUtil.headerCell
Manipulate header-like information contains in a 3-columns cell array.
- imUtil.headerCell.cellhead2struct - convert a 3-column cell array containing a header into a structure.
- imUtil.headerCell.deleteKey - delete lines with specific keys
- imUtil.headerCell.getByKey - get keyword value from a header in a cell format
- imUtil.headerCell.getIndKey - get a cell array in which each cell contains the indices of the found keys in the cell-header.
- imUtil.headerCell.getValBySynonym - Return the first key/val in the list of synonyms that appears in the cell-header.
- imUtil.headerCell.insertKey - Insert key/val into a header in cell array format
- imUtil.headerCell.replaceKey - Replace cell-header keywords and values, or add if doesn't exist
- imUtil.headerCell.replace_illegal_char - replace illegal characters in keyword names (e.g. '-').
- imUtil.headerCell.uniqueKey - Remove non-unique keywords from a cell header
- imUtil.headerCell.updateCellFromStruct - update cell header by adding elements in struct not in the header
imUtil.image
imUtil.interactive
imUtil.interp
imUtil.kernel2
Functions for generating 2-D kernels (e.g., Gaussian, box, annulus). The functions can generate multiple kernels of the same type simultaneously. For example, Gaussians with different sigma-width.
- imUtil.kernel2.annulus - create a matrix or a cube of 2D normalized annulus shape in each image
- imUtil.kernel2.box - Generate a box kernel
- imUtil.kernel2.circ - create a matrix or a cube of 2D normalized corcular shape in each image
- imUtil.kernel2.gauss - create a matrix or a cube of 2D normalized Gaussians
- imUtil.kernel2.lanczos - create a matrix or a cube of 2D normalized lanczis filter in each image
- imUtil.kernel2.line - create a matrix or a cube of 2D normalized corcular shape in each image
- imUtil.kernel2.sersic - create a matrix or a cube of 2D normalized Sersic functions
- imUtil.kernel2.unitTest - Package Unit-Test
imUtil.patternMatch
imUtil.poissNoise
imUtil.proj
imUtil.properCoadd
imUtil.properSub
Basic tools implemeting the ZOGY image subtraction, and Translient motion detector (See imUtil.properSub page).
imUtil.psf
Basic tools for constructing, manipulating and fitting Point Spread Functions (PSFs). This tools are used by functions in imProc.psf, imProc.sources, and AstroPSF. (See imUtil.psf page).