Camera#

class stellarphot.settings.Camera(*arg, name: Annotated[str, AfterValidator(func=_non_empty_string_validator)], data_unit: Annotated[Unit, _UnitQuantTypePydanticAnnotation], gain: Annotated[Quantity, _UnitQuantTypePydanticAnnotation], read_noise: Annotated[Quantity, _UnitQuantTypePydanticAnnotation], dark_current: Annotated[Quantity, _UnitQuantTypePydanticAnnotation], pixel_scale: Annotated[Quantity, _UnitQuantTypePydanticAnnotation, EquivalentTo(equivalent_unit=Unit('arcsec / pix'))], max_data_value: Annotated[Quantity, _UnitQuantTypePydanticAnnotation, Gt(gt=0)])[source]#

Bases: BaseModelWithTableRep

A class to represent a CCD-based camera.

Parameters:
namestr

The name of the camera; can be anything that helps the user identify the camera.

data_unitastropy.units.Unit

The unit of the data.

gainastropy.units.Quantity

The gain of the camera in units such the product of gain times the image data has units equal to that of the read_noise.

read_noiseastropy.units.Quantity

The read noise of the camera with units.

dark_currentastropy.units.Quantity

The dark current of the camera in units such that, when multiplied by exposure time, the unit matches the units of the read_noise.

pixel_scaleastropy.units.Quantity

The pixel scale of the camera in units of arcseconds per pixel.

max_data_valueastropy.units.Quantity

The maximum pixel value to allow while performing photometry. Pixel values above this will be set to NaN. The unit must be data_unit.

Attributes:
data_unitastropy.units.Unit

The unit of the data.

gainastropy.units.Quantity

The gain of the camera in units such the product of gain times the image data has units equal to that of the read_noise.

namestr

The name of the camera; can be anything that helps the user identify the camera.

read_noiseastropy.units.Quantity

The read noise of the camera with units.

dark_currentastropy.units.Quantity

The dark current of the camera in units such that, when multiplied by exposure time, the unit matches the units of the read_noise.

pixel_scaleastropy.units.Quantity

The pixel scale of the camera in units of arcseconds per pixel.

max_data_valueastropy.units.Quantity

The maximum pixel value to allow while performing photometry. Pixel values above this will be set to NaN. The unit must be data_unit.

Notes

The gain, read noise, and dark current are all assumed to be constant across the entire CCD.

Examples

>>> from astropy import units as u
>>> from stellarphot.settings import Camera
>>> camera = Camera(data_unit="adu",
...                 gain=1.0 * u.electron / u.adu,
...                 name="test camera",
...                 read_noise=1.0 * u.electron,
...                 dark_current=0.01 * u.electron / u.second,
...                 pixel_scale=0.563 * u.arcsec / u.pixel,
...                 max_data_value=50000 * u.adu)
>>> camera.data_unit
Unit("adu")
>>> camera.gain
<Quantity 1. electron / adu>
>>> camera.name
'test camera'
>>> camera.read_noise
<Quantity 1. electron>
>>> camera.dark_current
<Quantity 0.01 electron / s>
>>> camera.pixel_scale
<Quantity 0.563 arcsec / pix>
>>> camera.max_data_value
<Quantity 50000. adu>

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].

Methods Summary

Attributes Documentation

model_config = {'extra': 'forbid', 'json_schema_extra': {'description': 'A class to represent a CCD-based camera.'}, 'validate_assignment': True, 'validate_default': True}#

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

Methods Documentation

validate_gain()[source]#