SWIMS Imaging Data Reduction Pipeline, written in Python, processes SWSB*/SWSR* FITS data to produce a final stacked image in a standard manner.
File | Contents |
swsred_20220406.tgz | Python core scripts (swsred/*py) and configuration/utility files |
Apr 6, 2022: BPM for S21B/S22A available.
Put files that you need on swsred/calib/bpm/ directory.
Note that BPMs for S22A are just symbolic links to S21B. If you have data on both S21B and S22A, you only need to download either BPMs and create symbolic links to them in swsred/calib/bpm/ directory, like "ln -s bpm_s21b_b1.fits bpm_s22a_b1.fits" to save your disk space.
Apr 6, 2022: Flat for S21B/S22A available.
Put files that you need on swsred/calib/flat/ directory.
Note that Flat data for S22A are just symbolic links to S21B. If you have data on both S21B and S22A, you only need to download either Flats and create symbolic links to them in swsred/calib/flat/ directory, like "ln -s flat_s21b_y_b1.fits flat_s22a_y_b1.fits" to save your disk space.
Usually, mosaicking is performed (using swarp) based on WCS information.
These files are needed only when your data do not have enough stars for astrometry.
File | Contents |
swsred_calib_mosaic_s18a_20210131.tgz | Mosaic parameter files for S18A data |
swsred_calib_mosaic_s18b_20210131.tgz | Mosaic parameter files for S18B data |
swsred_calib_mosaic_s21a_20210413.tgz | Tentative use only!! Mosaic parameter files for S21A data |
Use these test data (taken in S18B) to check if your swsred works.
File | Contents |
swsred_sample_b.tgz | J1-band data (4 frames x 2 arrays) |
swsred_sample_r.tgz | H1-band data (4 frames x 2 arrays) |
Here is a code to reduce the data. --> sample recipe
The reduced images produced with two iterations (n_iter=2) using swsred version 20210901 and the execution log (swsred.log) should be like these.
File | Contents |
fs12_j1_b1_stack1.fits | Stacked image (after two iterations) on the blue array #1. |
fs12_j1_b2_stack1.fits | Stacked image (after two iterations) on the blue array #2. |
fs12_j1_b1_stack1_exp.fits | The exposure map for fs12_j1_b1_stack1.fits. |
fs12_j1_b2_stack1_exp.fits | The exposure map for fs12_j1_b2_stack1.fits. |
fs12_j1_b1_stack1_wht.fits | The weight map for fs12_j1_b1_stack1.fits. |
fs12_j1_b2_stack1_wht.fits | The weight map for fs12_j1_b2_stack1.fits. |
fs12_j1.fits | Mosaicked image (after two iterations) on the blue arrays. |
fs12_j1_exp.fits | The exposure map for fs12_j1.fits. |
fs12_j1_wht.fits | The weight map for fs12_j1.fits. |
swsred_j1.log | Execution logs on reducing J1 data. |
fs12_h1_r1_stack1.fits | Stacked image (after two iterations) on the red array #1. |
fs12_h1_r2_stack1.fits | Stacked image (after two iterations) on the red array #2. |
fs12_h1_r1_stack1_exp.fits | The exposure map for fs12_h1_r1_stack1.fits. |
fs12_h1_r2_stack1_exp.fits | The exposure map for fs12_h1_r2_stack1.fits. |
fs12_h1_r1_stack1_wht.fits | The weight map for fs12_h1_r1_stack1.fits. |
fs12_h1_r2_stack1_wht.fits | The weight map for fs12_h1_r2_stack1.fits. |
fs12_h1.fits | Mosaicked image (after two iterations) on the red arrays. |
fs12_h1_exp.fits | The exposure map for fs12_h1.fits. |
fs12_h1_wht.fits | The weight map for fs12_h1.fits. |
swsred_h1.log | Execution logs on reducing H1 data. |
SWSRED requires the following python packages and astrOmatic softwares.
Package | Tested version | |
Python | 2.7.17 | 3.7.10 |
astropy | 2.0.9 | 4.2 |
numpy | 1.16.6 | 1.19.2 |
scipy | 1.2.1 | 1.6.2 |
matplotlib | 2.2.3 | 3.3.4 |
astroquery | 0.4 | 0.4.1 |
sextractor | 2.19.5 | 2.19.5 |
scamp | 2.7.8 | 2.10.0 |
swarp | 2.38.0 | 2.38.0 |
The astrOmatic softwares can be installed as follows if you have a anaconda environment.
% conda config --append channels conda-forge % conda install sextractor % conda install -c conda-forge astromatic-scamp % conda install -c conda-forge astromatic-swarp
Also, Internet connection is required during reducing data to access Pan-STARRS/2MASS catalogs.
% cd SWSRED_DIRECTORY % tar xvf swsred_20210527.tgz % tar xvf swsred_calib_mosaic_s21a_20210413.tgz % mkdir -p swsred/calib/bpm swsred/calib/flat
% export PYTHONPATH="SWSRED_DIRECTORY:${PYTHONPATH}
SWSRED has no documentations yet, but you can use a dirty script 'swsred/reduce_all.py' as a quick tutorial to learn how to use the software.
Be sure to use SWSRED within python interpreter (e.g., in ipython or jupyter, etc.), not via the command line as no command-line interfaces prepared.
Here is a quick introduction to use SWSRED.
> import glob > in_arr1 = glob.glob("DATA/PATH/SWSB*1.fits") # blue chip1 data > in_arr1.sort() # must be sorted before using.
import glob import astropy.io.fits dct1 = {} dct2 = {} infiles = glob.glob("SWS*fits") infiles.sort() for infile in infiles: hdr = astropy.io.fits.getheader(infile) ch = hdr["2_DETCH"] if ch == 1: dct = dct1 else: dct = dct2 if hdr["2_DSETID"] not in dct.keys(): dct[hdr["2_DSETID"]] = [] dct[hdr["2_DSETID"]].append(infile)
> import swsred.make_file_lst > file_lst1 = swsred.make_file_lst.make_file_lst(in_arr1)
Key | Value | Description |
in | data/path/SWSB00000001.fits | input filename |
ff | ffSWSB00000001.fits | filename of flat-fielded data |
ms | msSWSB00000001.fits | filename of self-sky data |
ss | ssSWSB00000001.fits | filename of sky-subtracted data |
wc | wcSWSB00000001.fits | filename of WCS-corrected data |
bpm | /SWSRED_DIRECTORY/calib/bpm/bpm_sXXY_b1.fits | filename of Bad-pixel mask (XXY denotes a semester) |
wht | SWSB00000001_wht.fits | filename of weight map (created by make_weight_map module) |
omsk | SWSB00000001_omsk.fits | filename of object mask |
ldac | ssSWSB00000001.ldac | filename of SExtractor LDAC catalog |
ascii | ssSWSB00000001.ascii | filename of SExtractor ASCII catalog |
head | ssSWSB00000001.head | filename of Scamp HEAD file |
> import swsred.flat_field > swsred.flat_field.flat_field(file_lst1["in"], file_lst1["ff"])
Refer to swsred/reduce_all.py for all the procedures.
Please send your bug reports or questions to konishi__at__ioa.s.u-tokyo.ac.jp.