SourceLocationSettings#

class stellarphot.settings.SourceLocationSettings(*arg, source_list_file: str = 'source_locations.ecsv', use_coordinates: Literal['sky', 'pixel'] = 'sky', shift_tolerance: Annotated[float, Ge(ge=0)] = 5.0)[source]#

Bases: BaseModelWithTableRep

Settings for the location of the source list and the image files.

Parameters:
source_list_filestr

Name of a file with a table of extracted sources with positions in terms of pixel coordinates OR RA/Dec coordinates. If both positions provided, the one that will be used is determined by use_coordinates. For RA/Dec coordinates to be used, ccd_image must have a valid WCS.

use_coordinatestyping.Literal["sky", "pixel"], optional

If 'pixel', use the x/y positions in the sourcelist for performing aperture photometry. If 'sky', use the ra/dec positions in the sourcelist and the WCS of the ccd_image to compute the x/y positions on the image.

shift_tolerancepydantic.NonNegativeFloat, optional

Since source positions need to be computed on each image using the sky position and WCS, the computed x/y positions are refined afterward by centroiding the sources. This setting controls the tolerance in pixels for the shift between the the computed positions and the refined positions, in pixels. The expected shift shift should not be more than the FWHM, so a measured FWHM might be a good value to provide here.

Examples

>>> from stellarphot.settings import SourceLocationSettings
>>> source_location_settings = SourceLocationSettings(
...     source_list_file="source_list.ecsv",
...     use_coordinates="sky",
...     shift_tolerance=5.0
... )
>>> source_location_settings
SourceLocationSettings(source_list_file='source_list.ecsv', use_coordinates='sky',
shift_tolerance=5.0)

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': 'Settings for the location of the source list and the image files.'}, 'validate_assignment': True, 'validate_default': True}#

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