-
Notifications
You must be signed in to change notification settings - Fork 3
/
telescope.py
55 lines (37 loc) · 1.26 KB
/
telescope.py
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
import numpy as np
#from . import detector
#from .detector import *
class Telescope(object):
def __init__(self,lam,diameter,focal_length,name,platescale,size):
self.lam = lam
self.diameter = diameter
self.focal_length = focal_length
self.name = name
self.nu_cutoff = self.diameter/self.lam
self.size = size
self.platescale = platescale
#self.camera = Detector()
def calc_ps(self, pix_size):
return 206265*pix_size/self.focal_length
def show_lam(self):
return self.lam
def show_diameter(self):
return self.diameter
def pupil_size(self):
pix = self.platescale
pixrad = pix*np.pi/(180*3600)
deltanu = 1./(self.size*pixrad)
rpupil = self.nu_cutoff/(2*deltanu)
return np.int(rpupil)
def spatial_resolution(self):
return self.diameter/self.lam
'''
def pupil_size(D,lam,pix,size):
pixrad = pix*np.pi/(180*3600) # Pixel-size in radians
nu_cutoff = D/lam # Cutoff frequency in rad^-1
deltanu = 1./(size*pixrad) # Sampling interval in rad^-1
rpupil = nu_cutoff/(2*deltanu) #pupil size in pixels
return np.int(rpupil)
def calc_plate_scale(pix_size, focal_length):
return 206265*pix_size/focal_length
'''