From db49ff797938fce0649794c8f6d7d6d1ec46c9c9 Mon Sep 17 00:00:00 2001 From: Jim Chiang Date: Tue, 15 Jan 2019 21:48:13 -0800 Subject: [PATCH 1/7] enable client code to set OBSTYPE/IMGTYPE keyword in raw file output --- python/desc/imsim/camera_readout.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/desc/imsim/camera_readout.py b/python/desc/imsim/camera_readout.py index 02740563..4c84659a 100644 --- a/python/desc/imsim/camera_readout.py +++ b/python/desc/imsim/camera_readout.py @@ -454,7 +454,8 @@ def write_amplifier_image(self, amp_name, outfile, overwrite=True): output.writeto(outfile, overwrite=overwrite) def write_fits_file(self, outfile, overwrite=True, run_number=None, - lsst_num='LCA-11021_RTM-000', compress=True): + lsst_num='LCA-11021_RTM-000', compress=True, + image_type='SKYEXP'): """ Write the processed eimage data as a multi-extension FITS file. @@ -478,7 +479,7 @@ def write_fits_file(self, outfile, overwrite=True, run_number=None, output[0].header['TIMESYS'] = 'TAI' output[0].header['LSST_NUM'] = lsst_num output[0].header['TESTTYPE'] = 'IMSIM' - output[0].header['IMGTYPE'] = 'SKYEXP' + output[0].header['IMGTYPE'] = image_type output[0].header['OBSTYPE'] = output[0].header['IMGTYPE'] output[0].header['MONOWL'] = -1 raft, ccd = output[0].header['CHIPID'].split('_') From 596294ce205d1a5c25365b9c54cb14b41e382650 Mon Sep 17 00:00:00 2001 From: Jim Chiang Date: Wed, 16 Jan 2019 14:00:02 -0800 Subject: [PATCH 2/7] update docstring with image_type option --- python/desc/imsim/camera_readout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/desc/imsim/camera_readout.py b/python/desc/imsim/camera_readout.py index 4c84659a..b9c1e38e 100644 --- a/python/desc/imsim/camera_readout.py +++ b/python/desc/imsim/camera_readout.py @@ -469,6 +469,8 @@ def write_fits_file(self, outfile, overwrite=True, run_number=None, Run number. If None, then the visit number is used. compress: bool [True] Use RICE_1 compression for each image HDU. + image_type str ['SKYEXP'] + Image type to write to the `OBSTYPE` and `IMGTYPE` keywords. """ output = fits.HDUList(fits.PrimaryHDU()) output[0].header = self.eimage[0].header From 165ac18af632d2ac8994ec014588c94232fe1ed3 Mon Sep 17 00:00:00 2001 From: Jim Chiang Date: Wed, 16 Jan 2019 14:21:43 -0800 Subject: [PATCH 3/7] cast int as str since Stack code seem to have problems with unsigned ints > 2**31 in PropertySets --- python/desc/imsim/imSim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/desc/imsim/imSim.py b/python/desc/imsim/imSim.py index 1d52f93e..b66f6a19 100644 --- a/python/desc/imsim/imSim.py +++ b/python/desc/imsim/imSim.py @@ -841,7 +841,7 @@ def add_cosmic_rays(gs_interpreter, phot_params): crs.set_seed(cr_seed) gs_interpreter.detectorImages[name] = \ galsim.Image(crs.paint(imarr, exptime=exptime), wcs=image.wcs) - image.wcs.fitsHeader.set('CR_SEED', cr_seed) + image.wcs.fitsHeader.set('CR_SEED', str(cr_seed)) def add_treering_info(detectors, tr_filename=None): From 0ddad331c21b508bdf520af6b3a1255ae58bb6fb Mon Sep 17 00:00:00 2001 From: Jim Chiang Date: Wed, 16 Jan 2019 14:34:50 -0800 Subject: [PATCH 4/7] update README.md to refer to obs_lsst instead of obs_lsstCam --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e552d9fe..31c95209 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,14 @@ execute the `setup imsim` command, and that command can be issued from any directory. The `scons` build step needs only to be re-run if a new command line executable is added to the `bin.src` folder. -### obs_lsstCam +### obs_lsst The CCD pixel and LSST focalplane geometries are obtained from the -lsst/obs_lsstCam package, which is not yet part of the standard LSST +lsst/obs_lsst package, which is not yet part of the standard LSST distribution. Until it is, you'll need to clone a copy, set it up, and build: ``` -$ git clone https://github.com/lsst/obs_lsstCam.git -$ cd obs_lsstCam +$ git clone https://github.com/lsst/obs_lsst.git +$ cd obs_lsst $ setup -r . -j $ scons ``` From 73cc8f88c2784fa88a7467231babf59ffc0bf53e Mon Sep 17 00:00:00 2001 From: Jim Chiang Date: Wed, 16 Jan 2019 15:18:41 -0800 Subject: [PATCH 5/7] do not run tests for obs_lsst build --- travis_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_test.sh b/travis_test.sh index 8669995a..a58fca47 100755 --- a/travis_test.sh +++ b/travis_test.sh @@ -8,7 +8,7 @@ pip install pylint git clone https://github.com/lsst/obs_lsst.git cd obs_lsst setup -r . -j -scons +scons lib python shebang examples doc policy cd .. eups declare imsim -r ${TRAVIS_BUILD_DIR} -t current setup imsim From 4f49b6ef96c37d10917b3e232458b3e566a6db7b Mon Sep 17 00:00:00 2001 From: Jim Chiang Date: Wed, 16 Jan 2019 15:46:39 -0800 Subject: [PATCH 6/7] build the version.py module explicitly since its build is part of the tests target --- travis_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/travis_test.sh b/travis_test.sh index a58fca47..e1e03c73 100755 --- a/travis_test.sh +++ b/travis_test.sh @@ -8,7 +8,11 @@ pip install pylint git clone https://github.com/lsst/obs_lsst.git cd obs_lsst setup -r . -j -scons lib python shebang examples doc policy +# Build the obs_lsst package, but avoid the time consuming and lengthy +# output from the 'tests' target. The version module is built by the +# 'tests', so build that explicitly since it is imported by the +# package itself. +scons lib python shebang examples doc policy python/lsst/obs/lsst/version.py cd .. eups declare imsim -r ${TRAVIS_BUILD_DIR} -t current setup imsim From b3dccb974c23b2bf408b76a3afbe97e0a71b969d Mon Sep 17 00:00:00 2001 From: Jim Chiang Date: Wed, 16 Jan 2019 16:00:21 -0800 Subject: [PATCH 7/7] use stack-sims docker tag w_2018_49-sims_2_13_1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a27c0bf7..40a03c1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ dist: trusty compiler: gcc env: - - OS_TYPE=centos OS_VERSION=7 DOCKER_IMAGE=lsstdesc/stack-sims:w_2018_48-sims_2_13_0 + - OS_TYPE=centos OS_VERSION=7 DOCKER_IMAGE=lsstdesc/stack-sims:w_2018_49-sims_2_13_1 services: - docker