-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathec.py
More file actions
executable file
·69 lines (52 loc) · 2.41 KB
/
ec.py
File metadata and controls
executable file
·69 lines (52 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3
# mgorski
# 28.07.2022
import numpy
from scipy.stats import norm
class TelInstrument():
# aperure = 2 * seeing
# add other filters (I,J,H,K, colors J-K)
# add camera eficiency
def __init__(self,parent=None):
# telescope parameters
self.mirror=1.5
# instrument parameters
self.pixsize=0.07 # arcsec
self.dark = 0.5 # ADU / pix / s
self.readoutnoise = 5.
self.minseeing = 0.05
# conditions
self.seeing=0.08 # arcsec
self.background_V = 20. # ADU / pix / s
# star parameters
self.V=20
self.VI=1.0
# exposure conditions
self.exp_time = 100.0
self.StN = False
def calc(self):
if self.seeing<self.minseeing: self.seeing=self.minseeing
self.background=self.background_V
self.m = self.V
self.radiation= 4500 # main coefficient of star radiation per second
# background generated by one pixel
coe_pixSize = (self.pixsize/0.1)**2. # pixel size coefficient for sky background
self.backgroundPix_ADU = (self.dark + coe_pixSize*self.background) * self.exp_time # background per pixel * time
self.background_ADU = self.backgroundPix_ADU * (3.14*2*self.seeing / self.pixsize) ** 2 # bckground * number of pixels
# Total ADU from star blured over 2 * seeing (aperture)
coe_brightness = 10**((15.-self.m)/2.5) # star brighteness coefficicient
coe_mirror = (self.mirror*self.mirror) / 1.0 # mirror size coefficient
self.star_ADU = self.radiation * coe_brightness * coe_mirror * self.exp_time
# noise ADU
self.noise_ADU = (self.star_ADU+self.background_ADU) ** 0.5 + self.readoutnoise
# signal to noise
self.StN = self.star_ADU / self.noise_ADU
# central pixel signal background_ADU
# fwhm (seeing) = 2.355 * sigma
coe_sigma = self.pixsize / (self.seeing/2.355)
coe_norm = norm.cdf(coe_sigma)-norm.cdf(-1*coe_sigma)
self.centrPixADU = self.backgroundPix_ADU + coe_norm * self.star_ADU
print("S/N:", self.StN)
print("central pixel ADU: ", self.centrPixADU)
DibiImg = TelInstrument()
DibiImg.calc()