-
Notifications
You must be signed in to change notification settings - Fork 10
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
METIS WCU effects #494
base: main
Are you sure you want to change the base?
METIS WCU effects #494
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #494 +/- ##
==========================================
- Coverage 77.00% 76.82% -0.19%
==========================================
Files 66 69 +3
Lines 8216 8573 +357
==========================================
+ Hits 6327 6586 +259
- Misses 1889 1987 +98 ☔ View full report in Codecov by Sentry. |
I open the branch for review, although I don't intend to merge just yet. There is a problem with the fits keywords -- it's looking for telescope keywords where there are none. I may have to merge the corresponding irdb branch AstarVienna/irdb#205 first. |
I was about to ask 🤓
Oh yeah, these broken header keywords is to be expected. And I did. The idea was/is to split up https://github.com/AstarVienna/irdb/blob/dev_master/METIS/headers/FITS_common_keywords.yaml into more yaml files, and include more In this case, all the telescope-related header keywords should be in e.g. Unfortunately it is not possible to place these keywords in the ELT package, because other ELT instruments will want different keywords. So that means that there should be an extra yaml file in METIS that just includes a single ExtraFitsKeywords. Other solutions are possible, like just ignore anything that cannot be found, but that can easily lead to mistakes, so I deliberately did not add such a feature. |
Or maybe we can put this That is, have some default keywords provided by the ELT package itself (or an empty set of keywords as default) and then a mechanism to override that default with a keyword yaml file in METIS and MICADO? That would be cleaner than a separate yaml file in METIS just to include the METIS-specific |
Oh I should read first. Or maybe just shut up at 22:00, because that FITS header discussion does not directly apply to these test failures. Nevertheless, a similar solution can be applied here too. However, I would expect a similar problem to happen in AstarVienna/irdb#205 for the fits keywords in the |
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'm assuming that in general, you verified that this does what it's supposed to. My comments are mostly small unimportant suggestions on implementation details. But if nothing else, I'd like to avoid merging those three debug log configs 🙃
shift: tuple = (0, 0), | ||
**kwargs | ||
): | ||
logger.debug("Initialising FPMask with {}".format(maskname)) |
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.
logger.debug("Initialising FPMask with {}".format(maskname)) | |
logger.debug("Initialising FPMask with %s", maskname) |
(that way the formatting is only executed when debug logging is actually on)
plt.plot(self.xpix, self.ypix, 'o') | ||
plt.xlim(0, 2048) | ||
plt.ylim(0, 2048) | ||
plt.gca().set_aspect('equal') | ||
plt.show() |
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.
Perhaps use utils.figure_factory()
(and through that the "fig, ax" interface) instead? I'm always trying to not include direct script-like plt.
calls anywhere, as those can result in plotting over other figures...
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
params = { | ||
"z_order": [113, 513], |
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.
z_order
is now a ClassVar
in all effects. Please adapt to match the way this is now defined in the base class (TERCurve
) on main
...
self.meta.update(kwargs) | ||
if 'config_file' in self.meta: | ||
config_file = from_currsys(self.meta['config_file'], self.cmds) | ||
with open(find_file(config_file)) as fd: |
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.
with open(find_file(config_file)) as fd: | |
with open(find_file(config_file), encoding="utf-8") as fd: |
|
||
# Define surfaces (the IS surface is currently taken from parent class) | ||
# we add another one here (TODO: make this nicer) | ||
self.mask_surf = SpectralSurface(cmds = self.cmds) |
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.
self.mask_surf = SpectralSurface(cmds = self.cmds) | |
self.mask_surf = SpectralSurface(cmds=self.cmds) |
Feel free to ignore my nitpicking here 😛 (or add it to a batched commit, but don't bother turning this into a separate commit...)
logger.warning("bb_aperture value out of range [0, 1], clipping to {}" | ||
.format(value)) |
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.
logger.warning("bb_aperture value out of range [0, 1], clipping to {}" | |
.format(value)) | |
logger.warning("bb_aperture value out of range [0, 1], clipping to %f", | |
value) |
line_l = Gaussian1D(amplitude=amp, mean=lamc_l, stddev=sigma) | ||
line_m = Gaussian1D(amplitude=amp, mean=lamc_m, stddev=sigma) | ||
list_t = [Gaussian1D(amplitude=amp, mean=ll, stddev=sigma) for ll in lam_t] | ||
line_t = sum(list_t[1:], start=list_t[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.
nice 👍
self.mask_surf.meta.update(tbl.meta) | ||
|
||
|
||
def is_multiplication(self, wavelength, nport=2): |
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.
At first I read that as a question. As in, "is this a multiplication?", expecting it to return a bool
😅
But yeah, I got it after 1 s and it's fine...
tbl = Table(maskdict) | ||
return tbl |
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.
tbl = Table(maskdict) | |
return tbl | |
return Table(maskdict) |
just shorter...
level: INFO | ||
level: DEBUG | ||
astar.scopesim.optics.image_plane_utils: | ||
level: INFO | ||
level: DEBUG | ||
astar.scopesim.optics.surface: | ||
level: INFO | ||
level: DEBUG |
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.
Please change those back to INFO
before merging, otherwise we'll get log-spammed again...
This pull request includes Scopesim functionality to describe the METIS warm calibration unit. The idea is to have an empty source (
empty_sky
, taken as the default ofOpticalTrain.observe
, cf. #483), and add the emission at the exit of the integrating sphere as (subclasses of)TERCurve
(BlackBodySource
andLaserSource
). Further effects describe the aperture masks (including thermal emission from the opaque parts).The computation of the integrating-sphere exit radiance follows Roy van Boekel's radiometric model described in E-REP-MPIA-1203.