Skip to content

Conversation

@jeremykubica
Copy link
Collaborator

This PR provides an initial proof of concept wrapper for redback models in TDAstro, including a demo notebook.

Replaces #433 and #410

@jeremykubica jeremykubica requested a review from hombit September 17, 2025 19:15
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link

github-actions bot commented Sep 17, 2025

Before [f65eb43] After [9f5cfa5] Ratio Benchmark (Parameter)
90.7±0.5μs 93.8±1μs 1.03 benchmarks.TimeSuite.time_make_and_evaluate_step_model
108±0.5μs 111±2μs 1.03 benchmarks.TimeSuite.time_sample_x0_from_distmod
30.2±0.4μs 30.9±0.4μs 1.02 benchmarks.TimeSuite.time_make_simple_linear_wavelength_model
1.02±0.01s 1.03±0.01s 1.02 benchmarks.TimeSuite.time_make_x1_from_hostmass
33.7±0.4ms 34.2±0.6ms 1.01 benchmarks.TimeSuite.time_additive_multi_model_source
555±10μs 562±10μs 1.01 benchmarks.TimeSuite.time_apply_passbands
4.50±0.09ms 4.53±0.1ms 1.01 benchmarks.TimeSuite.time_evaluate_salt3_passbands
124±8μs 125±5μs 1.01 benchmarks.TimeSuite.time_evaluate_simple_linear_wavelength_model
4.71±0.04ms 4.74±0.04ms 1.01 benchmarks.TimeSuite.time_lightcurve_source
19.2±0.3ms 19.4±0.09ms 1.01 benchmarks.TimeSuite.time_make_and_evaluate_static_sed

Click here to view all benchmarks.

Copy link
Collaborator

@hombit hombit left a comment

Choose a reason for hiding this comment

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

Please replace TDAstro with LightCurveLynx.

"As in other examples, we want to make the parameters dynamic to mirror a real simulation. Let's start by drawing:\n",
"\n",
" * The location (`RA`, `dec`) uniformly from the footprint of the survey.\n",
" * The start time (`t0`) uniformly from the coverage of the survey.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
" * The start time (`t0`) uniformly from the coverage of the survey.\n",
" * The start time (`t0`, days) uniformly from the coverage of the survey.\n",

"\n",
"As in other examples, we want to make the parameters dynamic to mirror a real simulation. Let's start by drawing:\n",
"\n",
" * The location (`RA`, `dec`) uniformly from the footprint of the survey.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
" * The location (`RA`, `dec`) uniformly from the footprint of the survey.\n",
" * The location (`RA`, `dec`, both in degrees) uniformly from the footprint of the survey.\n",

" * The location (`RA`, `dec`) uniformly from the footprint of the survey.\n",
" * The start time (`t0`) uniformly from the coverage of the survey.\n",
" * The `redshift` uniformly from [0.0, 0.1]\n",
" * The mass ejecta (`mej`) as a Gaussian with mean 0.05\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess...

Suggested change
" * The mass ejecta (`mej`) as a Gaussian with mean 0.05\n",
" * The mass ejecta (`mej`, solar masses) as a Gaussian with mean 0.05\n",

"\n",
"For the rest of the parameters we will set as constants (though these could also use samplers):\n",
"\n",
" * Gray opacity (`kappa`) = 1\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess

Suggested change
" * Gray opacity (`kappa`) = 1\n",
" * Gray opacity (`kappa`, cm^2/g) = 1\n",

"For the rest of the parameters we will set as constants (though these could also use samplers):\n",
"\n",
" * Gray opacity (`kappa`) = 1\n",
" * Temperature floor in K (`temperature_floor`) = 3000\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
" * Temperature floor in K (`temperature_floor`) = 3000\n",
" * Temperature floor in K (`temperature_floor`, kelvins) = 3000\n",

"\n",
" * Gray opacity (`kappa`) = 1\n",
" * Temperature floor in K (`temperature_floor`) = 3000\n",
" * Minimum initial velocity (`vej`) = 0.2\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Guessing again =)

Suggested change
" * Minimum initial velocity (`vej`) = 0.2\n",
" * Minimum initial velocity (`vej`, fraction of the speed of light) = 0.2\n",

"source": [
"## Using Redback Priors\n",
"\n",
"Redback models have the ability to draw their parameters using samples from the `bilby` package. We can either define these priors manually or use one of the many sets of priors that are predefined in the redback package ([more information on redback priors here](https://redback.readthedocs.io/en/latest/priors.html). Now let’s load the predefined priors for the \"one_component_kilonova_model\".\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"Redback models have the ability to draw their parameters using samples from the `bilby` package. We can either define these priors manually or use one of the many sets of priors that are predefined in the redback package ([more information on redback priors here](https://redback.readthedocs.io/en/latest/priors.html). Now let’s load the predefined priors for the \"one_component_kilonova_model\".\n",
"Redback models have the ability to draw their parameters using samples from the `bilby` package. We can either define these priors manually or use one of the many sets of priors that are predefined in the redback package ([more information on redback priors here](https://redback.readthedocs.io/en/latest/priors.html)). Now let’s load the predefined priors for the \"one_component_kilonova_model\".\n",

@jeremykubica jeremykubica requested a review from hombit September 18, 2025 16:22
@jeremykubica jeremykubica requested a review from hombit September 22, 2025 20:06
Copy link
Collaborator

@hombit hombit left a comment

Choose a reason for hiding this comment

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

Thank you, the notebook looks great!

@jeremykubica jeremykubica merged commit 8d34574 into main Sep 23, 2025
6 checks passed
@jeremykubica jeremykubica deleted the redback3 branch September 23, 2025 13:05
@jeremykubica jeremykubica mentioned this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants