Skip to content

Conversation

@devimisra
Copy link
Contributor

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

from posydon.utils.common_functions import eddington_limit


PATH_TO_POSYDON = os.environ.get("PATH_TO_POSYDON")
Copy link
Collaborator

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):
Copy link
Collaborator

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):
Copy link
Collaborator

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
Copy link
Collaborator

@mkruckow mkruckow Nov 1, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

Copy link
Collaborator

@maxbriel maxbriel left a 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))
Copy link
Collaborator

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? :)

@mkruckow mkruckow marked this pull request as draft March 20, 2025 15:20
@sgossage sgossage added the backlog This is sitting in our backlog of things to do. Action may be needed to pick back up. label Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backlog This is sitting in our backlog of things to do. Action may be needed to pick back up.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants