Skip to content

Commit

Permalink
Merge pull request #198 from LSSTDESC/u/jchiang/OBSTYPE_fix
Browse files Browse the repository at this point in the history
minor patches for header keyword handling
  • Loading branch information
jchiang87 authored Jan 17, 2019
2 parents 037a8e3 + b3dccb9 commit 912b459
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
7 changes: 5 additions & 2 deletions python/desc/imsim/camera_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -468,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
Expand All @@ -478,7 +481,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('_')
Expand Down
2 changes: 1 addition & 1 deletion python/desc/imsim/imSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 5 additions & 1 deletion travis_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ pip install pylint
git clone https://github.com/lsst/obs_lsst.git
cd obs_lsst
setup -r . -j
scons
# 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
Expand Down

0 comments on commit 912b459

Please sign in to comment.