-
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 all commits
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Citation Guidelines | ||
=================== | ||
|
||
|JOSS| |Birrer&Amara| | ||
|
||
If you use lenstronomy for work or research presented in a publication (whether | ||
directly, or as a dependency of another package) we recommend and encourage | ||
the following acknowledgment: | ||
|
||
This research made use of lenstronomy, a multi-purpose gravitational lens | ||
modeling software package (Birrer et. al., 2021, Birrer & Amara, 2018). | ||
|
||
where the citations are to our publication in the `Journal of Open Source | ||
Software`_ and the `Original Publication`_. We also encourage citations within the main text wherever | ||
appropriate. DOIs and BibTeX keys are available through the links above. | ||
|
||
Please also cite `Birrer et al 2015 <http://adsabs.harvard.edu/abs/2015ApJ...813..102B>`_ | ||
when you make use of the lenstronomy work-flow or the Shapelet source reconstruction and make sure to cite also | ||
the relevant work that was implemented in lenstronomy, as described in the release paper and the documentation. | ||
Don't hesitate to reach out to the developers if you have questions! | ||
|
||
|
||
.. _Journal of Open Source Software: https://joss.theoj.org/papers/10.21105/joss.03283 | ||
.. _Original Publication: https://ui.adsabs.harvard.edu/abs/2018PDU....22..189B/abstract | ||
|
||
.. |JOSS| image:: https://joss.theoj.org/papers/10.21105/joss.03283/status.svg | ||
:target: https://joss.theoj.org/papers/10.21105/joss.03283 | ||
|
||
.. |Birrer&Amara| image:: https://img.shields.io/badge/arXiv-1803.09746%20-yellowgreen.svg | ||
:target: https://ui.adsabs.harvard.edu/abs/2018PDU....22..189B/abstract |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
============ | ||
Mailing list | ||
============ | ||
============================== | ||
Mailing list and Slack channel | ||
============================== | ||
|
||
You can join the **lenstronomy** mailing list by signing up on the | ||
`google groups page <https://groups.google.com/forum/#!forum/lenstronomy>`_. | ||
|
||
The email list is meant to provide a communication platform between users and developers. You can ask questions, | ||
and suggest new features. New releases will be announced via this mailing list. | ||
|
||
If you encounter errors or problems with **lenstronomy**, please let us know! | ||
We also have a `Slack channel <https://lenstronomers.slack.com>`_ for the community. | ||
Please send us an `email <lenstronomy-dev@googlegroups.com>`_ such that we can add you to the channel. | ||
|
||
If you encounter errors or problems with **lenstronomy**, please let us know! | ||
You can open an `issue <https://github.com/lenstronomy/lenstronomy/issues>`_, | ||
make a post on the `Slack channel <https://lenstronomers.slack.com>`_ or | ||
write an `email <lenstronomy-dev@googlegroups.com>`_ to the lenstronomy developers. | ||
|
||
We are also encouraging you to reach out with feature requests, general or specific feedback and questions about use cases. |
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) | ||
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. change to " parameters: ... image_amp/source_amp" to match lensed_position.py |
||
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 image_amp/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.
It might be helpful to explicitly write "source_amp is the amplitude of the point source in the source plane. image_amp are the amplitudes of the point source images in the image plane. When fixed_magnification=True, use source_amp. Otherwise, use image_amp" (in source_position as well)