Package: tdr
TriCCS Data Reduction (TDR)developer mailOverviewData reduction of data taken with Seimei/TriCCS could be done in this repository.Though optimized for Seimei/TriCCS,
you can apply it for imaging data taken with other high-speed cameras
(Tomo-e Gozen etc.).ProceduresCalibration (dark subtraction, flat-field correction)Stacking fits by mean, median, etc.Splitting fits
(only for photometry usingMoving Object Photometry (movphot)(bitbucket) )Common ID searchInstalling# Install from PyPI
pip install tdror# Install with `setup.py`
git clone https://jin_beniyama@bitbucket.org/jin_beniyama/triccs-data-reduction.git
python setup.py installUsageHere g-band data taken with Seimei/TriCCS is considered.
All band data could be analyzed in the same way.Fits data taken with TriCCS have a format likeTRCS00005180.fits.First 4 charactersTRCSmeans the instrumentTriCCS,
the next 7 characters are the exposure IDand the last 1 character is band identical number
(0for g-band,1for r-band and2for i/z-band).After each reduction stage, a prefix is added to the filename.
History can be checked in fits header as well.1. CalibrationHere, consider the situation:
exposure time for an object frame is 10 s,
for a flat frame is 1 s,
and for dark frames are 1s and 10s (all in g-band)
like below.objectTRCS00000010.fits(10 s)dark for flatTRCS00000020.fits(1s)dark for objectTRCS00000030.fits(10s)flatTRCS00000040.fits(1s)Dark subtraction and flat-field correction are done as follows.First, create master dark frame, which has prefixdlikedTRCS00000020.fits.The maximum count frame is not used for stacking,
which leads to avoiding cosmic rays or fast-moving object contamination.[usage]
# Create master dark
makedark (3-d dark)

[example]
# Create master dark for flat
makedark TRCS00000020.fits
# Create master dark for object
makedark TRCS00000030.fitsNext, create a master normalized flat frame using master dark for a flat frame.
, which has prefixflikefTRCS00000040.fits.The maximum count frame is not used for stacking as well.[usage]
# Create master flat
makeflat --flat (3-d flat) --dark (2-d master dark)

[example]
# Create master flat
makeflat --flat TRCS00000040.fits --dark dTRCS00000020.fitsFinally, reduce an object frame using both master dark and flat frames.The reduced object frame has prefixrlikerTRCS00000010.fits.[usage]
# Do dark subtraction and flat-field correction
reduce --obj (3-d object) --dark (2-d master dark) --flat (2-d master flat)

[example]
# Do dark subtraction and flat-field correction
reduce --obj TRCS00000010.fits --dark dTRCS00000020.fits --flat fTRCS00000040.fits2. StackingOutput fits have format likemaxrTRCS00000010.fits(max),minrTRCS00000010.fits(min),meanrTRCS00000010.fits(mean) andmedianrTRCS00000010.fits(median).[usage]
# Maximum stacking
stackfits (3-d reduced fits) max
# Minimum stacking
stackfits (3-d reduced fits) min
# Mean stacking
stackfits (3-d reduced fits) mean
# Median stacking
stackfits (3-d reduced fits) median

[example]
# Maximum stacking
stackfits rTRCS00000010.fits  max
# Minimum stacking
stackfits rTRCS00000010.fits  min
# Mean stacking
stackfits rTRCS00000010.fits  mean
# Median stacking
stackfits rTRCS00000010.fits  median3. Splitting [in preparation]If you are going to useMoving Object Photometry (movphot)(bitbucket)for photometry,
3-d fits cube should be split into multiple 2-d fits.[usage]
# Mask pixels and split fits into multiple 2-d fits
mask_split (3-d fits)

[example]
# Mask pixels and split fits to multiple 2-d fits
mask_split rTRCS00000010.fitsOutput fits are as follows (when the number of frames is 3).
The masked and splitted frames hav suffixmslikerTRCS00000010ms0001.fits.4. Common ID searchIf the wcs pasting failed for some fits,
it is necessary to extract common ID fits.[example]
# Extract common fits ID from g,r,i bands list (glist.txt, rlist.txt, ilist.txt)
cat glist.txt | awk '{print substr($0,17,3)}' > gID.txt
cat rlist.txt | awk '{print substr($0,17,3)}' > rID.txt
cat ilist.txt | awk '{print substr($0,17,3)}' > iID.txt
# Create common ID list 
commonIDsearch gID.txt rID.txt iID.txt --pre rTRCS00001260ce0 
--post w.fits > glist_common.txtDependenciesThis library is depending onNumPy.
Scripts are developed onPython 3.7.10andNumPy 1.19.2.LICENCEThis software is released under the MIT License.