ESBO-ETC/esbo_etc/classes/psf/IPSF.py

49 lines
1.5 KiB
Python
Raw Normal View History

2020-04-29 17:07:43 +02:00
from abc import ABC, abstractmethod
import astropy.units as u
import numpy as np
from typing import Union
class IPSF(ABC):
"""
Interface for modelling a PSF
"""
@abstractmethod
2020-05-06 10:20:57 +02:00
def calcReducedObservationAngle(self, contained_energy: Union[str, int, float, u.Quantity],
2020-05-11 10:38:34 +02:00
jitter_sigma: u.Quantity = None, obstruction: float = 0.0) -> u.Quantity:
2020-04-29 17:07:43 +02:00
"""
Calculate the reduced observation angle in lambda / d_ap for the given contained energy.
Parameters
----------
contained_energy : Union[str, int, float, u.Quantity]
The percentage of energy to be contained within a circle with the diameter reduced observation angle.
2020-05-06 10:20:57 +02:00
jitter_sigma : Quantity
Sigma of the telescope's jitter in arcsec
2020-05-11 10:38:34 +02:00
obstruction : float
The central obstruction as ratio A_ob / A_ap
2020-04-29 17:07:43 +02:00
Returns
-------
reduced_observation_angle: Quantity
The reduced observation angle in lambda / d_ap
"""
pass
@abstractmethod
def mapToGrid(self, grid: np.ndarray) -> np.ndarray:
"""
Map the integrated PSF values to a sensor grid.
Parameters
----------
grid : ndarray
The grid to map the values to. The values will only be mapped onto entries with the value 1.
Returns
-------
grid : ndarray
The grid with the mapped values.
"""
pass