PhotometryOptionalSettings#

class stellarphot.settings.PhotometryOptionalSettings(*arg, include_dig_noise: bool = True, reject_too_close: bool = True, reject_background_outliers: bool = True, fwhm_method: Annotated[FwhmMethods, BeforeValidator(func=_validate_fwhm_method, json_schema_input_type=PydanticUndefined)] = FwhmMethods.PROFILE, partial_pixel_method: Literal['exact', 'center', 'subpixel'] = 'exact')[source]#

Bases: BaseModelWithTableRep

Options for performing photometry.

Parameters:
include_dig_noisebool, optional (Default: True)

If True, include the digitization noise in the calculation of the noise for each observation. If False, only the Poisson noise from the source and the sky will be included.

reject_too_closebool, optional (Default: True)

If True, any sources that are closer than twice the aperture radius are rejected. If False, all sources in field are used.

reject_background_outliersbool, optional (Default: True)

If True, sigma clip the pixels in the annulus to reject outlying pixels (e.g. like stars in the annulus)

fwhm_methodFwhmMethods (default: FwhmMethods.FIT)

Method for finding the FWHM of the star. ‘fit’ fits a 1D Gaussian to the star, ‘profiile’ fits a 1D Gaussian to the radial profile, and ‘moments’ uses second order moments of the image, which is terrible.

partial_pixel_methodtyping.Literal["exact", "center", "subpixel"], optional

How to handle partial pixels in the aperture. If 'exact', the fraction of the flux included is the fraction of the pixel within the aperture. If 'center', whether a pixel’s flux is included is determined by whether the center of the pixel is within the aperture. If 'subpixel', the flux included is determineid by breaking region into subpixels. The default is exact. For more information, see the photutils documentation.

Examples

In many cases the default options are fine:

>>> from stellarphot.settings import PhotometryOptionalSettings
>>> photometry_options = PhotometryOptionalSettings()
>>> photometry_options
PhotometryOptionalSettings(include_dig_noise=True, reject_too_close=True,...

You can also set options explicitly when you create the options:

>>> photometry_options = PhotometryOptionalSettings(
...     include_dig_noise=True,
...     reject_too_close=False,
...     reject_background_outliers=True,
...     fwhm_by_fit=True,
...     partial_pixel_method="center"
... )
>>> photometry_options
PhotometryOptionalSettings(include_dig_noise=True, reject_too_close=False,...
reject_background_outliers=True, fwhm_method=<FwhmMethods.FIT: 'fit'>,...

You can also change individual options after the object is created:

>>> photometry_options.reject_background_outliers = False
>>> photometry_options.reject_background_outliers
False

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Attributes Summary

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Attributes Documentation

model_config = {'extra': 'forbid', 'json_schema_extra': {'description': 'Options for performing photometry.'}, 'validate_assignment': True, 'validate_default': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].