jolly-roger 0.0.2__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jolly-roger might be problematic. Click here for more details.
- jolly_roger/_version.py +2 -2
- jolly_roger/delays.py +107 -0
- jolly_roger/hour_angles.py +24 -28
- jolly_roger/plots.py +171 -0
- jolly_roger/tractor.py +808 -0
- jolly_roger/uvws.py +67 -17
- {jolly_roger-0.0.2.dist-info → jolly_roger-0.2.0.dist-info}/METADATA +3 -1
- jolly_roger-0.2.0.dist-info/RECORD +17 -0
- {jolly_roger-0.0.2.dist-info → jolly_roger-0.2.0.dist-info}/entry_points.txt +1 -0
- jolly_roger-0.0.2.dist-info/RECORD +0 -14
- {jolly_roger-0.0.2.dist-info → jolly_roger-0.2.0.dist-info}/WHEEL +0 -0
- {jolly_roger-0.0.2.dist-info → jolly_roger-0.2.0.dist-info}/licenses/LICENSE +0 -0
jolly_roger/uvws.py
CHANGED
|
@@ -11,17 +11,67 @@ from astropy.constants import c as speed_of_light
|
|
|
11
11
|
from casacore.tables import table, taql
|
|
12
12
|
from tqdm import tqdm
|
|
13
13
|
|
|
14
|
-
from jolly_roger.baselines import Baselines
|
|
15
|
-
from jolly_roger.hour_angles import PositionHourAngles
|
|
14
|
+
from jolly_roger.baselines import Baselines, get_baselines_from_ms
|
|
15
|
+
from jolly_roger.hour_angles import PositionHourAngles, make_hour_angles_for_ms
|
|
16
16
|
from jolly_roger.logging import logger
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
@dataclass(frozen=True)
|
|
20
|
+
class WDelays:
|
|
21
|
+
"""Representation and mappings for the w-coordinate derived delays"""
|
|
22
|
+
|
|
23
|
+
object_name: str
|
|
24
|
+
"""The name of the object that the delays are derived towards"""
|
|
25
|
+
w_delays: u.Quantity
|
|
26
|
+
"""The w-derived delay. Shape is [baseline, time]"""
|
|
27
|
+
b_map: dict[tuple[int, int], int]
|
|
28
|
+
"""The mapping between (ANTENNA1,ANTENNA2) to baseline index"""
|
|
29
|
+
time_map: dict[u.Quantity, int]
|
|
30
|
+
"""The mapping between time (MJDs from measurement set) to index"""
|
|
31
|
+
elevation: u.Quantity
|
|
32
|
+
"""The elevation of the target object in time order of steps in the MS"""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_object_delay_for_ms(
|
|
36
|
+
ms_path: Path,
|
|
37
|
+
object_name: str = "sun",
|
|
38
|
+
) -> WDelays:
|
|
39
|
+
# Generate the two sets of uvw coordinate objects
|
|
40
|
+
baselines: Baselines = get_baselines_from_ms(ms_path=ms_path)
|
|
41
|
+
hour_angles_phase = make_hour_angles_for_ms(
|
|
42
|
+
ms_path=ms_path,
|
|
43
|
+
position=None, # gets the position from phase direction
|
|
44
|
+
)
|
|
45
|
+
uvws_phase: UVWs = xyz_to_uvw(baselines=baselines, hour_angles=hour_angles_phase)
|
|
46
|
+
|
|
47
|
+
hour_angles_object = make_hour_angles_for_ms(
|
|
48
|
+
ms_path=ms_path,
|
|
49
|
+
position=object_name, # gets the position from phase direction
|
|
50
|
+
)
|
|
51
|
+
uvws_object: UVWs = xyz_to_uvw(baselines=baselines, hour_angles=hour_angles_object)
|
|
52
|
+
|
|
53
|
+
# Subtract the w-coordinates out. Since these uvws have
|
|
54
|
+
# been computed towards different directions the difference
|
|
55
|
+
# in w-coordinate is the delay distance
|
|
56
|
+
w_diffs = uvws_object.uvws[2] - uvws_phase.uvws[2]
|
|
57
|
+
|
|
58
|
+
delay_object = (w_diffs / speed_of_light).decompose()
|
|
59
|
+
|
|
60
|
+
return WDelays(
|
|
61
|
+
object_name=object_name,
|
|
62
|
+
w_delays=delay_object,
|
|
63
|
+
b_map=baselines.b_map,
|
|
64
|
+
time_map=hour_angles_phase.time_map,
|
|
65
|
+
elevation=hour_angles_object.elevation,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
19
69
|
@dataclass
|
|
20
70
|
class UVWs:
|
|
21
71
|
"""A small container to represent uvws"""
|
|
22
72
|
|
|
23
73
|
uvws: np.ndarray
|
|
24
|
-
"""The (U,V,W)
|
|
74
|
+
"""The (U,V,W) coordinatesm shape [coord, baseline, time]"""
|
|
25
75
|
hour_angles: PositionHourAngles
|
|
26
76
|
"""The hour angle information used to construct the UVWs"""
|
|
27
77
|
baselines: Baselines
|
|
@@ -44,17 +94,16 @@ def xyz_to_uvw(
|
|
|
44
94
|
"""
|
|
45
95
|
b_xyz = baselines.b_xyz
|
|
46
96
|
|
|
47
|
-
#
|
|
48
|
-
|
|
49
|
-
ha =
|
|
97
|
+
# Convert HA to geocentric hour angle (at Greenwich meridian)
|
|
98
|
+
# This is why we subtract the location's longitude
|
|
99
|
+
ha = hour_angles.hour_angle - hour_angles.location.lon
|
|
50
100
|
|
|
51
101
|
declination = hour_angles.position.dec
|
|
52
|
-
declination = declination.to(u.rad)
|
|
53
102
|
|
|
54
103
|
# This is necessary for broadcastung in the matrix to work.
|
|
55
|
-
# Should the position be a solar object like the
|
|
104
|
+
# Should the position be a solar object like the sun its position
|
|
56
105
|
# will change throughout the observation. but it will have
|
|
57
|
-
|
|
106
|
+
# been created consistently with the hour angles. If it is fixed
|
|
58
107
|
# then the use of the numpy ones like will ensure the same shape.
|
|
59
108
|
declination = (np.ones(len(ha)) * declination).decompose()
|
|
60
109
|
|
|
@@ -71,21 +120,22 @@ def xyz_to_uvw(
|
|
|
71
120
|
[sin_ha, cos_ha, zeros],
|
|
72
121
|
[-sin_dec * cos_ha, sin_dec * sin_ha, cos_dec],
|
|
73
122
|
[
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
123
|
+
cos_dec * cos_ha,
|
|
124
|
+
-cos_dec * sin_ha,
|
|
125
|
+
sin_dec,
|
|
77
126
|
],
|
|
78
127
|
]
|
|
79
128
|
)
|
|
80
129
|
|
|
81
130
|
# Every time this confuses me and I need the first mate to look over.
|
|
82
|
-
# b_xyz shape: (baselines,
|
|
131
|
+
# b_xyz shape: (baselines, 3) where coord is XYZ
|
|
83
132
|
# mat shape: (3, 3, timesteps)
|
|
84
|
-
# uvw shape: (
|
|
85
|
-
uvw = np.einsum("ijk,lj->
|
|
133
|
+
# uvw shape: (3, baseline, timesteps) where coord is UVW
|
|
134
|
+
uvw = np.einsum("ijk,lj->ilk", mat, b_xyz, optimize=True) # codespell:ignore ilk
|
|
135
|
+
# i,j,k -> (3, 3, time)
|
|
136
|
+
# l,j -> (baseline, 3)
|
|
137
|
+
# i,l,k -> (3, baseline, time)
|
|
86
138
|
|
|
87
|
-
# Make order (coord, baseline, timesteps)
|
|
88
|
-
uvw = np.swapaxes(uvw, 0, 1)
|
|
89
139
|
logger.debug(f"{uvw.shape=}")
|
|
90
140
|
|
|
91
141
|
return UVWs(uvws=uvw, hour_angles=hour_angles, baselines=baselines)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jolly-roger
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: The pirate flagger
|
|
5
5
|
Project-URL: Homepage, https://github.com/flint-crew/jolly-roger
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/flint-crew/jolly-roger/issues
|
|
@@ -23,6 +23,8 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
23
23
|
Classifier: Typing :: Typed
|
|
24
24
|
Requires-Python: >=3.11
|
|
25
25
|
Requires-Dist: astropy
|
|
26
|
+
Requires-Dist: dask-ms
|
|
27
|
+
Requires-Dist: matplotlib
|
|
26
28
|
Requires-Dist: numpy>=2.0.0
|
|
27
29
|
Requires-Dist: python-casacore>=3.6.0
|
|
28
30
|
Requires-Dist: tqdm
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
jolly_roger/__init__.py,sha256=7xiZLdeY-7sgrYGQ1gNdCjgCfqnoPXK7AeaHncY_DGU,204
|
|
2
|
+
jolly_roger/_version.py,sha256=iB5DfB5V6YB5Wo4JmvS-txT42QtmGaWcWp3udRT7zCI,511
|
|
3
|
+
jolly_roger/_version.pyi,sha256=j5kbzfm6lOn8BzASXWjGIA1yT0OlHTWqlbyZ8Si_o0E,118
|
|
4
|
+
jolly_roger/baselines.py,sha256=C_vC3v_ciU2T_si31oS0hUmsMNTQA0USxrm4118vYvY,4615
|
|
5
|
+
jolly_roger/delays.py,sha256=cvLMhChkkB6PkS11v6JU8Wn23Zqv5bQY1HTMzeIGTNw,3015
|
|
6
|
+
jolly_roger/flagger.py,sha256=tlC-M_MpLpqOvkF544zw2EvOUpbSpasO2zlMlXMcxSs,3034
|
|
7
|
+
jolly_roger/hour_angles.py,sha256=ld3jiEDQXlYLHrChUxYD_UBSxKH0qarstakBPLQ0M8s,6044
|
|
8
|
+
jolly_roger/logging.py,sha256=04YVHnF_8tKDkXNtXQ-iMyJ2BLV-qowbPAqqMFDxYE4,1338
|
|
9
|
+
jolly_roger/plots.py,sha256=LsueygCHpGvBXZe2y4q1fmJEMyjoMl65JzFMzbduawI,5280
|
|
10
|
+
jolly_roger/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
jolly_roger/tractor.py,sha256=ORkQb7T7jxMFVcDihH1McYYGq07OgsvbfT44D82ghL4,27723
|
|
12
|
+
jolly_roger/uvws.py,sha256=ujZdIIxNY2k4HY9p65kUyH-VqN6thNpOrBb-wpL9mYM,12424
|
|
13
|
+
jolly_roger-0.2.0.dist-info/METADATA,sha256=vFDa_-0nKwhoFVmm9x_qqQgZURZV8jPBprgRue9h7XY,4221
|
|
14
|
+
jolly_roger-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
+
jolly_roger-0.2.0.dist-info/entry_points.txt,sha256=q8RYosASYsPShzsIo58NxOhIMuB4F-gQ2uG6zS2p224,98
|
|
16
|
+
jolly_roger-0.2.0.dist-info/licenses/LICENSE,sha256=7G-TthaPSOehr-pdj4TJydXj3eIUmerMbCUSatMr8hc,1522
|
|
17
|
+
jolly_roger-0.2.0.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
jolly_roger/__init__.py,sha256=7xiZLdeY-7sgrYGQ1gNdCjgCfqnoPXK7AeaHncY_DGU,204
|
|
2
|
-
jolly_roger/_version.py,sha256=wO7XWlZte1hxA4mMvRc6zhNdGm74Nhhn2bfWRAxaKbI,511
|
|
3
|
-
jolly_roger/_version.pyi,sha256=j5kbzfm6lOn8BzASXWjGIA1yT0OlHTWqlbyZ8Si_o0E,118
|
|
4
|
-
jolly_roger/baselines.py,sha256=C_vC3v_ciU2T_si31oS0hUmsMNTQA0USxrm4118vYvY,4615
|
|
5
|
-
jolly_roger/flagger.py,sha256=tlC-M_MpLpqOvkF544zw2EvOUpbSpasO2zlMlXMcxSs,3034
|
|
6
|
-
jolly_roger/hour_angles.py,sha256=ChWTy69dkRN0R2HWEknHagv6W3xTXuSJJn9sAqBABCc,6160
|
|
7
|
-
jolly_roger/logging.py,sha256=04YVHnF_8tKDkXNtXQ-iMyJ2BLV-qowbPAqqMFDxYE4,1338
|
|
8
|
-
jolly_roger/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
jolly_roger/uvws.py,sha256=8G2E7bq8y5EEc2wQW5nli1WKsebZbBEHN8fhPzlinWk,10558
|
|
10
|
-
jolly_roger-0.0.2.dist-info/METADATA,sha256=BtHEC57mNeu12PI6_pnDSkD8i767av0kQfTr_vINWuI,4172
|
|
11
|
-
jolly_roger-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
12
|
-
jolly_roger-0.0.2.dist-info/entry_points.txt,sha256=ZwEZAe4DBn5nznVI0tP0a1wUinYouwXxxcZP6p7Pkvk,58
|
|
13
|
-
jolly_roger-0.0.2.dist-info/licenses/LICENSE,sha256=7G-TthaPSOehr-pdj4TJydXj3eIUmerMbCUSatMr8hc,1522
|
|
14
|
-
jolly_roger-0.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|