-
Notifications
You must be signed in to change notification settings - Fork 0
/
CVZ.py
25 lines (20 loc) · 795 Bytes
/
CVZ.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
import numpy as np
global raNorth, decNorth, raSouth, decSouth, radius
raNorth, decNorth = 270., 66.56070889
raSouth, decSouth = 90., -66.56070889
# radius = 5 for JWST, radius=10 for TESS
def is_star_in_CVZ(alpha_deg, delta_deg, radius=10):
alpha_deg, delta_deg = np.ascontiguousarray(alpha_deg), \
np.ascontiguousarray(delta_deg)
# Check Northern CVZ
draN = alpha_deg - raNorth
ddecN = delta_deg - decNorth
distfromCVZcentreN = np.sqrt(draN**2 + ddecN**2)
# Check Southern CVZ
draS = alpha_deg - raSouth
ddecS = delta_deg - decSouth
distfromCVZcentreS = np.sqrt(draS**2 + ddecS**2)
# is star in a CVZ?
inCVZ = np.zeros(alpha_deg.size)
inCVZ[(distfromCVZcentreN <= radius) | (distfromCVZcentreS <= radius)] = 1.
return inCVZ