You must have the LSST Stack installed on your system (see LSST Stack Installation) to proceed. The commands listed in the code blocks below primarily assume you are using the bash shell; analogous commands for (t)csh should work as well. If you have not already done so, load the LSST environment: where
Load the LSST Environment
$INSTALL_DIR is the directory where the LSST Stack was installed.
You must have the LSST Stack installed on your system (see LSST Stack Installation) to proceed. The commands listed in the code blocks below primarily assume you are using the bash shell; analogous commands for (t)csh should work as well. If you have not already done so, load the LSST environment:
If you have not already done so, download the tutorials package, which includes scripts and data files that will be useful for this tutorial. Then create an environment variable for the python script directory:
You will need to install the PhoSim package (available from the LSST software repository) if it is not already available on your system. See the instructions for Installing PhoSim on your target system. Be sure the SED library is installed in the
phosim/data sub-directory (or make a symlink to wherever the SED library is installed). The PhoSim reference manual (Peterson et al., 2013) is the definitive source of technical information about the package.
Simulating images with PhoSim is an extremely CPU intensive activity. This tutorial will minimize the extent of simulations needed, including the input physics, the number of sensors to be simulated, and the number of passbands and epochs to be simulated, while still illustrating the key steps for interesting processing and analysis. While these image simulations may be a substantial challenge for a modest desktop machine, users with significant compute resources will find it easy to extend this tutorial to more passbands, larger area, larger time coverage, or higher fidelity.
Create Simulated Images
For this tutorial the image simulations will be drawn from the portion of SDSS Stripe 82 as observed by a single CCD sensor at the center of the focal plane array. (View the LSST focal plane geometry for reference.) The simulations will include the g, r, i passbands, and a small range of dates and observing conditions.
Obtain the Reference Catalog
We will use the SDSS Stripe 82 Standard Star Catalog of Ivezic et al. (2007 AJ, 134, 973) which contains u,g,r,i,z photometry of over 1 million stars with r-band standard errors < 0.05 mag. Download the catalog (67 MB) and unpack it in a working directory.
Create Instance Catalogs
An instance catalog must be created to specify the observational parameters (pointing, seeing, etc.); and the positions, SEDs, and brightnesses of sources in the simulation. The trim file for this tutorial will be created from the reference catalog, using a python script (
refCalCat.py in the tutorials package
). To run the script, specify the filter of interest, a visit ID, spatial extent of the image(s) to be simulated, and the path to the SED library (relative to the
For this example we will use the range
-0.5 < RA < 0.5 and
-0.5 < Dec < 0.5, which is larger than the extent of the central Sensor. For simplicity a flat SED is used for all catalog stars, although the brightnesses will be taken from the reference catalog per filter. The visit ID is arbitrary, but it is handy to encode a date and some sort of sequence to aid bookkeeping. Create separate trim files for each filter of interest:
Astrometry Index Files
In order to perform astrometric calibration, index files must be available for the astrometry_net_data package to enable WCS solutions for science images. Since we are using the SDSS Stripe 82 Standard Star Catalog (i.e., the same reference catalog that was used for the Summer 2013 Data Release Production of Stripe 82 data), the index files have already been built; we need only to download and install the index files and setup the appropriate package to make use of them:
In the above,
$INSTALL_DIR refers the directory where the LSST Stack was installed. To build index files from a different reference catalog, it will likely need re-formatting for input to the index-building task. See the the tutorial Building Astrometry.net Index Files or the Astrometry.net web site for details.
Setup the following packages and set some handy environment variables, including the path to the PhoSim installation directory, and another to contain the number of cores available on your machine to enable parallel processing:
Now create images in the other colors, taking care to match the trim file name to the passband, and creating subdirectories for the output.
Creating an image from a single CCD sensor with the stars in this catalog takes ~1.5 hours on a 2006-era Mac Pro with 8 cores.
Calibrate the Images
Create the Data Repository
The images in the
*.out subdirectories do not follow the LSST Stack convention for data organization or file nomenclature. Thus, they need to be re-named and placed into a repository for subsequent processing by the LSST pipeline tasks. This can be accomplished with the tutorials script
rename_images.py. Now run the script for each
*.out directory, looping with your favorite shell:
Setup the Processing Packages
Source the LSST environment (
$INSTALL_DIR refers the directory where the LSST Stack was installed), and setup the following packages to run the processing pipeline and related tasks:
Now create the input registry for pipeline processing:
Run the pipeline to process the simulated images. This will generate catalogs of source measurements.
This tutorial will be expanded at a later time to process raw input (amp) images. This will require generating flat-field reference images.
Create Merged Catalog of Sources
The results of the processing in the prior section generates an output source catalog (in the form of FITS binary tables) for each image. In order to evaluate the resulting flux measurements it is handy to collect the photometric results in one table. The following script (download: makeCat.py) will create a merged catalog in the form of a CSV file, containing a subset of the columns in the input tables. This is very similar to the script used to demo the LSST Stack installation, and illustrates the use of the butler to fetch results in a repository.
When running the script to create the merged catalog, the visit selector (last argument) may be a single visit number, a sequence of visits joined by carrots (2004040^2004044), or a range of visits that are contiguous in sequence, separated by two dots, as in the following:
This merged catalog can be input to a large number of analysis tools. For analysis, it is possible to use the butler to fetch data directly from the repository for analysis with other packages in the LSST Stack, without the bother of writing an intermediate, merged catalog.