Configuration Reference

This page details all the tunable parameters for the HOTPANTS algorithm, which are managed through the HotpantsConfig class.

class hotpants.config.HotpantsConfig(**kwargs)

Configuration class for HOTPANTS parameters.

This class holds all the tunable parameters for the HOTPANTS algorithm, mirroring the command-line flags of the original C implementation. Default values are set to match the original code.

An instance of this class is created by the Hotpants object, but a custom, pre-configured instance can also be passed during initialization.

tuthresh

Upper valid data count for the template. (Default: dynamically set to max value).

Type:

float

tuktresh

Upper valid data count for kernel fitting on the template. (Default: Same as tuthresh).

Type:

float

tlthresh

Lower valid data count for the template. (Default: dynamically set to min value).

Type:

float

tgain

Gain in template (e-/ADU). (Default: 1.0).

Type:

float

trdnoise

Read noise in template (e-). (Default: 0.0).

Type:

float

tpedestal

ADU pedestal in template. (Default: 0.0).

Type:

float

iuthresh

Upper valid data count for the image. (Default: dynamically set to max value).

Type:

float

iuktresh

Upper valid data count for kernel fitting on the image. (Default: Same as iuthresh).

Type:

float

ilthresh

Lower valid data count for the image. (Default: dynamically set to min value).

Type:

float

igain

Gain in image (e-/ADU). (Default: 1.0).

Type:

float

irdnoise

Read noise in image (e-). (Default: 0.0).

Type:

float

ipedestal

ADU pedestal in image. (Default: 0.0).

Type:

float

rkernel

Convolution kernel half-width in pixels. (Default: 10).

Type:

int

ko

Spatial order of kernel variation within a region. (Default: 2).

Type:

int

bgo

Spatial order of background variation within a region. (Default: 1).

Type:

int

fitthresh

RMS threshold for good centroids in kernel fit. (Default: 20.0).

Type:

float

nss

Number of centroids (sub-stamps) to use for each stamp. (Default: 3).

Type:

int

rss

Half-width of sub-stamps to extract around each centroid. (Default: 15).

Type:

int

ks

High sigma rejection for bad stamps in the kernel fit. (Default: 2.0).

Type:

float

kfm

Fraction of absolute kernel sum for a pixel to be considered ‘OK’. (Default: 0.990).

Type:

float

stat_sig

Threshold for sigma clipping statistics. (Default: 3.0).

Type:

float

kf_spread_mask1

Fraction of kernel half-width to spread input masks by. (Default: 1.0).

Type:

float

verbose

Level of verbosity, 0-2. (Default: 1).

Type:

int

force_convolve

Force convolution on ‘t’ (template) or ‘i’ (image). ‘b’ for best. (Default: ‘b’).

Type:

str

normalize

Normalize to ‘t’ (template), ‘i’ (image), or ‘u’ (unconvolved). (Default: ‘t’).

Type:

str

fom

Figure-of-merit for choosing convolution direction: ‘v’ (variance), ‘s’ (sigma), or ‘h’ (histogram). (Default: ‘v’).

Type:

str

fillval

Value for invalid (bad) pixels in the difference image. (Default: 1.0e-30).

Type:

float

fillval_noise

Value for invalid pixels in the noise image. (Default: 0.0).

Type:

float

rescale_ok

If True, rescale noise for ‘OK’ pixels. (Default: False).

Type:

bool

conv_var

If True, convolve variance instead of noise. (Default: False).

Type:

bool

use_pca

If True, use PCA to model the kernel basis. (Default: False).

Type:

bool

nstampx

Number of stamps to place in the x-direction per region. (Default: 10).

Type:

int

nstampy

Number of stamps to place in the y-direction per region. (Default: 10).

Type:

int

output_file

Path to save the difference FITS image. (Default: None).

Type:

str

noise_image_file

Path to save the noise FITS image. (Default: None).

Type:

str

mask_image_file

Path to save the mask FITS image. (Default: None).

Type:

str

convolved_image_file

Path to save the convolved FITS image. (Default: None).

Type:

str

sigma_image_file

Path to save the sigma (difference/noise) FITS image. (Default: None).

Type:

str

stamp_region_file

Path to save the DS9 region file of stamps. (Default: None).

Type:

str

Kernel composition parameters
-----------------------------
The following parameters control how the convolution kernel is constructed
from a sum of Gaussians. They mirror the `-ng` style flags in the
original HOTPANTS tool and are passed through to the C layer where the
kernel basis is built.
ngauss

Number of Gaussian components which compose the kernel. Defaults to 3. Each Gaussian has an associated polynomial degree and a sigma (width) value.

Type:

int

deg_fixe

Polynomial degrees associated with each Gaussian component. Length should equal ngauss. Default: [6, 4, 2]. Each entry is the maximum polynomial degree for that Gaussian basis.

Type:

List[int]

sigma_gauss

Widths (sigma) of each Gaussian component in pixels. Length should equal ngauss. Default: [0.7, 1.5, 3.0].

Type:

List[float]

Note

The following parameters from the original HOTPANTS are not implemented in this wrapper: - scale_fitthresh (-sft): Logic to scale fitthresh is not used. - min_frac_stamps (-nft): Check for minimum fraction of filled stamps is not used. - nregx and nregy: The wrapper treats the entire image as a single region, so these are fixed to 1.

to_dict() Dict[str, Any]

Convert config to a dictionary for passing to the C extension.