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-23090: Add LATISS commissioning filters #158

Merged
merged 6 commits into from
Jan 16, 2020
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
17 changes: 17 additions & 0 deletions doc/lsst.obs.lsst/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ You can find Jira issues for this module under the `obs_lsst <https://jira.lsstc
adding-a-camera.rst
testing.rst

.. _lsst.obs.lsst-scripts:
patrickingraham marked this conversation as resolved.
Show resolved Hide resolved

Command Line Scripts
====================

.. autoprogram:: lsst.obs.lsst.script.generateCamera:build_argparser()
:prog: generateCamera.py
:groups:

.. autoprogram:: lsst.obs.lsst.script.phosimToRafts:build_argparser()
:prog: phossimToRafts.py
:groups:

.. autoprogram:: lsst.obs.lsst.script.rewrite_ts8_qe_files:build_argparser()
:prog: rewrite_ts8_qe_files.py
:groups:

.. _lsst.obs.lsst-pyapi:

Python API reference
Expand Down
25 changes: 8 additions & 17 deletions python/lsst/obs/lsst/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,17 @@
FilterDefinition(physical_filter="NONE",
lambdaEff=0.0,
alias={"no_filter", "OPEN"}),
# The LSST Filters from L. Jones 04/07/10
FilterDefinition(physical_filter="u",
abstract_filter="u",
lambdaEff=364.59, lambdaMin=324.0, lambdaMax=395.0),
FilterDefinition(physical_filter="g",
FilterDefinition(physical_filter="blank_bk7_wg05",
lambdaEff=0.0),

Choose a reason for hiding this comment

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

if lambdaEff=0.0 are lambdaMin and lambdaMax not needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

That seems to be the implication from looking elsewhere.

FilterDefinition(physical_filter="KPNO_1111_436nm",
abstract_filter="g",
lambdaEff=476.31, lambdaMin=405.0, lambdaMax=552.0),
FilterDefinition(physical_filter="r",
lambdaEff=436.0, lambdaMin=386.0, lambdaMax=486.0),
FilterDefinition(physical_filter="KPNO_373A_677nm",
abstract_filter="r",
lambdaEff=619.42, lambdaMin=552.0, lambdaMax=691.0),
FilterDefinition(physical_filter="i",
abstract_filter="i",
lambdaEff=752.06, lambdaMin=818.0, lambdaMax=921.0),
FilterDefinition(physical_filter="z",
lambdaEff=677.0, lambdaMin=624.0, lambdaMax=730.0),
FilterDefinition(physical_filter="KPNO_406_828nm",
abstract_filter="z",
lambdaEff=866.85, lambdaMin=922.0, lambdaMax=997.0),
# official y filter
FilterDefinition(physical_filter="y",
abstract_filter="y",
lambdaEff=971.68, lambdaMin=975.0, lambdaMax=1075.0, alias=['y4']),
lambdaEff=828.0, lambdaMin=738.5, lambdaMax=917.5),
FilterDefinition(physical_filter="diffuser",
lambdaEff=0.0),
FilterDefinition(physical_filter="EMPTY",
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/obs/lsst/lsstCamMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def __init__(self, inputPolicy=None, **kwargs):
LsstCamMapper._nbit_patch = 5
LsstCamMapper._nbit_filter = 6

LsstCamMapper._nbit_id = 64 - (LsstCamMapper._nbit_tract + 2*LsstCamMapper._nbit_patch +
LsstCamMapper._nbit_filter)
LsstCamMapper._nbit_id = 64 - (LsstCamMapper._nbit_tract + 2*LsstCamMapper._nbit_patch

Choose a reason for hiding this comment

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

This is rather unclear to me what this is doing...
There is a limit on how many filters you can declare to afw?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not obvious but the important thing for this pull request is that I moved the plus from the end of one line to the start of the next because of an RFC that got adopted yesterday.

Choose a reason for hiding this comment

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

OK, please link the RFC to the ticket prior to merging.

+ LsstCamMapper._nbit_filter)

if len(afwImage.Filter.getNames()) >= 2**LsstCamMapper._nbit_filter:
raise RuntimeError("You have more filters defined than fit into the %d bits allocated" %
Expand Down
13 changes: 6 additions & 7 deletions python/lsst/obs/lsst/script/rewrite_ts8_qe_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def rewrite_ts8_files(picklefile, out_root='.', valid_start='1970-01-01T00:00:00
detector_id = cam[full_detector_name].getId()
curve_table.meta.update({'CALIBDATE': valid_start, 'INSTRUME': 'TS8', 'OBSTYPE': 'qe_curves',
'DETECTOR': detector_id, 'PICKLEFILE': os.path.split(picklefile)[1]})
curve_table.meta['CALIB_ID'] = (f'raftName={raft_name} detectorName={detector_name} ' +
f'detector={detector_id} calibDate={valid_start} ' +
curve_table.meta['CALIB_ID'] = (f'raftName={raft_name} detectorName={detector_name} '
f'detector={detector_id} calibDate={valid_start} '
f'ccd={detector_id} ccdnum={detector_id} filter=None')
curve.writeText(outfile)

Expand All @@ -143,24 +143,23 @@ def build_argparser():
The argument parser that defines the ``rewrite_ts8_qe_files.py``
command-line interface.
"""
parser = argparse.ArgumentParser(description = 'Rewrite native FITS files from the test ' +
parser = argparse.ArgumentParser(description = 'Rewrite native FITS files from the test '
'stand to a standard format')
parser.add_argument('picklefile', help = "Pickle file to read.")
parser.add_argument('--out_root', type = str,
help = "Root directory to which to write outputs", default = '.')
parser.add_argument('--valid_start', type = str,
help = "ISO format date string stating the stgart of the validity range.",
help = "ISO format date string stating the start of the validity range.",
default = '1970-01-01T00:00:00')

args = parser.parse_args()
sys.exit(rewrite_ts8_files(args.picklefile, args.out_root, args.valid_start))
return parser


def main():
args = build_argparser().parse_args()

try:
sys.exit(rewrite_ts8_files(args.picklefile, args.out_root, args.valid_start))
rewrite_ts8_files(args.picklefile, args.out_root, args.valid_start)
except Exception as e:
print(f"{e}", file=sys.stderr)
return 1
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[flake8]
max-line-length = 110
max-doc-length = 79
ignore = E133, E226, E228, E251, N802, N803, N806, N812, N815, N816, W504
ignore = E133, E226, E228, E251, N802, N803, N806, N812, N815, N816, W503
exclude = __init__.py, config/*.py, bin/*

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