LensPop uniformly samples from the deflector and source populations, constructs a Lens instance and checks if it is a valid strong lensing system. This leads to relatively low efficiency in creating strong lensing systems, which can hamper some use cases.
Proposed Solution
Extend LensPop to take a string / callable as input following the Sampler interface shown in #223 . The Sampler interface should take a Catalog from a Population instance and override the sample method of the Population. An example subclass, and expected default behaviour would be a UniformSampler that reproduces the behaviour of the Population sample method, see #225 . A useful subclass would a OpticalDepthSampler follows the approach in A. Sainz de Murieta et al. 2024, and takes a source redshift and the lens catalog, and samples deflector galaxies weighted by their optical depth, increasing the chances of a given deflector / source combination creating a valid Lens (see #228 ).
To-Do List
[ ] Decide on function or class implementation. Will Sampler require attributes?
[ ] Extend LensPop to take a sampler input, accepting a union of strings / callables, with strings referring to implemented samplers and a callable allowing for a drop-in replacement.
[ ] Extend LensPop to use the provided sampler when sampling from the lens and source populations.
[ ] Impement Sampler base if class approach is chosen / necessary.
Current Status
LensPop
uniformly samples from the deflector and source populations, constructs aLens
instance and checks if it is a valid strong lensing system. This leads to relatively low efficiency in creating strong lensing systems, which can hamper some use cases.Proposed Solution
Extend
LensPop
to take a string / callable as input following theSampler
interface shown in #223 . TheSampler
interface should take aCatalog
from aPopulation
instance and override thesample
method of thePopulation
. An example subclass, and expected default behaviour would be aUniformSampler
that reproduces the behaviour of thePopulation
sample method, see #225 . A useful subclass would aOpticalDepthSampler
follows the approach in A. Sainz de Murieta et al. 2024, and takes a source redshift and the lens catalog, and samples deflector galaxies weighted by their optical depth, increasing the chances of a given deflector / source combination creating a validLens
(see #228 ).To-Do List
Sampler
require attributes?LensPop
to take a sampler input, accepting a union of strings / callables, with strings referring to implemented samplers and a callable allowing for a drop-in replacement.LensPop
to use the provided sampler when sampling from the lens and source populations.Sampler
base if class approach is chosen / necessary.