Sigma image
From MediaWiki
m (→SDSS sigma image) |
m (→Sigma image creation) |
||
(25 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
+ | == Sigma image creation == | ||
+ | |||
+ | * Number of photo-electrons: | ||
+ | N<sub>e</sub> = (F<sub>gal</sub>+F<sub>sky</sub>) × N<sub>comb</sub> × G | ||
+ | |||
+ | N<sub>comb</sub> - number of images | ||
+ | |||
+ | F<sub>gal</sub> [ADU] - flux of the galaxy | ||
+ | |||
+ | F<sub>sky</sub> [ADU] - flux of the sky background | ||
+ | |||
+ | G [e/ADU] - gain parameter | ||
+ | |||
+ | σ<sup>2</sup>(N<sub>e</sub>) = N<sub>e</sub> + N<sub>comb</sub> × RON<sup>2</sup> | ||
+ | |||
+ | RON<sup>2</sup> [e] - readout noise | ||
+ | |||
+ | If there is a substantial dark current, then average value can be added in quadrature: | ||
+ | |||
+ | σ<sup>2</sup>(N<sub>e</sub>) = N<sub>e</sub> + N<sub>comb</sub> × RON<sup>2</sup> + <DC> × N<sub>comb</sub> | ||
+ | |||
+ | <DC>[e] - dark current of the same exposure time as the images | ||
+ | |||
+ | σ = σ(N<sub>e</sub>) / (N<sub>comb</sub> × G) | ||
+ | |||
== SDSS sigma image == | == SDSS sigma image == | ||
Line 4: | Line 29: | ||
There is gain + rdnoise depending on camcol (for each filter) in the table (same link)! | There is gain + rdnoise depending on camcol (for each filter) in the table (same link)! | ||
- | To get sigma image go from Nmgy to DN: | + | |
- | + | To get sigma image go from Nmgy to DN: sky-subtracted image as well as calibrated in nanomaggies/pixel | |
- | img= mrdfits(framename,0,hdr) | + | |
- | nrowc= (size(img,/dim))[1] | + | img = mrdfits(framename,0,hdr) |
- | sky= mrdfits(framename,2) | + | nrowc = (size(img,/dim))[1] |
- | + | sky = mrdfits(framename,2) | |
- | simg= interpolate(sky.allsky, sky.xinterp, sky.yinterp, /grid) | + | |
- | + | Sky image must be of the same size as the frame image, in units of counts | |
- | + | simg= interpolate(sky.allsky, sky.xinterp, sky.yinterp, /grid) | |
- | calib= mrdfits(framename,1) | + | |
- | cimg= calib#replicate(1.,nrowc) | + | a calibration image the same size as the frame image, in units of nanomaggies per count |
- | + | ||
- | dn= img/cimg+simg | + | calib = mrdfits(framename,1) |
- | + | cimg= calib#replicate(1.,nrowc) | |
- | dn_err= sqrt(dn/gain+darkVariance) ; in counts | + | |
- | + | Original image in DN | |
- | img_err= dn_err*cimg | + | |
+ | dn = img/cimg + simg | ||
+ | |||
+ | Corresponding sigma image | ||
+ | dn_err= sqrt(dn/gain+darkVariance) ; in counts | ||
+ | |||
+ | To get those errors into nanomaggies, you simply apply back the calibration: | ||
+ | img_err = dn_err*cimg | ||
+ | |||
+ | == Spitzer S4G sigma image == | ||
+ | |||
+ | Ex. dwarf galaxy DDO 053: SKYDRKZB = 0.035142 and FLUXCONV = 0.1088 | ||
+ | |||
+ | imcopy ddo053_v7.phot.1 ddo53.phot.1 | ||
+ | ! SIGMA IMAGE must not have ZEROS, which we will solve by replacing 0 -> -1 in the WEIGHT image. | ||
+ | imarith ddo053_v7.phot.1_wt.fits + 0. test | ||
+ | imexpr expr='(a = b) ? c : a' a='test.fits' b='0' c='-1' output='ddo53.phot.1_wt.fits' | ||
+ | imarith ddo53.phot.1.fits + 0.035142 ddo53.phot.1_sky.fits | ||
+ | imarith ddo53.phot.1_sky.fits / 909.9265 ddo53.phot.1_tmp.fits // 1./0.1088 *30*3.3 = 909.9265 | ||
+ | imarith ddo53.phot.1_wt.fits / 10 ddo53_W.fits | ||
+ | imarith ddo53.phot.1_tmp.fits * ddo53_W.fits ddo53_Ne.fits | ||
+ | imarith ddo53_W.fits * 213.16 ddo53_ron.fits // 14.6*14.6 = ron^2 iz Salo2014_S4G | ||
+ | imarith ddo53_Ne.fits + ddo53_ron.fits ddo53_sigma2.fits | ||
+ | stsdas | ||
+ | toolbox | ||
+ | imgtools | ||
+ | imcalc ddo53_sigma2.fits ddo53_sigma.fits "sqrt(im1)" nullval="0" | ||
+ | imarith ddo53_sigma.fits * 0.0011 ddo53_sigma_tmp.fits | ||
+ | imarith ddo53_sigma_tmp.fits / ddo53_W.fits ddo53_sigma_est.fits | ||
+ | imarith ddo53_sigma_est.fits * 0.9 ddo53_sigma_decom.fits | ||
+ | imexpr expr='(a = b) ? c : a' a='ddo53_sigma_decom.fits' b='0' c='0.00266506' | ||
+ | output='ddo53_sigma_final.fits' | ||
+ | |||
+ | // This last number c is iterstat ddo53_sigma_decom.fits (it's last average value). Simply | ||
+ | replace zeros in the sigma image by some resonable values, doesn't matter since galfit | ||
+ | won't see those given the bad pixel mask... |
Revision as of 13:33, 12 June 2018
Sigma image creation
- Number of photo-electrons:
Ne = (Fgal+Fsky) × Ncomb × G
Ncomb - number of images
Fgal [ADU] - flux of the galaxy
Fsky [ADU] - flux of the sky background
G [e/ADU] - gain parameter
σ2(Ne) = Ne + Ncomb × RON2
RON2 [e] - readout noise
If there is a substantial dark current, then average value can be added in quadrature:
σ2(Ne) = Ne + Ncomb × RON2 + <DC> × Ncomb
<DC>[e] - dark current of the same exposure time as the images
σ = σ(Ne) / (Ncomb × G)
SDSS sigma image
http://data.sdss3.org/datamodel/files/BOSS_PHOTOOBJ/frames/RERUN/RUN/CAMCOL/frame.html
There is gain + rdnoise depending on camcol (for each filter) in the table (same link)!
To get sigma image go from Nmgy to DN: sky-subtracted image as well as calibrated in nanomaggies/pixel
img = mrdfits(framename,0,hdr) nrowc = (size(img,/dim))[1] sky = mrdfits(framename,2)
Sky image must be of the same size as the frame image, in units of counts
simg= interpolate(sky.allsky, sky.xinterp, sky.yinterp, /grid)
a calibration image the same size as the frame image, in units of nanomaggies per count
calib = mrdfits(framename,1) cimg= calib#replicate(1.,nrowc)
Original image in DN
dn = img/cimg + simg
Corresponding sigma image
dn_err= sqrt(dn/gain+darkVariance) ; in counts
To get those errors into nanomaggies, you simply apply back the calibration:
img_err = dn_err*cimg
Spitzer S4G sigma image
Ex. dwarf galaxy DDO 053: SKYDRKZB = 0.035142 and FLUXCONV = 0.1088
imcopy ddo053_v7.phot.1 ddo53.phot.1
! SIGMA IMAGE must not have ZEROS, which we will solve by replacing 0 -> -1 in the WEIGHT image.
imarith ddo053_v7.phot.1_wt.fits + 0. test imexpr expr='(a = b) ? c : a' a='test.fits' b='0' c='-1' output='ddo53.phot.1_wt.fits' imarith ddo53.phot.1.fits + 0.035142 ddo53.phot.1_sky.fits imarith ddo53.phot.1_sky.fits / 909.9265 ddo53.phot.1_tmp.fits // 1./0.1088 *30*3.3 = 909.9265 imarith ddo53.phot.1_wt.fits / 10 ddo53_W.fits imarith ddo53.phot.1_tmp.fits * ddo53_W.fits ddo53_Ne.fits imarith ddo53_W.fits * 213.16 ddo53_ron.fits // 14.6*14.6 = ron^2 iz Salo2014_S4G imarith ddo53_Ne.fits + ddo53_ron.fits ddo53_sigma2.fits stsdas toolbox imgtools imcalc ddo53_sigma2.fits ddo53_sigma.fits "sqrt(im1)" nullval="0" imarith ddo53_sigma.fits * 0.0011 ddo53_sigma_tmp.fits imarith ddo53_sigma_tmp.fits / ddo53_W.fits ddo53_sigma_est.fits imarith ddo53_sigma_est.fits * 0.9 ddo53_sigma_decom.fits imexpr expr='(a = b) ? c : a' a='ddo53_sigma_decom.fits' b='0' c='0.00266506' output='ddo53_sigma_final.fits'
// This last number c is iterstat ddo53_sigma_decom.fits (it's last average value). Simply replace zeros in the sigma image by some resonable values, doesn't matter since galfit won't see those given the bad pixel mask...