1818# under the Licence.
1919
2020from enum import Enum
21+ from warnings import warn
2122import functools
2223import numpy as np
2324
2425from raysect .core import Node , translate , rotate_basis , Point3D , Vector3D , Ray as CoreRay , Primitive , World
25- from raysect .core .math .sampler import TargettedHemisphereSampler , RectangleSampler3D
26+ from raysect .core .math .sampler import TargetedHemisphereSampler , RectangleSampler3D
2627from raysect .primitive import Box , Cylinder , Subtract , Union
2728from raysect .optical .observer import PowerPipeline0D , RadiancePipeline0D , \
28- SpectralPowerPipeline0D , SpectralRadiancePipeline0D , SightLine , TargettedPixel
29+ SpectralPowerPipeline0D , SpectralRadiancePipeline0D , SightLine , TargetedPixel
2930from raysect .optical .observer import PowerPipeline2D , RadiancePipeline2D , \
30- SpectralPowerPipeline2D , SpectralRadiancePipeline2D , TargettedCCDArray
31+ SpectralPowerPipeline2D , SpectralRadiancePipeline2D , TargetedCCDArray
3132from raysect .optical .material .material import NullMaterial
3233from raysect .optical .material import AbsorbingSurface
3334
@@ -213,7 +214,7 @@ class BolometerSlit(Node):
213214 larger than the slit dx and dy, which can cause partial occlusion of
214215 nearby primitives. It also relies on no rays being launched with directions
215216 outside the solid angle of the aperture's bounding sphere: depending on the
216- foil-slit distance and slit size, and also the foil's targetted_path_prob ,
217+ foil-slit distance and slit size, and also the foil's targeted_path_prob ,
217218 this may not be guaranteed. Supplying a proper mesh geometry for the camera
218219 is recommended instead of using a CSG aperture.
219220
@@ -351,7 +352,7 @@ def curvature_radius(self):
351352 return self ._curvature_radius
352353
353354
354- class BolometerFoil (TargettedPixel ):
355+ class BolometerFoil (TargetedPixel ):
355356 """
356357 A rectangular foil bolometer detector.
357358
@@ -447,7 +448,7 @@ def __init__(self, detector_id, centre_point, basis_x, dx, basis_y, dy, slit,
447448 translation = translate (centre_point .x , centre_point .y , centre_point .z )
448449 rotation = rotate_basis (normal_vec , basis_y )
449450
450- super ().__init__ ([slit .target ], targetted_path_prob = 1.0 ,
451+ super ().__init__ ([slit .target ], targeted_path_prob = 1.0 ,
451452 pixel_samples = 1000 , x_width = dx , y_width = dy , spectral_bins = 1 , quiet = True ,
452453 parent = parent , transform = translation * rotation , name = detector_id )
453454
@@ -516,6 +517,24 @@ def accumulate(self, value):
516517 # Discard any samples from previous accumulate behaviour
517518 pipeline .value .clear ()
518519
520+ @property
521+ def targetted_path_prob (self ):
522+ warn (
523+ "The 'targetted_path_prob' property is deprecated, use 'targeted_path_prob' instead." ,
524+ DeprecationWarning ,
525+ stacklevel = 2
526+ )
527+ return self ._targeted_path_prob
528+
529+ @targetted_path_prob .setter
530+ def targetted_path_prob (self , value ):
531+ warn (
532+ "The 'targetted_path_prob' property is deprecated, use 'targeted_path_prob' instead." ,
533+ DeprecationWarning ,
534+ stacklevel = 2
535+ )
536+ self .targeted_path_prob = value
537+
519538 def as_sightline (self ):
520539 """
521540 Constructs a SightLine observer for this bolometer.
@@ -661,8 +680,8 @@ def calculate_etendue(self, ray_count=10000, batches=10, max_distance=1e999):
661680 # generate bounding sphere and convert to local coordinate system
662681 sphere = target .bounding_sphere ()
663682 spheres = [(sphere .centre .transform (self .to_local ()), sphere .radius , 1.0 )]
664- # instance targetted pixel sampler to sample directions
665- targetted_sampler = TargettedHemisphereSampler (spheres )
683+ # instance targeted pixel sampler to sample directions
684+ targeted_sampler = TargetedHemisphereSampler (spheres )
666685 # instance rectangle pixel sampler to sample origins
667686 point_sampler = RectangleSampler3D (width = self .x_width , height = self .y_width )
668687
@@ -671,8 +690,8 @@ def etendue_single_run(_):
671690 origins = point_sampler (samples = ray_count )
672691 passed = 0.0
673692 for origin in origins :
674- # obtain targetted vector sample
675- direction , pdf = targetted_sampler (origin , pdf = True )
693+ # obtain targeted vector sample
694+ direction , pdf = targeted_sampler (origin , pdf = True )
676695 path_weight = R_2_PI * direction .z / pdf
677696 # Transform to world space
678697 origin = origin .transform (detector_transform )
@@ -701,7 +720,7 @@ def etendue_single_run(_):
701720 return etendue , etendue_error
702721
703722
704- class BolometerIRVB (TargettedCCDArray ):
723+ class BolometerIRVB (TargetedCCDArray ):
705724 """
706725 A rectangular infra red video bolometer (IRVB).
707726
@@ -784,7 +803,7 @@ def __init__(self, name, width, pixels, slit, transform, parent=None,
784803 self ._accumulate = None # Will be set after pipeline is created.
785804
786805 super ().__init__ ([slit .target ], pixels = pixels , width = width ,
787- targetted_path_prob = 0.99 , parent = parent , pipelines = [],
806+ targeted_path_prob = 0.99 , parent = parent , pipelines = [],
788807 transform = transform , name = name )
789808 self .pixel_samples = 1000
790809 self .spectral_bins = 1
@@ -896,6 +915,24 @@ def accumulate(self, value):
896915 if pipeline .frame is not None :
897916 pipeline .frame .clear ()
898917
918+ @property
919+ def targetted_path_prob (self ):
920+ warn (
921+ "The 'targetted_path_prob' property is deprecated, use 'targeted_path_prob' instead." ,
922+ DeprecationWarning ,
923+ stacklevel = 2 ,
924+ )
925+ return self ._targeted_path_prob
926+
927+ @targetted_path_prob .setter
928+ def targetted_path_prob (self , value ):
929+ warn (
930+ "The 'targetted_path_prob' property is deprecated, use 'targeted_path_prob' instead." ,
931+ DeprecationWarning ,
932+ stacklevel = 2 ,
933+ )
934+ self .targeted_path_prob = value
935+
899936 def as_sightlines (self ):
900937 """
901938 Constructs a SightLine observer for each pixel in this bolometer.
0 commit comments