-
Notifications
You must be signed in to change notification settings - Fork 29
Calculate XRB luminosities #420
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
base: development-deprecated
Are you sure you want to change the base?
Calculate XRB luminosities #420
Conversation
adding comment for WD radius
| from posydon.utils.common_functions import eddington_limit | ||
|
|
||
|
|
||
| PATH_TO_POSYDON = os.environ.get("PATH_TO_POSYDON") |
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 should be imported from common_functions.
| PATH_TO_POSYDON = os.environ.get("PATH_TO_POSYDON") | ||
|
|
||
|
|
||
| # def xrb_type(binary, idx=-1): |
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.
Please explain, why here is code, which isn't aimed to be used. May consider to simply remove it.
|
|
||
|
|
||
|
|
||
| # def beaming(binary): |
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.
Please explain, why here is code, which isn't aimed to be used. May consider to simply remove it.
| import copy | ||
| import warnings | ||
| from scipy.interpolate import PchipInterpolator | ||
| from posydon.utils.common_functions import eddington_limit |
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.
Please cleanup the imports, to what is needed. E.g. warnings looks to not being used. While it is good to include warnings please use the POSYDON warnings for that.
| * (1 + (v_wind / v) ** 2) ** (-4) * gamma ** (-1)) | ||
| for i in range(len(rdisk_div_risco)): | ||
| if rdisk_div_risco[i] <= 1: # No disk formed | ||
| mdot_acc[i] = 10**-99.0 |
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.
Please add an explanation to the PR, why this functionality is removed, i.e. what's wrong with it?
|
|
||
| def x_ray_luminosity(binary, observe_wind_XRB=False, idx=-1): | ||
| """ Calculate the geometrical beaming of a super-Eddington accreting source. | ||
| Compute the super-Eddington isotropic-equivalent accretion rate and the |
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.
Good doc strings! Just add a white line here between the "Calculate ..." line and "Compute ...." line
Could you add a description of the other input parameters too? ie:observe_wind_XRB and idx.
maxbriel
left a comment
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.
Specific to this PR:
Just some cleanup already indicated by Matthias. I left an additional comment on the docstring + cleanup. This is code you've used for your paper results?
Not specific to this PR: This uses a hook, but is still deeply integrated in the POSYDON code. Is this really how we want hooks to be used? Or is this an acceptable level of separate?
| if binary.event == 'END' or binary.event == 'FAILED': | ||
| binary.xrb_luminosity.append(x_ray_luminosity(binary,observe_wind_XRB=False)[0]) | ||
| binary.xrb_beaming.append(x_ray_luminosity(binary,observe_wind_XRB=False)[1]) | ||
| # diff = int(len(binary.event_history) - len(binary.Lx)) |
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.
could you remove the commented out lines, If they're not important? :)
Calculates the XRB luminosities using the super-Eddington accretion disc model from Shakura and Sunyaev (1973) and beaming from King (2001), as a hook.
The description to calculate XRB luminosities is in:
https://ui.adsabs.harvard.edu/abs/2023A%26A...672A..99M/abstract