-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Point source refactoring #338
base: main
Are you sure you want to change the base?
Changes from 1 commit
570ca17
0350dba
c5befdd
a53fe49
5ec3998
41db665
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ class of a single point source defined in the original source coordinate positio | |
|
||
Name within the PointSource module: 'SOURCE_POSITION' | ||
parameters: ra_source, dec_source, source_amp, mag_pert (optional) | ||
If fixed_magnification=True, than 'source_amp' is a parameter instead of 'point_amp' | ||
If fixed_magnification=True, than 'source_amp' is a parameter instead of 'image_amp' | ||
mag_pert is a list of fractional magnification pertubations applied to point source images | ||
|
||
""" | ||
|
@@ -76,7 +76,7 @@ def image_amplitude(self, kwargs_ps, kwargs_lens=None, x_pos=None, y_pos=None, m | |
mag = self._lens_model.magnification(ra_image, dec_image, kwargs_lens) | ||
point_amp = kwargs_ps['source_amp'] * np.abs(mag) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there some way to throw an informative error before trying to access kwargs_ps['source_amp']? i.e. check for both self.fixed_magnification = True and the existence of the 'source_amp' key before trying to access it? And also check the opposite for self.fixed_magnification = False and 'image_amp'. This might be difficult because you would have to put this in every function that uses kwargs_ps... |
||
else: | ||
point_amp = kwargs_ps['point_amp'] | ||
point_amp = kwargs_ps['image_amp'] | ||
if x_pos is not None: | ||
point_amp = _expand_to_array(point_amp, len(x_pos)) | ||
mag_pert = kwargs_ps.get('mag_pert', 1) | ||
|
@@ -100,6 +100,6 @@ def source_amplitude(self, kwargs_ps, kwargs_lens=None): | |
else: | ||
ra_image, dec_image = self.image_position(kwargs_ps, kwargs_lens) | ||
mag = self._lens_model.magnification(ra_image, dec_image, kwargs_lens) | ||
point_amp = kwargs_ps['point_amp'] | ||
point_amp = kwargs_ps['image_amp'] | ||
source_amp = np.mean(np.array(point_amp) / np.array(mag)) | ||
return np.array(source_amp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to " parameters: ... image_amp/source_amp" to match lensed_position.py