sourcefinder.config =================== .. py:module:: sourcefinder.config Attributes ---------- .. autoapisummary:: sourcefinder.config.EXPORTSETTINGS_HELP sourcefinder.config.IMGCONF_HELP sourcefinder.config.T sourcefinder.config._compat_types sourcefinder.config._source_params sourcefinder.config._source_params_file sourcefinder.config._structuring_element Classes ------- .. autoapisummary:: sourcefinder.config.Conf sourcefinder.config.ExportSettings sourcefinder.config.ImgConf sourcefinder.config._Validate Functions --------- .. autoapisummary:: sourcefinder.config._dataclass_field_names sourcefinder.config._is_dataclass sourcefinder.config.assert_t sourcefinder.config.normalize_none_values sourcefinder.config.read_conf sourcefinder.config.test_exportsettings_help_is_complete sourcefinder.config.test_imgconf_help_is_complete sourcefinder.config.validate_nested sourcefinder.config.validate_types Module Contents --------------- .. py:class:: Conf .. py:attribute:: export :type: ExportSettings .. py:attribute:: image :type: ImgConf .. py:class:: ExportSettings Bases: :py:obj:`_Validate` Selection of output, related to detected sources and/or intermediate image processing products .. !! processed by numpydoc !! .. py:attribute:: csv :type: bool :value: False .. py:attribute:: file_type :type: str :value: 'csv' .. py:attribute:: islands :type: bool :value: False .. py:attribute:: output_dir :type: str :value: '.' .. py:attribute:: pandas_df :type: bool :value: True .. py:attribute:: regions :type: bool :value: False .. py:attribute:: residuals :type: bool :value: False .. py:attribute:: rmsmap :type: bool :value: False .. py:attribute:: sigmap :type: bool :value: False .. py:attribute:: skymodel :type: bool :value: False .. py:attribute:: source_params :type: list[str] .. py:attribute:: source_params_file :type: list[str] .. py:class:: ImgConf Bases: :py:obj:`_Validate` Configuration that should cover all the specifications for processing the image. .. !! processed by numpydoc !! .. py:attribute:: alpha :type: float :value: 0.01 .. py:attribute:: alpha_brightness1 :type: float :value: 1.5 .. py:attribute:: alpha_brightness2 :type: float :value: 1.5 .. py:attribute:: alpha_maj1 :type: float :value: 2.5 .. py:attribute:: alpha_maj2 :type: float :value: 0.5 .. py:attribute:: alpha_min1 :type: float :value: 0.5 .. py:attribute:: alpha_min2 :type: float :value: 2.5 .. py:attribute:: analysis_thr :type: float :value: 3.0 .. py:attribute:: back_size_x :type: int | None :value: None .. py:attribute:: back_size_y :type: int | None :value: None .. py:attribute:: bmaj :type: float | None :value: None .. py:attribute:: bmin :type: float | None :value: None .. py:attribute:: bpa :type: float | None :value: None .. py:attribute:: clean_bias :type: float :value: 0.0 .. py:attribute:: clean_bias_error :type: float :value: 0.0 .. py:attribute:: deblend_mincont :type: float :value: 0.005 .. py:attribute:: deblend_nthresh :type: int :value: 0 .. py:attribute:: detection_image :type: str | None :value: None .. py:attribute:: detection_thr :type: float :value: 10.0 .. py:attribute:: eps_dec :type: float :value: 0.0 .. py:attribute:: eps_ra :type: float :value: 0.0 .. py:attribute:: ew_sys_err :type: float :value: 0.0 .. py:attribute:: fdr :type: bool :value: False .. py:attribute:: ffbox :type: float :value: 3.0 .. py:attribute:: fixed_posns :type: str | None :value: None .. py:attribute:: fixed_posns_file :type: str | None :value: None .. py:attribute:: force_beam :type: bool :value: False .. py:attribute:: frac_flux_cal_error :type: float :value: 0.0 .. py:attribute:: grid :type: int | None :value: 64 .. py:attribute:: interpolate_order :type: int :value: 1 .. py:attribute:: margin :type: int :value: 0 .. py:attribute:: median_filter :type: int :value: 0 .. py:attribute:: mf_threshold :type: int :value: 0 .. py:attribute:: nr_threads :type: int | None :value: None .. py:attribute:: ns_sys_err :type: float :value: 0.0 .. py:attribute:: radius :type: float :value: 0.0 .. py:attribute:: remove_edge_sources :type: bool :value: True .. py:attribute:: rms_filter :type: float :value: 0.001 .. py:attribute:: structuring_element :type: list[list[int]] :value: [[1, 1, 1], [1, 1, 1], [1, 1, 1]] .. py:attribute:: vectorized :type: bool :value: True .. py:class:: _Validate .. py:function:: _dataclass_field_names(cls) .. py:function:: _is_dataclass(_type: Type[T], /) -> bool Remove ``TypeGuard`` from is_dataclass. see: https://github.com/python/mypy/issues/14941 .. !! processed by numpydoc !! .. py:function:: assert_t(key: str, value, *types: type) 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. .. !! processed by numpydoc !! .. py:function:: normalize_none_values(val) .. py:function:: read_conf(path: str | pathlib.Path) .. py:function:: test_exportsettings_help_is_complete() .. py:function:: test_imgconf_help_is_complete() .. py:function:: validate_nested(key: str, value, origin_t, args) 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. .. !! processed by numpydoc !! .. py:function:: validate_types(key: str, value, type_: type) 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. .. !! processed by numpydoc !! .. py:data:: EXPORTSETTINGS_HELP :type: dict[str, str] Configuration options for export of source finding results. .. !! processed by numpydoc !! .. py:data:: IMGCONF_HELP :type: dict[str, str] Configuration options for image processing and source extraction. .. !! processed by numpydoc !! .. py:data:: T .. py:data:: _compat_types :type: collections.defaultdict[type, set[type]] .. py:data:: _source_params .. py:data:: _source_params_file .. py:data:: _structuring_element :value: [[1, 1, 1], [1, 1, 1], [1, 1, 1]]