TriCCS Data Reduction
Project description
TriCCS Data Reduction (TDR)
Overview
Data 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.).
Procedures
-
Calibration (dark subtraction, flat-field correction)
-
Stacking fits by mean, median, etc.
-
Splitting fits (only for photometry using
Moving Object Photometry (movphot)
(bitbucket) ) -
Common ID search
Installing
# Install from PyPI
pip install tdr
or
# Install with `setup.py`
git clone https://jin_beniyama@bitbucket.org/jin_beniyama/triccs-data-reduction.git
python setup.py install
Usage
Here 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 like TRCS00005180.fits
.
First 4 characters TRCS
means the instrument TriCCS,
the next 7 characters are the exposure ID
and the last 1 character is band identical number
(0
for g-band, 1
for r-band and 2
for i/z-band).
After each reduction stage, a prefix is added to the filename. History can be checked in fits header as well.
1. Calibration
Here, 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.
- object
TRCS00000010.fits
(10 s) - dark for flat
TRCS00000020.fits
(1s) - dark for object
TRCS00000030.fits
(10s) - flat
TRCS00000040.fits
(1s)
Dark subtraction and flat-field correction are done as follows.
First, create master dark frame, which has prefix d
like dTRCS00000020.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.fits
Next, create a master normalized flat frame using master dark for a flat frame.
, which has prefix f
like fTRCS00000040.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.fits
Finally, reduce an object frame using both master dark and flat frames.
The reduced object frame has prefix r
like rTRCS00000010.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.fits
2. Stacking
Output fits have format like
maxrTRCS00000010.fits
(max),
minrTRCS00000010.fits
(min),
meanrTRCS00000010.fits
(mean) and
medianrTRCS00000010.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 median
3. Splitting [in preparation]
If you are going to use Moving 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.fits
Output fits are as follows (when the number of frames is 3).
The masked and splitted frames hav suffix ms
like rTRCS00000010ms0001.fits
.
4. Common ID search
If 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.txt
Dependencies
This library is depending on NumPy
.
Scripts are developed on Python 3.7.10
and NumPy 1.19.2
.
LICENCE
This software is released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file tdr-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: tdr-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8943fd1535a884ceef75510191db1b7763c909f401d00852e06fb14aec4e575c |
|
MD5 | a218128ba0cc1af3df0890bfe81f788e |
|
BLAKE2b-256 | aa67aa675dc8187483499a082c6e56ace9abd2a13823c79fa9cfe81c661a54aa |