sourcefinder.config#

Attributes#

EXPORTSETTINGS_HELP

Configuration options for export of source finding results.

IMGCONF_HELP

Configuration options for image processing and source extraction.

T

_compat_types

_source_params

_source_params_file

_structuring_element

Classes#

Conf

ExportSettings

Selection of output, related to detected sources and/or intermediate

ImgConf

Configuration that should cover all the specifications for processing the image.

_Validate

Functions#

_dataclass_field_names(cls)

_is_dataclass(→ bool)

Remove TypeGuard from is_dataclass.

assert_t(key, value, *types)

Assert value is of one of the types

normalize_none_values(val)

read_conf(path)

test_exportsettings_help_is_complete()

test_imgconf_help_is_complete()

validate_nested(key, value, origin_t, args)

Validate nested types allowed in TOML

validate_types(key, value, type_)

Validate types, dispatch on generic or POD types

Module Contents#

class sourcefinder.config.Conf[source]#
export: ExportSettings[source]#
image: ImgConf[source]#
class sourcefinder.config.ExportSettings[source]#

Bases: _Validate

Selection of output, related to detected sources and/or intermediate image processing products

csv: bool = False[source]#
file_type: str = 'csv'[source]#
islands: bool = False[source]#
output_dir: str = '.'[source]#
pandas_df: bool = True[source]#
regions: bool = False[source]#
residuals: bool = False[source]#
rmsmap: bool = False[source]#
sigmap: bool = False[source]#
skymodel: bool = False[source]#
source_params: list[str][source]#
source_params_file: list[str][source]#
class sourcefinder.config.ImgConf[source]#

Bases: _Validate

Configuration that should cover all the specifications for processing the image.

alpha: float = 0.01[source]#
alpha_brightness1: float = 1.5[source]#
alpha_brightness2: float = 1.5[source]#
alpha_maj1: float = 2.5[source]#
alpha_maj2: float = 0.5[source]#
alpha_min1: float = 0.5[source]#
alpha_min2: float = 2.5[source]#
analysis_thr: float = 3.0[source]#
back_size_x: int | None = None[source]#
back_size_y: int | None = None[source]#
bmaj: float | None = None[source]#
bmin: float | None = None[source]#
bpa: float | None = None[source]#
clean_bias: float = 0.0[source]#
clean_bias_error: float = 0.0[source]#
deblend_mincont: float = 0.005[source]#
deblend_nthresh: int = 0[source]#
detection_image: str | None = None[source]#
detection_thr: float = 10.0[source]#
eps_dec: float = 0.0[source]#
eps_ra: float = 0.0[source]#
ew_sys_err: float = 0.0[source]#
fdr: bool = False[source]#
ffbox: float = 3.0[source]#
fixed_posns: str | None = None[source]#
fixed_posns_file: str | None = None[source]#
force_beam: bool = False[source]#
frac_flux_cal_error: float = 0.0[source]#
grid: int | None = 64[source]#
interpolate_order: int = 1[source]#
margin: int = 0[source]#
median_filter: int = 0[source]#
mf_threshold: int = 0[source]#
nr_threads: int | None = None[source]#
ns_sys_err: float = 0.0[source]#
radius: float = 0.0[source]#
remove_edge_sources: bool = True[source]#
rms_filter: float = 0.001[source]#
structuring_element: list[list[int]] = [[1, 1, 1], [1, 1, 1], [1, 1, 1]][source]#
vectorized: bool = True[source]#
class sourcefinder.config._Validate[source]#
sourcefinder.config._dataclass_field_names(cls)[source]#
sourcefinder.config._is_dataclass(_type: Type[T], /) bool[source]#

Remove TypeGuard from is_dataclass.

see: python/mypy#14941

Parameters:

_type (Type[T])

Return type:

bool

sourcefinder.config.assert_t(key: str, value, *types: type)[source]#

Assert value is of one of the types

key is the TOML configuration key the value is associated to. It is used to generate a meaningful error message.

Parameters:
  • key (str)

  • types (type)

sourcefinder.config.normalize_none_values(val)[source]#
sourcefinder.config.read_conf(path: str | pathlib.Path)[source]#
Parameters:

path (str | pathlib.Path)

sourcefinder.config.test_exportsettings_help_is_complete()[source]#
sourcefinder.config.test_imgconf_help_is_complete()[source]#
sourcefinder.config.validate_nested(key: str, value, origin_t, args)[source]#

Validate nested types allowed in TOML

key is the TOML configuration key being validated. value should be of type origin_t[args]. It is passed to this function separately to avoid recomputing the type again.

When the type is a list, the value is tested recursively. On recursive calls, the list index is appended to the key. For dict-s, iterate over all key-value pairs and validated.

Parameters:

key (str)

sourcefinder.config.validate_types(key: str, value, type_: type)[source]#

Validate types, dispatch on generic or POD types

key is the TOML configuration key the value is associated to. It is used to generate a meaningful error message.

Parameters:
  • key (str)

  • type_ (type)

sourcefinder.config.EXPORTSETTINGS_HELP: dict[str, str][source]#

Configuration options for export of source finding results.

sourcefinder.config.IMGCONF_HELP: dict[str, str][source]#

Configuration options for image processing and source extraction.

sourcefinder.config.T[source]#
sourcefinder.config._compat_types: collections.defaultdict[type, set[type]][source]#
sourcefinder.config._source_params[source]#
sourcefinder.config._source_params_file[source]#
sourcefinder.config._structuring_element = [[1, 1, 1], [1, 1, 1], [1, 1, 1]][source]#