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:
BaseModelWithTableRepA 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_unit
astropy.units.Unit The unit of the data.
- gain
astropy.units.Quantity The gain of the camera in units such the product of
gaintimes the image data has units equal to that of theread_noise.- read_noise
astropy.units.Quantity The read noise of the camera with units.
- dark_current
astropy.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_scale
astropy.units.Quantity The pixel scale of the camera in units of arcseconds per pixel.
- max_data_value
astropy.units.Quantity The maximum pixel value to allow while performing photometry. Pixel values above this will be set to
NaN. The unit must bedata_unit.
- Attributes:
- data_unit
astropy.units.Unit The unit of the data.
- gain
astropy.units.Quantity The gain of the camera in units such the product of
gaintimes the image data has units equal to that of theread_noise.- namestr
The name of the camera; can be anything that helps the user identify the camera.
- read_noise
astropy.units.Quantity The read noise of the camera with units.
- dark_current
astropy.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_scale
astropy.units.Quantity The pixel scale of the camera in units of arcseconds per pixel.
- max_data_value
astropy.units.Quantity The maximum pixel value to allow while performing photometry. Pixel values above this will be set to
NaN. The unit must bedata_unit.
- 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.selfis explicitly positional-only to allowselfas a field name.Attributes Summary
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