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-27883: Fix test collection problem with curated calibs #281

Merged
merged 2 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions python/lsst/obs/lsst/translators/latiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,16 @@ def fix_header(cls, header, instrument, obsid, filename=None):
# did not split as expected
pass
if dayObs is None or len(dayObs) != 8:
dayObs = header["OBS-NITE"]
log.debug("%s: Setting DAYOBS to '%s' from OBS-NITE header", log_label, dayObs)
if "OBS-NITE" in header:
dayObs = header["OBS-NITE"]
log.debug("%s: Setting DAYOBS to '%s' from OBS-NITE header", log_label, dayObs)
else:
log.debug("%s: Unable to determine DAYOBS from header", log_label)
else:
log.debug("%s: Setting DAYOBS to '%s' from OBSID", log_label, dayObs)
header["DAYOBS"] = dayObs
modified = True
if dayObs:
header["DAYOBS"] = dayObs
modified = True

if "SEQNUM" not in header:
try:
Expand All @@ -252,7 +256,7 @@ def fix_header(cls, header, instrument, obsid, filename=None):
log.debug("%s: Extracting SEQNUM of '%s' from OBSID", log_label, header["SEQNUM"])

# The DATE-OBS / MJD-OBS keys can be 1970
if header["DATE-OBS"].startswith("1970"):
if "DATE-OBS" in header and header["DATE-OBS"].startswith("1970"):
# Copy the headers from the DATE and MJD since we have no other
# choice.
header["DATE-OBS"] = header["DATE"]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ignore = E133, E226, E228, E251, N802, N803, N806, N812, N815, N816, W503
exclude = __init__.py, config/*.py, bin/*, tests/config/*.py

[tool:pytest]
addopts = --flake8
addopts = --flake8 --ignore=latiss --ignore=lsstcam --ignore=ts8
flake8-ignore = E133 E226 E228 E251 N802 N803 N806 N812 N815 N816 W503
config/*.py ALL
bin/* ALL