Skip to content

Commit

Permalink
Added `optika.sensors.AbstractBackilluminatedCCDMaterial.quantum_effi…
Browse files Browse the repository at this point in the history
…ciency()`. (#72)
  • Loading branch information
byrdie authored Aug 29, 2024
1 parent aa67e05 commit b711f35
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions optika/sensors/_materials/_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,27 @@ def quantum_efficiency_effective(
normal=normal,
)

def quantum_efficiency(
self,
rays: optika.rays.AbstractRayVectorArray,
normal: na.AbstractCartesian3dVectorArray,
) -> na.AbstractScalar:
"""
Compute the quantum efficiency of this CCD material using
:meth:`quantum_efficiency_effective` and
:meth:`quantum_yield_ideal`.
Parameters
----------
rays
The light rays incident on the CCD surface
normal
The vector perpendicular to the surface of the CCD.
"""
iqy = self.quantum_yield_ideal(rays.wavelength)
eqe = self.quantum_efficiency_effective(rays, normal)
return iqy * eqe

def probability_measurement(
self,
rays: optika.rays.AbstractRayVectorArray,
Expand Down
24 changes: 24 additions & 0 deletions optika/sensors/_materials/_materials_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,30 @@ def test_charge_collection_efficiency(
assert np.all(result >= 0)
assert np.all(result <= 1)

@pytest.mark.parametrize(
argnames="rays",
argvalues=[
optika.rays.RayVectorArray(
wavelength=100 * u.AA,
direction=na.Cartesian3dVectorArray(0, 0, 1),
),
],
)
@pytest.mark.parametrize(
argnames="normal",
argvalues=[
na.Cartesian3dVectorArray(0, 0, -1),
],
)
def test_quantum_efficiency(
self,
a: optika.sensors.AbstractBackilluminatedCCDMaterial,
rays: optika.rays.AbstractRayVectorArray,
normal: na.AbstractCartesian3dVectorArray,
):
result = a.quantum_efficiency(rays, normal)
assert result > 0 * u.electron / u.photon

@pytest.mark.parametrize(
argnames="rays",
argvalues=[
Expand Down

0 comments on commit b711f35

Please sign in to comment.