Skip to content

Commit

Permalink
fixed some merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sibirrer committed Feb 20, 2025
1 parent f7a1e1a commit 69c30f6
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions slsim/lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ def __init__(
cosmo=self.cosmo,
)

self._los_linear_distortions_cache = None
self.los_config = los_config
if self.los_config is None:
self.los_config = LOSConfig()

@property
def image_number(self):
"""Number of images in the lensing configuration.
Expand Down Expand Up @@ -574,7 +569,7 @@ def _image_observer_times(self, source, t_obs):

return observer_times

def point_source_magnitude(self, band, lensed=False, time=None, molet=False):
def point_source_magnitude(self, band, lensed=False, time=None, micro_lensing=False):
"""Point source magnitude, either unlensed (single value) or lensed (array) with
macro-model magnifications. This function provided
magnitudes of all the sources.
Expand All @@ -587,8 +582,8 @@ def point_source_magnitude(self, band, lensed=False, time=None, molet=False):
:type lensed: bool
:param time: time is an image observation time in units of days.
If None, provides magnitude without variability.
:param molet: if using MOLET to produce the lensed magnification
:type molet: bool
:param micro_lensing: if using micro-lensing map to produce the lensed magnification
:type micro_lensing: bool
:return: list of point source magnitudes.
"""

Expand All @@ -599,7 +594,7 @@ def point_source_magnitude(self, band, lensed=False, time=None, molet=False):
)
return magnitude_list

def _point_source_magnitude(self, band, source, lensed=False, time=None):
def _point_source_magnitude(self, band, source, lensed=False, time=None, micro_lensing=False):
"""Point source magnitude, either unlensed (single value) or lensed
(array) with macro-model magnifications. This function does operation
only for the single source.
Expand All @@ -616,7 +611,7 @@ def _point_source_magnitude(self, band, source, lensed=False, time=None):
"""
# TODO: might have to change conventions between extended and point source
if lensed:
magnif = self.point_source_magnification()
magnif = self._point_source_magnification(source)
magnif_log = 2.5 * np.log10(abs(magnif))
if time is not None:
time = time
Expand Down Expand Up @@ -923,14 +918,14 @@ def deflector_light_model_lenstronomy(self, band):
"""
return self.deflector.light_model_lenstronomy(band=band)

def source_light_model_lenstronomy(self, band=None, molet=False):
def source_light_model_lenstronomy(self, band=None, micro_lensing=False):
"""Returns source light model instance and parameters in lenstronomy
conventions, which includes extended sources and point sources.
:param band: imaging band
:type band: string
:param molet: if using MOLET to produce the lensed magnification
:type molet: bool
:param micro_lensing: if using micro-lensing map to produce the lensed magnification
:type micro_lensing: bool
:return: source_light_model_list, kwargs_source_light
"""
source_models = {}
Expand Down Expand Up @@ -979,7 +974,7 @@ def source_light_model_lenstronomy(self, band=None, molet=False):
image_magnitudes = np.abs(self._point_source_magnification(source))
else:
image_magnitudes = self._point_source_magnitude(
band=band, source=source, lensed=True, molet=molet
band=band, source=source, lensed=True, micro_lensing=micro_lensing
)
kwargs_ps_list.append(
{
Expand Down

0 comments on commit 69c30f6

Please sign in to comment.