-
Notifications
You must be signed in to change notification settings - Fork 103
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
GMOS SOUTH CCD upgrade and some other fixes #1798
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1798 +/- ##
===========================================
- Coverage 39.07% 39.05% -0.02%
===========================================
Files 204 204
Lines 47012 47046 +34
===========================================
+ Hits 18370 18375 +5
- Misses 28642 28671 +29 ☔ View full report in Codecov by Sentry. |
pypeit/spectrographs/gemini_gmos.py
Outdated
if obsepoch is not None: | ||
return time.Time(obsepoch, format='jyear').mjd | ||
else: | ||
return None |
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.
you should update the docstring as well, because you are return None instead of a Metadata value read from the header(s)
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.
Agreed. I also wonder if it might be worthwhile throwing an error, or, throw a warning and then assume that the observations have ben taken since "2023-12-14".
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.
We likely do not want it to throw an error because this would cause pypeit_setup
to fault, which we want to avoid. Throwing a warning makes sense, and we can add that the return can be None
.
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.
Indeed, and I agree, but returning None could cause an error on line 846 (and several other places in this file where a possible None value is not checked)... I think?
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.
Ah, yes, you're right. @debora-pe , you'll need to catch the case @rcooke-ast pointed out. There are other places in the code that can catch a None mjd (e.g., starting at line 255 in metadata.py
), but maybe not everywhere.
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 decided to use a dummy mjd
(using today as date) and throwing a warning. What do you think?
Tests pass. The failures are unrelated and waiting for another PR to clear.
|
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.
Just minor comments from me. I'd encourage you to add some recent data to the dev-suite (and I presume there are old data just prior to the detector upgrade already in the dev suite)? Just to make sure that no bugs have crept in for either change.
) | ||
|
||
# account for the CCD upgrade happened on 2023-12-14 | ||
if hdu is not None: |
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.
Should this perhaps be defined before the detector dictionaries? (i.e. define parameters gain1
, gain2
, etc...). I think it's fine to update, but might be cleaner if we set variables near the top of this function and use those variables in the dictionary.
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 do actually prefer to leave it like this. Other spectrographs have the same flow. Also, the code below is only run if hdu
is provided, which would make the code full of if...else
if I define the parameters before the dictionary.
if hdu is not None: | ||
# date upgrade | ||
t_upgrade = time.Time("2023-12-14", format='isot') | ||
obs_date = time.Time(self.get_meta_value(self.get_headarr(hdu), 'mjd'), format='mjd') |
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.
Could this be None
sometimes?
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.
See my comment above
pypeit/spectrographs/gemini_gmos.py
Outdated
if obsepoch is not None: | ||
return time.Time(obsepoch, format='jyear').mjd | ||
else: | ||
return None |
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.
Agreed. I also wonder if it might be worthwhile throwing an error, or, throw a warning and then assume that the observations have ben taken since "2023-12-14".
@@ -85,15 +85,15 @@ def by_fitstbl_input(cls, frame: str, inp: str, spectrograph): | |||
m_es = inp.split(';') | |||
for m_e in m_es: | |||
parse = m_e.split(':') | |||
# det_strip will be a list of a single number (no mosaic) or 2 numbers (mosaic) | |||
# det_strip will be a list of a single number (no mosaic) or >= 2 numbers (mosaic) |
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.
If len(det_strip) == 1 the it is not a mosaic, otherwise it is
Just for the comment. In this way it is explicit
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.
Looks good. My main reason for clicking "request changes" is the detid
issue. All of the other comments are minor.
pypeit/spectrographs/gemini_gmos.py
Outdated
if obsepoch is not None: | ||
return time.Time(obsepoch, format='jyear').mjd | ||
else: | ||
return None |
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.
We likely do not want it to throw an error because this would cause pypeit_setup
to fault, which we want to avoid. Throwing a warning makes sense, and we can add that the return can be None
.
@rcooke-ast I agree that it would be good to have data in the Dev Suite, but the CCD update is so knew that there are no available public data. A PypeIt user gave me a couple of frame (no science), but that's everything I have. |
Tests still good. Except the unrelated failures.
|
Merging this now. |
As titled