Skip to content

[enhancement] Add power law mass ratio options for reweighting#837

Open
maxbriel wants to merge 3 commits intov2.3from
mb_mass_ratio_slope
Open

[enhancement] Add power law mass ratio options for reweighting#837
maxbriel wants to merge 3 commits intov2.3from
mb_mass_ratio_slope

Conversation

@maxbriel
Copy link
Copy Markdown
Collaborator

@maxbriel maxbriel commented Apr 16, 2026

Allows the user to request a mass ratio distribution following a (requested) power law slope.
Usage example:

params = {
    'secondary_mass_scheme': 'power_law_mass_ratio',
    'mass_ratio_slope': -1.0,  # alpha in q^alpha
    'q_min': 0.0,
    'q_max': 1.0,
    ...
}

@maxbriel maxbriel requested a review from a team April 16, 2026 11:24
@maxbriel maxbriel self-assigned this Apr 16, 2026
@maxbriel maxbriel added the enhancement New feature or request label Apr 16, 2026

from posydon.utils.common_functions import inverse_sampler

n_points = 1000
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make n_points an argument vs. hard coded?

>>> pdf_value = dist.pdf(0.5)
"""

def __init__(self, alpha=0.0, q_min=0.05, q_max=1.0):
Copy link
Copy Markdown
Contributor

@sgossage sgossage Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly necessary for this PR, but it looks like this class has some overlap with FlatMassRatio and we could create a parent class that this class and that class are children of, modifying just the relevant parts.

@sgossage sgossage requested review from a team and sgossage April 22, 2026 18:19
@maxbriel maxbriel added this to the v2.3 milestone Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants