-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix dla model #1022
Fix dla model #1022
Conversation
pylint fails with: This makes no sense. Also I had to change lots of variable names (e, T, mp, me) to more confusing ones because pylint complained... |
@@ -28,7 +28,6 @@ | |||
GAUSSIAN_DIST = np.random.normal(size=NUM_POINTS) * np.sqrt(2) |
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.
this is not used anymore, right? We should remove it
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.
we can also remove the NUM_POINTS line above
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.
and the np.random.seed(0)
After discussing it with @cramirezpe I added a few changes to the code to further optimize. Basically, I merged the two tau functions (they were almost identical) and computed the prefactors that were independent of the DLA parameters outside of the function so that they are only computed once I also improved the docstring adding the exact equations we use and renamed a few of the variables From my side this PR is ok, but I think we should wait to merge until @p-slash has review it and the discrepancies with the Lyman Beta profiles are understood |
z_abs: float | ||
Redshift of the absorption | ||
def compute_tau(lambda_, z_abs, log_nhi, lambda_t, oscillator_strength_f, gamma): | ||
r"""Compute the optical depth for Lyman-alpha absorption. |
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.
This function doesn't seem specific to Lya
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.
I fixed the docstring
I agree with @p-slash that Lyβ needs higher NHI to saturate and thus will be affected more by thermal broadening. What are we using for the b-parameter in both approaches? Are those fixed values for any DLA or something more sophisticated? How well do we know those values? And how large is the impact of the Lyβ differences? |
Regarding the difference in the profile, @p-slash which value are you using for the speed of light? I noticed that the reason why the tests are failing is because I changed the value of the speed of light that Cesar was using to the one stored in scipy.constants. Not sure if this would be enough to explain the differences, though |
I use |
Hi @p-slash |
Given that c=299792458 is an exact physical definition, I agree we should use that value and not some approximated one whereever possible... |
done @cramirezpe can you confirm if you are still seeing the difference you were seeing before? |
then let's merge this and close the issue |
Fixes #1019 .
I used Garnett 2018 as a reference as it seemed more clear to me, in the issue the comparison with the old method is detailed.