Skip to content
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

DM-40740: Create an obs_package to handle the fiber spectrographs #1

Merged
merged 42 commits into from
Mar 1, 2024

Conversation

aferte
Copy link
Collaborator

@aferte aferte commented Jan 23, 2024

Also needs lsst/daf_butler#948

@aferte aferte requested a review from timj January 23, 2024 20:40
@aferte aferte marked this pull request as draft January 23, 2024 20:41
@aferte aferte marked this pull request as ready for review January 23, 2024 21:09
Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for letting me look. I have lots of questions but some of those might be related to me not understanding.

I would like to see some explicit translator tests so that there is a sense of more than one day being tested. I am worried about the OBSID being a simple integer of 21 since the OBSID has to be unique for every observation (look at the LATISS ones and you will see that the sequence number is combined with the telescope name and day obs).

There is an implication that this code should work for more than one fiber spectrograph but I don't see a plan for how that will happen since a generic FiberSpec instrument name is being used. [RHL notes: yes, we have fiberSpectrographs in both the auxTel and the Simonyi telescope calibration systems)

policy/fiberSpectrograph.yaml Outdated Show resolved Hide resolved
policy/fiberSpectrograph.yaml Outdated Show resolved Hide resolved
python/lsst/obs/fiberspectrograph/__init__.py Outdated Show resolved Hide resolved
def getCamera(cls):
# Constructing a YAML camera takes a long time but we rely on
# yamlCamera to cache for us.
# N.b. can't inherit as PACKAGE_DIR isn't in the class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be open to you patching obs_lsst to add a package_dir class property so you could avoid copying this method.

Copy link
Collaborator Author

@aferte aferte Feb 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good - is it ok to push this to a future ticket to keep things simple for now?

ups/obs_fiberspectrograph.cfg Outdated Show resolved Hide resolved
@cache_translation
def to_datetime_begin(self):
self._used_these_cards("DATE-BEG")
return Time(self._header["DATE-BEG"], scale="tai", format="isot")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this instrument also had MJD-BEG.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get this added. Please file a ticket, and make sure that @parfa30 knows

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already files: DM-42693

python/lsst/obs/fiberspectrograph/translator.py Outdated Show resolved Hide resolved
python/lsst/obs/fiberspectrograph/translator.py Outdated Show resolved Hide resolved
python/lsst/obs/fiberspectrograph/translator.py Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
Add ingestion test.

Add test data.

Update default setup.

Update to do in ingestion test.
Update readme.

Update readme.

Change readme format.

Update setup.

Update readme.

Update lint file.

Update policy header.

Add new lines.

Remove unnecessary config file.
Update detector name.

Update detector name in test.
@aferte aferte requested a review from timj February 12, 2024 19:07
Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes. There are some minor additional comments.

.github/workflows/lint.yaml Outdated Show resolved Hide resolved
python/lsst/obs/fiberspectrograph/spectrum.py Outdated Show resolved Hide resolved
python/lsst/obs/fiberspectrograph/spectrum.py Outdated Show resolved Hide resolved
python/lsst/obs/fiberspectrograph/spectrum.py Outdated Show resolved Hide resolved
def getDetector(self):
return self.detector

def getInfo(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something you need to do now, but in future type annotations would really help. You should consider whether you need any of the explicitly getter methods since we are moving away from them for Exposure.

python/lsst/obs/fiberspectrograph/translator.py Outdated Show resolved Hide resolved
python/lsst/obs/fiberspectrograph/translator.py Outdated Show resolved Hide resolved
otherwise.
"""

return "INSTRUME" in header and header["INSTRUME"] in ["FiberSpectrograph.Broad"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this get resolved? ie is the broad going to be FiberSpec and the other variants will get different names when they start to arrive?

return self.to_exposure_time()

@staticmethod
def compute_exposure_id(dayobs, seqnum, controller=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ to the parent class implementation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parent method requires a supported controller, but currently the controller in the header is not supported. We are postponing this update and all related header updates to DM-43041.

tests/SConscript Outdated Show resolved Hide resolved
@aferte aferte merged commit eb5f2e1 into main Mar 1, 2024
2 checks passed
@aferte aferte deleted the tickets/DM-40740 branch March 1, 2024 17:25
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.

None yet

4 participants