Skip to content

Conversation

SherelynA
Copy link
Collaborator

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.

…e choice provided by the user which in many cases is the chosen evolutionary model.
@SherelynA SherelynA requested a review from kelle March 21, 2025 18:16
@SherelynA SherelynA self-assigned this Mar 21, 2025
@SherelynA
Copy link
Collaborator Author

Below is an example, where an evolutionary model was provided but when s.results is run, the inferred radius is not from the evolutionary model but from the a spt relation.

@kelle
Copy link
Member

kelle commented Mar 21, 2025

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.

@kelle
Copy link
Member

kelle commented Mar 21, 2025

Maybe you need to add a test_infer_radius function to https://github.com/BDNYC/sedkit/blob/main/tests/test_sed.py

@SherelynA
Copy link
Collaborator Author

the pseudocode @kelle , would be the following:
s.SED(name)
s.add_spectrum(spectrum=[wave,flux,eflux])

@SherelynA
Copy link
Collaborator Author

kelle and others added 3 commits March 23, 2025 21:15
…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.
@SherelynA SherelynA requested a review from kelle April 2, 2025 14:05
[
(
"sub_spec",
(0.973 * u.Rjup, 0.0 * u.Rjup, 0.0 * u.Rjup),
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

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.


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

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

Copy link
Member

@kelle kelle left a 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.

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.

2 participants