-
Notifications
You must be signed in to change notification settings - Fork 76
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
BlackBody and units support within modeling plugin #953
BlackBody and units support within modeling plugin #953
Conversation
Codecov Report
@@ Coverage Diff @@
## main #953 +/- ##
==========================================
+ Coverage 69.09% 70.39% +1.29%
==========================================
Files 69 73 +4
Lines 4935 5256 +321
==========================================
+ Hits 3410 3700 +290
- Misses 1525 1556 +31
Continue to review full report at Codecov.
|
613acc3
to
5ae04b9
Compare
* currently uses custom "fork" of BlackBody model with support for flux units. Will likely want to update this to the eventual support for flux units in astropy
* to update to new changes to models with units but without having to duplicate too much code logic
* but remove deprecation tests
5ae04b9
to
cc2a84d
Compare
* BlackBody now passes unitless scale with output_units assigned from the y-axis of the spectrum * BlackBody.output_units now supports passing units as strings (as it needs to be serializable within jdaviz) * the unitless scale is estimated from the maximum value of the spectrum converted into the native blackbody units (to handle cases where the y-unit contains 1e-17, etc) * automatic limits of (0, None) are placed on the scale to try to prevent the optimization from getting stuck at 0 if overshooting, but can still be somewhat sensitive to the initial guess. * fixes bug (likely introduced earlier in this PR) where overridden values from initializers were not being set correctly in the plugin. This does currently require looping over parameters twice and might be able to be simplified in the future.
cc2a84d
to
3dd2ef5
Compare
Ok, this passes all of my tests. I approve to merge! |
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 left a general review. I don't know how to use the plugin properly, so if @orifox et al. are happy with the usability, it is fine by me.
""" | ||
Initialization that is specific to the BlackBody model. | ||
|
||
Notes |
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 am not going to comment on the Sphinx stuff here because a hidden class will not make it to public API doc. FYI.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: P. L. Lim <[email protected]>
ce18253
to
ad97141
Compare
c85fb35
to
67d8eb5
Compare
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'll approve by proxy since @orifox is happy and my comments are addressed.
One other approval would be nice.
Thanks!
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.
Description
This pull request adds support for a BlackBody model in the modeling plugin (which in turn requires proper unit support for models in both jdaviz and specutils). Note that this PR is dependent on astropy/specutils#891 (now merged, but not yet released). Logic for Polynomial1D has been refactored to avoid duplicating code for the new support of units. Since astropy's BlackBody model does not (yet) support flux units, this uses a custom implementation until a proper solution is adopted in astropy.
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.CHANGES.rst
?