Calculate XRB luminosities#420
Calculate XRB luminosities#420devimisra wants to merge 11 commits intoPOSYDON-code:development-deprecatedfrom
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.
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.
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.
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.
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.
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.
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.
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.
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