-
Notifications
You must be signed in to change notification settings - Fork 4
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
flatlamp gets spectrum parameter; remove wrapper #124
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #124 +/- ##
=======================================
Coverage 74.22% 74.22%
=======================================
Files 30 30
Lines 1482 1482
=======================================
Hits 1100 1100
Misses 382 382 ☔ View full report in Codecov by Sentry. |
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.
The idea of the micado
directory is that these sources are MICADO-specific, and MICADO has only one specific flat lamp right? I'm not actually sure how the flat lamps work in MICADO, but they won't have a spectrum that can be freely changed.
So maybe it would make more sense to have a generic flatlamp source in the calibration
directory, and then have a specific one in micado
?
By the way, I noticed that there are already 2 flat-related functions in calibration.py
: lamp()
and flat_field()
. So I think it is becoming a bit messy.
FWIW, I still think it is worthwhile to keep those top level functions parameterless, but I'm just noting that for completeness sake as I already said that you can change hat if you prefer. But it seems it is still possible to call this one without parameters, so it should be fine. Perhaps then just remove the one you commented out?
The code is otherwise fine.
This is purely because people are using this function, and they're having problems with it. It is by no means meant to be a realistic representation of the MICADO calibration unit. |
Then wouldn't it be better to move the function to the It is not representative of MICADO, it is used also for other instruments, even by ourselves in the METIS notebooks, to the point that we need to generalize it to accept a different spectrum. |
I bring this up now, because it is one thing to have a bad flat lamp representation in the MICADO directory, but it is another thing to modify it so that it can be a less bad representation for METIS, while keeping it in the MICADO directory. |
Let it be then. |
For the record: I did approve the PR, in case that was not clear |
I approved the PR, because this PR would make things better in all ways. These PRs are also an opportunity to look a bit further than what is in front of our nose, to foster a shared vision, hence my more elaborate comments. Those comments were in addition to approving the PR as-is. So feel free to reopen and merge this. |
That is quite symptomatic of ScopeSim_Templates generally 🙃 |
The primary change is the addition of a parameter
spectrum
toflatlamp()
, allowing to set the lamp spectrum directly, thus avoiding constructions like the one that caused AstarVienna/ScopeSim#565.To allow accessing this parameter (and also
fraction
and others) I have removed (commented out) the wrapper inmicado/__init__.py
. This was discussed in #123. To be honest I don't quite follow the reasoning there, but for the function to be useful the user must be able to see and set the parameters explicitely.