PointingCamera
- class ctapointing.camera.PointingCamera(**kwargs: Any)
Bases:
ComponentPointing camera class.
Hosts routines and parameters necessary to project Alt-Az coordinates into the chip plane.
Uses correct tangential projection into the chip plane (i.e. no small-angle approximation). Takes account for the orientation of the telescope (in Alt-Az coordinates), rotation of the camera w.r.t. the horizon, a tilt of the camera’s optical axis w.r.t. the telescope pointing, and possible shifts of the chip centre w.r.t. the optical axis and lens distortions.
The camera coordinate system has its origin exactly at the centre of the chip (for chips with odd number of pixels in the middle of the central pixel, for chips with even number of pixels at the boundary between the two innermost pixels).
Transformation of camera coordinates into chip coordinates follows the FITS/astropy standard, in which integer pixel coordinates are at the centre of a pixel, with pixel index 0 covering the range [-0.5, 0.5], representing physical pixel 1.
x points from bottom to top of the up-right chip, when viewing from the chip into the scene; y points from left to right.
By default, a ctapointing.camera.DistortionCorrectionNull model is loaded as the default for the correction of lens distortions. Any other DistortionCorrection model can be applied by adding it as a sub-component of the camera config in the configuration file.
- Parameters:
uuid (Unicode) – UUID of the camera
name (Unicode) – name of the camera
location (astropy.coordinates.EarthLocation) – location of the camera on Earth
f_stop (Float) – f_stop of the lens (focal length / aperture diameter)
num_pix (List of Int: number of pixels in x and y)
pixel_size (AstroQuantity[length]) – size of a pixel edge
tilt (AstroQuantity[angle]) – camera tilt w.r.t. telescope orientation (x/y)
offset (AstroQuantity[length]) – offset of chip centre w.r.t. telescope orientation (x/y)
rotation (AstroQuantity[angle]) – rotation of the camera around optical axis
noise_mean (List[float]) – list of mean noise values (one per pixel fraction)
noise_rms (List[float]) – list of rms noise values (one per pixel fraction)
noise_pixel_fraction (List[Float]) – list of pixel fractions
expansion_coefficient (Float) – chip expansion coefficient
efficiency (Float) – pixel efficiency
manufacturer (Unicode) – camera manufacturer
model (Unicode) – camera model
serial_number (Unicode) – camera serial number
telescope_id (Int) – telescope ID
dtype (Enum) – pixel depth (in bits)
used_since (AstroTime) – date and time of first operation
used_until (AstroTime) – date and time of decommissioning
Attributes Summary
Aperture of the camera lens.
pixel depth (bits)
Camera chip area (in physical units).
Camera chip centre in physical pixel coordinates.
Camera chip size (in physical units).
pixel efficiency
chip expansion coefficient
f-stop of lens
focal length of lens (x/y chip direction)
Angular field of view.
Field of view, projected onto a tangent plane of the unit sphere.
earth location of camera, either 'x, y, z' in geocentriccoordinates or site location string
camera manufacturer
camera model
camera name
list of mean noise values (one per pixel fraction)
list of pixel fractions
list of rms noise values (one per pixel fraction)
camera chip number of pixels (x/y chip direction
offset of chip centre w.r.t.
Angle covered by a pixel edge in units of arcsec
camera pixel size
Returns the solid angle of a pixel in units of arc seconds squared
rotation of camera w.r.t.
camera serial number
telescope ID
camera tilt w.r.t.
date of first usage
date of decommissioning
UUID of Camera
Methods Summary
clip_to_chip(pix_coords[, tolerance])Clip an array of pixel coordinates to those coordinates which are inside the chip boundaries.
from_config(**kwargs)Read a camera configuration from either configuration file or database.
project_from(coords, obstime, telescope_pointing)Project given SkyCameraFrame coordinates back to AltAz.
project_into(coords, telescope_pointing[, ...])Project a given array of altaz coordinates into the pointing camera chip.
transform_to_camera(coords_pix)Transform coordinates from the pixel system to the SkyCameraFrame.
transform_to_pixels(coords_cam)Transform coordinates from the SkyCameraFrame to pixel coordinates.
Attributes Documentation
- aperture
Aperture of the camera lens.
- Returns:
aperture – lens aperture in millimeter-squared
- Return type:
astropy.Quantity
- bit_depth
pixel depth (bits)
- chip_area
Camera chip area (in physical units).
- Returns:
area – chip area
- Return type:
astropy.Quantity
- chip_centre
Camera chip centre in physical pixel coordinates.
for odd number of pixels, the chip centre is located at the centre of the central pixel, hence the centre corresponds to an integer in physical pixel coordinates
for even number of pixels, the chip centre is in between the innermost pixels, hence the centre corresponds to an integer+0.5 in physical pixel coordinates
the pixel with index 0 covers the coordinate range [-0.5, 0.5]
- Returns:
(centre_x, centre_y) – physical pixel coordinates of chip centre
- Return type:
array of floats
- chip_size
Camera chip size (in physical units).
- Returns:
(size_x, size_y) – size along x and y axes
- Return type:
tuple of astropy.Quantity
- efficiency
pixel efficiency
- expansion_coefficient
chip expansion coefficient
- f_stop
f-stop of lens
- focal_length
focal length of lens (x/y chip direction)
- fov
Angular field of view.
- Returns:
(fov_x, fov_y) – field of view along x and y direction
- Return type:
tuple of astropy.Angle
- fov_plane_projected
Field of view, projected onto a tangent plane of the unit sphere.
- Returns:
(fov_x, fov_y) – field of view along x and y direction, plane projected
- Return type:
tuple of astropy.Angle
- location
earth location of camera, either ‘x, y, z’ in geocentriccoordinates or site location string
- manufacturer
camera manufacturer
- model
camera model
- name
camera name
- noise_mean
list of mean noise values (one per pixel fraction)
- noise_pixel_fraction
list of pixel fractions
- noise_rms
list of rms noise values (one per pixel fraction)
- num_pix
camera chip number of pixels (x/y chip direction
- offset
offset of chip centre w.r.t. telescope orientation (x/y)
- pixel_angle
Angle covered by a pixel edge in units of arcsec
- Returns:
angle – angle in arc seconds
- Return type:
astropy.Quantity
- pixel_size
camera pixel size
- pixel_solid_angle
Returns the solid angle of a pixel in units of arc seconds squared
- Returns:
solid_angle – solid angle in arc seconds squared
- Return type:
astropy.Quantity
- rotation
rotation of camera w.r.t. horizon, in degrees
- serial_number
camera serial number
- telescope_id
telescope ID
- tilt
camera tilt w.r.t. telescope orientation (x/y)
- used_since
date of first usage
- used_until
date of decommissioning
- uuid
UUID of Camera
Methods Documentation
- clip_to_chip(pix_coords, tolerance=0)
Clip an array of pixel coordinates to those coordinates which are inside the chip boundaries.
- Parameters:
pix_coords (array) – 2D array of pixel coordinates
tolerance (float) – tolerance in units of pixels
- Returns:
mask – boolean array of same shape as pix_coords, with positions which are inside the chip boundaries (and within tolerance) set to True (and False otherwise)
- Return type:
numpy.array
- classmethod from_config(**kwargs)
Read a camera configuration from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.
- Parameters:
input_url (str or Path) – path of the configuration file.
name (str) – name of the camera (as in PointingCamera.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.
uuid (str) – UUID of the camera (as in PointingCamera.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.
collection (str) – name of the database collection from which configuration is read
database (str) – name of the database in which the collection is stored
- Returns:
camera
- Return type:
PointingCamera object
- project_from(coords, obstime, telescope_pointing)
Project given SkyCameraFrame coordinates back to AltAz.
- Parameters:
coords (SkyCoord in SkyCameraFrame) – coordinates on CCD chip in SkyCameraFrame
obstime (Astropy.Time) – time of the observation
telescope_pointing (SkyCoord) – telescope pointing direction
- Returns:
coords_altaz – transformed coordinates in the AltAz system
- Return type:
SkyCoord
- project_into(coords, telescope_pointing, use_obstime_of_first_coordinate=True)
Project a given array of altaz coordinates into the pointing camera chip. Takes current camera orientation, camera intrinsic parameters and distortions into account.
- Parameters:
coords (array(astropy.SkyCoord)) – array of sky coordinates in the AltAz system
telescope_pointing (astropy.SkyCoord) – telescope pointing position (RADec or AltAz system)
use_obstime_of_first_coordinate (bool) – use observation time of the first coordinate if array of SkyCoords is provided. This reduces computation time by a lot, and should be the default for coordinates that are part of the same image.
- Returns:
coords_proj (SkyCoord) – 2D projections in chip coordinates (in SkyCameraFrame)
todo (star projection is wrong when translation t is switched on. This happens because)
the altaz position of the (infinitely) distant star is converted to a vector on the
unit circle. Should explicitly distinguish between star projection and projection of
world objects.
- transform_to_camera(coords_pix)
Transform coordinates from the pixel system to the SkyCameraFrame.
- Parameters:
coords_pix (2D array of pixel coordinates)
- Returns:
cam_coords – coordinates in SkyCameraFrame
- Return type:
SkyCoord
- transform_to_pixels(coords_cam)
Transform coordinates from the SkyCameraFrame to pixel coordinates.
- Parameters:
coords_cam (SkyCoord) – coordinates in the SkyCameraFrame
- Returns:
coords_pix – 2D array of pixel coordinates
- Return type:
numpy.array
- __init__(config=None, parent=None, **kwargs)
- Parameters:
config (traitlets.loader.Config) – Configuration specified by config file or cmdline arguments. Used to set traitlet values.
parent (Tool or Component) – If a Component is created by another Component or Tool, you need to pass the creating Component as parent, e.g. parent=self. This makes sure the config is correctly handed down to the child components. Do not pass config in this case.
kwargs – Traitlets to be overridden. TraitError is raised if kwargs contains a key that does not correspond to a traitlet.
- property aperture
Aperture of the camera lens.
- Returns:
aperture – lens aperture in millimeter-squared
- Return type:
astropy.Quantity
- bit_depth
pixel depth (bits)
- property chip_area
Camera chip area (in physical units).
- Returns:
area – chip area
- Return type:
astropy.Quantity
- property chip_centre
Camera chip centre in physical pixel coordinates.
for odd number of pixels, the chip centre is located at the centre of the central pixel, hence the centre corresponds to an integer in physical pixel coordinates
for even number of pixels, the chip centre is in between the innermost pixels, hence the centre corresponds to an integer+0.5 in physical pixel coordinates
the pixel with index 0 covers the coordinate range [-0.5, 0.5]
- Returns:
(centre_x, centre_y) – physical pixel coordinates of chip centre
- Return type:
array of floats
- property chip_size
Camera chip size (in physical units).
- Returns:
(size_x, size_y) – size along x and y axes
- Return type:
tuple of astropy.Quantity
- clip_to_chip(pix_coords, tolerance=0)
Clip an array of pixel coordinates to those coordinates which are inside the chip boundaries.
- Parameters:
pix_coords (array) – 2D array of pixel coordinates
tolerance (float) – tolerance in units of pixels
- Returns:
mask – boolean array of same shape as pix_coords, with positions which are inside the chip boundaries (and within tolerance) set to True (and False otherwise)
- Return type:
numpy.array
- efficiency
pixel efficiency
- expansion_coefficient
chip expansion coefficient
- f_stop
f-stop of lens
- focal_length
focal length of lens (x/y chip direction)
- property fov
Angular field of view.
- Returns:
(fov_x, fov_y) – field of view along x and y direction
- Return type:
tuple of astropy.Angle
- property fov_plane_projected
Field of view, projected onto a tangent plane of the unit sphere.
- Returns:
(fov_x, fov_y) – field of view along x and y direction, plane projected
- Return type:
tuple of astropy.Angle
- classmethod from_config(**kwargs)
Read a camera configuration from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.
- Parameters:
input_url (str or Path) – path of the configuration file.
name (str) – name of the camera (as in PointingCamera.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.
uuid (str) – UUID of the camera (as in PointingCamera.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.
collection (str) – name of the database collection from which configuration is read
database (str) – name of the database in which the collection is stored
- Returns:
camera
- Return type:
PointingCamera object
- location
earth location of camera, either ‘x, y, z’ in geocentriccoordinates or site location string
- manufacturer
camera manufacturer
- model
camera model
- name
camera name
- noise_mean
list of mean noise values (one per pixel fraction)
- noise_pixel_fraction
list of pixel fractions
- noise_rms
list of rms noise values (one per pixel fraction)
- num_pix
camera chip number of pixels (x/y chip direction
- offset
offset of chip centre w.r.t. telescope orientation (x/y)
- property pixel_angle
Angle covered by a pixel edge in units of arcsec
- Returns:
angle – angle in arc seconds
- Return type:
astropy.Quantity
- pixel_size
camera pixel size
- property pixel_solid_angle
Returns the solid angle of a pixel in units of arc seconds squared
- Returns:
solid_angle – solid angle in arc seconds squared
- Return type:
astropy.Quantity
- project_from(coords, obstime, telescope_pointing)
Project given SkyCameraFrame coordinates back to AltAz.
- Parameters:
coords (SkyCoord in SkyCameraFrame) – coordinates on CCD chip in SkyCameraFrame
obstime (Astropy.Time) – time of the observation
telescope_pointing (SkyCoord) – telescope pointing direction
- Returns:
coords_altaz – transformed coordinates in the AltAz system
- Return type:
SkyCoord
- project_into(coords, telescope_pointing, use_obstime_of_first_coordinate=True)
Project a given array of altaz coordinates into the pointing camera chip. Takes current camera orientation, camera intrinsic parameters and distortions into account.
- Parameters:
coords (array(astropy.SkyCoord)) – array of sky coordinates in the AltAz system
telescope_pointing (astropy.SkyCoord) – telescope pointing position (RADec or AltAz system)
use_obstime_of_first_coordinate (bool) – use observation time of the first coordinate if array of SkyCoords is provided. This reduces computation time by a lot, and should be the default for coordinates that are part of the same image.
- Returns:
coords_proj (SkyCoord) – 2D projections in chip coordinates (in SkyCameraFrame)
todo (star projection is wrong when translation t is switched on. This happens because)
the altaz position of the (infinitely) distant star is converted to a vector on the
unit circle. Should explicitly distinguish between star projection and projection of
world objects.
- rotation
rotation of camera w.r.t. horizon, in degrees
- serial_number
camera serial number
- telescope_id
telescope ID
- tilt
camera tilt w.r.t. telescope orientation (x/y)
- transform_to_camera(coords_pix)
Transform coordinates from the pixel system to the SkyCameraFrame.
- Parameters:
coords_pix (2D array of pixel coordinates)
- Returns:
cam_coords – coordinates in SkyCameraFrame
- Return type:
SkyCoord
- transform_to_pixels(coords_cam)
Transform coordinates from the SkyCameraFrame to pixel coordinates.
- Parameters:
coords_cam (SkyCoord) – coordinates in the SkyCameraFrame
- Returns:
coords_pix – 2D array of pixel coordinates
- Return type:
numpy.array
- used_since
date of first usage
- used_until
date of decommissioning
- uuid
UUID of Camera