-
Notifications
You must be signed in to change notification settings - Fork 14
Fixing Infer Radius Method #153
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: main
Are you sure you want to change the base?
Conversation
…e choice provided by the user which in many cases is the chosen evolutionary model.
Is the issue describing the problem you are trying to fix? #135 Ideally, you would write a test which demonstrates the "broken" behavior and then your fix would make that test pass. |
Maybe you need to add a test_infer_radius function to https://github.com/BDNYC/sedkit/blob/main/tests/test_sed.py |
the pseudocode @kelle , would be the following: |
…uld provide the user with a six digit radius when having an sed with substellar units.
…ts and another where we don't. It may be a bit much but I wanted to make sure that we were getting sensible values for both. Currently some tests fail, so I will continue to tweak.
Parametrize results too
…ven though the uncertainties are 0.001, in the results table they show up as zero.
[ | ||
( | ||
"sub_spec", | ||
(0.973 * u.Rjup, 0.0 * u.Rjup, 0.0 * u.Rjup), |
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.
Is this what you really want, uncertainties of 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.
Hi, yes and no, these zero uncertainties come because the radius in this case scenario is derived from the Lbol_sun in the dwarf sequence.txt and the interpolation the the code does ends up providing these uncertainties. I tried playing around a bit with this code Joe wrote but not super sure why it gives zero as the uncertainty.
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.
I think it's happening because of the round()
statements on line 289 of relations.py. See my other comment.
sedkit/relations.py
Outdated
|
||
if y_upper is not None: | ||
return y_val, y_upper, y_lower, self.ref | ||
return y_val.round(3), y_upper.round(3), y_lower.round(3), self.ref |
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.
I don't think you should round these values. instead, I think you should consider using %g formatting when displaying it to the user.
Check out the examples here: https://stackoverflow.com/a/3411731/4842634
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.
Investigate the %g formatting instead of rounding the actual calculations.
Co-authored-by: Kelle Cruz <kellecruz@gmail.com>
…ferent formating to the evaluate function to have proper sig figs.
…se precision and it still provides 0 as the uncertainty simply because of the interpolation from the sequence. The zero is not from the formatting.
…e evalue the calculation in isochrone.py.
… fundamental parameters. Also, integrate the keyword for the age distribution in the evaluation lines.
…tements to account for how larger age ranges will give extremely similar results but not identical.
Currently, the checking infer_from loop is not properly preferring the choice provided by the user which in many cases is the chosen evolutionary model. I think changing this loop will change infer_from properly to evo_model.