Skip to content

Commit

Permalink
Added `optika.sensors.AbstractBackilluminatedCCDMaterial.charge_colle…
Browse files Browse the repository at this point in the history
…ction_efficiency()` method. (#52)
  • Loading branch information
byrdie authored Jun 11, 2024
1 parent 843a843 commit 2ec4c3f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
24 changes: 24 additions & 0 deletions optika/sensors/_materials/_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,30 @@ def quantum_yield_ideal(
"""
return quantum_yield_ideal(wavelength)

def charge_collection_efficiency(
self,
rays: optika.rays.AbstractRayVectorArray,
normal: na.AbstractCartesian3dVectorArray,
) -> na.AbstractScalar:
"""
Compute the charge collection efficiency of this CCD sensor material
using :func:`charge_collection_efficiency`.
Parameters
----------
rays
The light rays incident on the CCD surface.
normal
The vector perpendicular to the surface of the CCD sensor.
"""
return charge_collection_efficiency(
absorption=self._chemical.absorption(rays.wavelength),
thickness_implant=self.thickness_implant,
thickness_substrate=self.thickness_substrate,
cce_backsurface=self.cce_backsurface,
cos_incidence=-rays.direction @ normal,
)

def quantum_efficiency_effective(
self,
rays: optika.rays.AbstractRayVectorArray,
Expand Down
25 changes: 25 additions & 0 deletions optika/sensors/_materials/_materials_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,31 @@ def test_quantum_yield_ideal(
result = a.quantum_yield_ideal(wavelength)
assert result >= 0

@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_charge_collection_efficiency(
self,
a: optika.sensors.AbstractBackilluminatedCCDMaterial,
rays: optika.rays.AbstractRayVectorArray,
normal: na.AbstractCartesian3dVectorArray,
):
result = a.charge_collection_efficiency(rays, normal)
assert np.all(result >= 0)
assert np.all(result <= 1)


class AbstractTestAbstractStern1994BackilluminatedCCDMaterial(
AbstractTestAbstractBackilluminatedCCDMaterial,
Expand Down

0 comments on commit 2ec4c3f

Please sign in to comment.