Converts from GRAPES-3 Local coordindates to International Celestial Reference System (ICRS).
Parameters: |
-
theta
(float / array_like )
–
-
phi
(float / array_like )
–
-
EvDate
(int / str / array_like )
–
-
EvTime1
(int / str / array_like )
–
-
EvTime2
(int / str / array_like )
–
fmt: 9 digits (GRAPES-3 DAQ resolution is ns)
|
Returns: |
-
RightAscension ( float / array
) –
-
Declination ( float / array
) –
|
Source code in g3py/CoordTransform.py
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 | def ZenPhiToRADec(theta, phi, EvDate, EvTime1, EvTime2):
"""
Converts from GRAPES-3 Local coordindates to International Celestial Reference System (ICRS).
Parameters
----------
theta : float / array_like
units: deg.
phi : float / array_like
units: deg.
EvDate : int / str / array_like
fmt: YYYYMMDD
EvTime1 : int / str / array_like
fmt: HHMMSS
EvTime2 : int / str / array_like
fmt: 9 digits (GRAPES-3 DAQ resolution is ns)
Returns
-------
RightAscension: float / array
units : deg.
Declination: float / array
units : deg.
"""
grapes3loc = EarthLocation(lon=76.7 * u.deg, lat=11.4 * u.deg, height=2200 * u.m)
theta = np.array(theta)
phi = np.array(phi)
EvTime1 = np.array(EvTime1)
EvTime2 = np.array(EvTime2)
EvDate = np.array(EvDate)
EvTime2 = np.char.zfill(EvTime2.astype("str"), width=9)
EvTime1 = np.char.zfill(EvTime1.astype("str"), width=6)
EvDate = np.char.zfill(EvDate.astype("str"), width=8)
iteration = zip(list(EvDate), list(EvTime1), list(EvTime2))
datetime = np.array(
[
f"{EvD[:4]}-{EvD[4:6]}-{EvD[6:]}\
{EvT1[:2]}:{EvT1[2:4]}:{EvT1[4:6]}.{EvT2}"
for EvD, EvT1, EvT2 in iteration
]
)
obs_time = Time(datetime, format="iso", location=grapes3loc)
coord = SkyCoord(
alt=(90 - theta) * u.deg,
az=((180 - phi) % 360) * u.deg,
frame="altaz",
obstime=obs_time,
location=grapes3loc,
)
coord = coord.transform_to("icrs")
return coord.ra.degree, coord.dec.degree
|