This module calculates the wavefront error in annular Zernike polynomials up to 22 terms based on the intra- and extra-focal donut images in the large synoptic survey telescope (LSST).
- CentOS 7
- python: 3.7.8
- scientific pipeline (
newinstall.sh
frommaster
branch)
- lsst_distrib (tag:
w_latest
) - phosim_utils
- clang-format (optional)
- black (optional)
- documenteer (optional)
- plantuml (optional)
- sphinxcontrib-plantuml (optional)
- Setup the LSST environment by
source $LSST_DIR/loadLSST.bash
. TheLSST_DIR
is the directory of scientific pipeline. - Install the
lsst_distrib
byeups distrib install lsst_distrib -t $TAG
. TheTAG
is the weekly built version such asw_2020_52
. - Fix the path by
curl -sSL https://raw.githubusercontent.com/lsst/shebangtron/master/shebangtron | python
. The shebangtron repo has the further discussion of this. - Clone the repository of
phosim_utils
to some other directory. Under thephosim_utils/
directory, usesetup -k -r . -t current
to setup the package ineups
and usescons
to build the module. The tag ofcurrent
means the current weekly built version. It is noted that the build process is only needed for the first time. - Under the directory of
ts_wep
, do:
setup -k -r .
scons
Pull the built docker image by docker pull lsstsqre/centos:w_latest
.
The scientific pipeline (lsst_distrib
) is installed already.
For the details of scientic pipeline, please follow the Index of /stack/src/tags.
- The Python code is automatically formatted by
black
. - The C++ code is automatically formatted by
clang-format
.
To enable this with a git pre-commit hook:
- Install the
black
Python package. - Install the
clang-format
C++ package. - Run
git config core.hooksPath .githooks
once in this repository.
- Make the faked flat images. Flats only need to be made once. They can then be shared between repos. The flats can be faked with (1) all sensors, (2) corner wavefront sensors, or (3) user-specified sensor list.
cd $work_dir
mkdir fake_flats
cd fake_flats/
makeGainImages.py
cd ..
- Repackage the PhoSim output amplifiers. The data needs to be put in single 16 extension MEFs (Multi-Extension FITS) for processing.
phosim_repackager.py $phosim_amp_dir --out_dir=repackaged_files
- Make the repository for butler to use, ingest the images, and ingest the calibration products.
mkdir input
echo lsst.obs.lsst.phosim.PhosimMapper > input/_mapper
ingestImages.py input repackaged_files/*.fits
ingestCalibs.py input fake_flats/* --validity 99999 --output input
- Make the config override file to turn only flat field on.
echo "config.isr.doBias=False
config.isr.doDark=False
config.isr.doFlat=True
config.isr.doFringe=False
config.isr.doDefect=False" >isr_config.py
- Run the instrument signature removal (ISR).
runIsr.py input --id --rerun=run1 --configfile isr_config.py
- Setup the DM environment.
source $path_of_lsst_scientific_pipeline/loadLSST.bash
cd $path_of_phosim_utils
setup -k -r . -t current
- Setup the WEP environment.
cd $path_of_ts_wep
setup -k -r .
- mapSensorAndFieldIdx.py: Map the sensor name to the field point index for LSST.
- mapSensorAndFieldIdxLsstFam.py: Map the sensor name to the field point for LSST full-array mode (FAM).
- The user can use the
Algorithm.getWavefrontMapEsti()
andAlgorithm.getWavefrontMapResidual()
incwfs
module to judge the estimated wavefront error after the solve of transport of intensity equation (TIE). The residual of wavefront map should be low compared with the calculated wavefront map if most of low-order Zernike terms (z4 - z22) have been captured and compensated. - The idea of TIE is to compensate the defocal images back to the focal one (image on pupil). Therefore, in the ideal case, the compensated defocal images should be similar. After the solve of TIE, the user can use the
CompensableImage.getImg()
incwfs
module to compare the compensated defocal images.
- While testing with the sky images obtained with the auxiliary telescope (localed in
tests/testData/testImages/auxTel
), this package and cwfs show the similar result in "onAxis" optical model. However, for the "paraxial" optical model, the results of two packages are different. - The main difference comes from the stratege of compensation in the initial loop of solving the TIE. However, it is hard to have a conclusion at this moment because of the low singal-to-noise ratio in test images.
To build project documentation, run package-docs build
to build the documentation.
The packages of documenteer, plantuml, and sphinxcontrib-plantuml are needed.
The path of plantuml.jar
in doc/conf.py
needs to be updated to the correct path.
To clean the built documents, use package-docs clean
.
See Building single-package documentation locally for further details.
- For the parameters of donut image migration, please follow: How we predict the shapes of donuts in the WFS devices.