jolly-roger 0.2.0__py3-none-any.whl → 0.3.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 CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.2.0'
21
- __version_tuple__ = version_tuple = (0, 2, 0)
20
+ __version__ = version = '0.3.0'
21
+ __version_tuple__ = version_tuple = (0, 3, 0)
jolly_roger/plots.py CHANGED
@@ -85,15 +85,17 @@ def plot_baseline_comparison_data(
85
85
  norm = ImageNormalize(
86
86
  after_amp_stokesi, interval=ZScaleInterval(), stretch=SqrtStretch()
87
87
  )
88
+ cmap = plt.cm.viridis
88
89
 
89
90
  fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(
90
- 2, 2, figsize=(10, 10), sharex=True, sharey="row"
91
+ 2, 2, figsize=(12, 10), sharex=True, sharey="row"
91
92
  )
92
93
  im = ax1.pcolormesh(
93
94
  before_baseline_data.time,
94
95
  before_baseline_data.freq_chan,
95
96
  before_amp_stokesi.T,
96
97
  norm=norm,
98
+ cmap=cmap,
97
99
  )
98
100
  ax1.set(
99
101
  ylabel=f"Frequency / {before_baseline_data.freq_chan.unit:latex_inline}",
@@ -104,12 +106,14 @@ def plot_baseline_comparison_data(
104
106
  after_baseline_data.freq_chan,
105
107
  after_amp_stokesi.T,
106
108
  norm=norm,
109
+ cmap=cmap,
107
110
  )
108
111
  ax2.set(
109
112
  ylabel=f"Frequency / {after_baseline_data.freq_chan.unit:latex_inline}",
110
113
  title="After",
111
114
  )
112
- fig.colorbar(im, ax=ax2, label="Stokes I Amplitude / Jy")
115
+ for ax in (ax1, ax2):
116
+ fig.colorbar(im, ax=ax, label="Stokes I Amplitude / Jy")
113
117
 
114
118
  # TODO: Move these delay calculations outside of the plotting function
115
119
  # And here we calculate the delay information
@@ -130,6 +134,7 @@ def plot_baseline_comparison_data(
130
134
  before_delays.delay,
131
135
  before_delays_i.T,
132
136
  norm=delay_norm,
137
+ cmap=cmap,
133
138
  )
134
139
  ax3.set(ylabel="Delay / s", title="Before")
135
140
  ax4.pcolormesh(
@@ -137,9 +142,11 @@ def plot_baseline_comparison_data(
137
142
  after_delays.delay,
138
143
  after_delays_i.T,
139
144
  norm=delay_norm,
145
+ cmap=cmap,
140
146
  )
141
147
  ax4.set(ylabel="Delay / s", title="After")
142
- fig.colorbar(im, ax=ax4, label="Stokes I Amplitude / Jy")
148
+ for ax in (ax3, ax4):
149
+ fig.colorbar(im, ax=ax, label="Stokes I Amplitude / Jy")
143
150
 
144
151
  if w_delays is not None:
145
152
  for ax, baseline_data in zip( # type:ignore[call-overload]
@@ -152,8 +159,8 @@ def plot_baseline_comparison_data(
152
159
  ax.plot(
153
160
  baseline_data.time,
154
161
  w_delays.w_delays[b_idx],
155
- color="k",
156
- linestyle="--",
162
+ color="tab:red",
163
+ linestyle="-",
157
164
  label=f"Delay for {w_delays.object_name}",
158
165
  )
159
166
  ax.legend()
jolly_roger/tractor.py CHANGED
@@ -202,17 +202,16 @@ def _get_data_chunk_from_main_table(
202
202
  logger.debug(f"Length of open table: {table_length} rows")
203
203
 
204
204
  lower_row = 0
205
- upper_row = chunk_size
206
205
 
207
206
  while lower_row < table_length:
208
- rows: list[dict[str, Any]] = ms_table[lower_row:upper_row]
209
-
210
- data = _list_to_array(list_of_rows=rows, key=data_column)
211
- flags = _list_to_array(list_of_rows=rows, key="FLAG")
212
- uvws = _list_to_array(list_of_rows=rows, key="UVW")
213
- time_centroid = _list_to_array(list_of_rows=rows, key="TIME_CENTROID")
214
- ant_1 = _list_to_array(list_of_rows=rows, key="ANTENNA1")
215
- ant_2 = _list_to_array(list_of_rows=rows, key="ANTENNA2")
207
+ data = ms_table.getcol(data_column, startrow=lower_row, nrow=chunk_size)
208
+ flags = ms_table.getcol("FLAG", startrow=lower_row, nrow=chunk_size)
209
+ uvws = ms_table.getcol("UVW", startrow=lower_row, nrow=chunk_size)
210
+ time_centroid = ms_table.getcol(
211
+ "TIME_CENTROID", startrow=lower_row, nrow=chunk_size
212
+ )
213
+ ant_1 = ms_table.getcol("ANTENNA1", startrow=lower_row, nrow=chunk_size)
214
+ ant_2 = ms_table.getcol("ANTENNA2", startrow=lower_row, nrow=chunk_size)
216
215
 
217
216
  yield DataChunkArray(
218
217
  data=data,
@@ -226,7 +225,6 @@ def _get_data_chunk_from_main_table(
226
225
  )
227
226
 
228
227
  lower_row += chunk_size
229
- upper_row += chunk_size
230
228
 
231
229
 
232
230
  def get_data_chunks(
@@ -559,7 +557,8 @@ def _tukey_tractor(
559
557
  taper = 1.0 - taper
560
558
 
561
559
  # Delay with the elevation of the target object
562
- elevation_mask = w_delays.elevation < (-3 * u.deg)
560
+ # TODO: Allow elevation to be a user parameter
561
+ elevation_mask = w_delays.elevation < tukey_tractor_options.elevation_cut
563
562
  taper[elevation_mask[time_idx], :, :] = 1.0
564
563
 
565
564
  # TODO: Handle case of aliased delays
@@ -619,6 +618,8 @@ class TukeyTractorOptions:
619
618
  """apply the taper using the delay towards the target object."""
620
619
  target_object: str = "Sun"
621
620
  """The target object to apply the delay towards."""
621
+ elevation_cut: u.Quantity = -1 * u.deg
622
+ """The elevation cut-off for the target object. Defaults to 0 degrees."""
622
623
 
623
624
 
624
625
  def tukey_tractor(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jolly-roger
3
- Version: 0.2.0
3
+ Version: 0.3.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
@@ -1,17 +1,17 @@
1
1
  jolly_roger/__init__.py,sha256=7xiZLdeY-7sgrYGQ1gNdCjgCfqnoPXK7AeaHncY_DGU,204
2
- jolly_roger/_version.py,sha256=iB5DfB5V6YB5Wo4JmvS-txT42QtmGaWcWp3udRT7zCI,511
2
+ jolly_roger/_version.py,sha256=AGmG_Lx0-9ztFw_7d9mYbaYuC-2abxE1oXOUNAY29YY,511
3
3
  jolly_roger/_version.pyi,sha256=j5kbzfm6lOn8BzASXWjGIA1yT0OlHTWqlbyZ8Si_o0E,118
4
4
  jolly_roger/baselines.py,sha256=C_vC3v_ciU2T_si31oS0hUmsMNTQA0USxrm4118vYvY,4615
5
5
  jolly_roger/delays.py,sha256=cvLMhChkkB6PkS11v6JU8Wn23Zqv5bQY1HTMzeIGTNw,3015
6
6
  jolly_roger/flagger.py,sha256=tlC-M_MpLpqOvkF544zw2EvOUpbSpasO2zlMlXMcxSs,3034
7
7
  jolly_roger/hour_angles.py,sha256=ld3jiEDQXlYLHrChUxYD_UBSxKH0qarstakBPLQ0M8s,6044
8
8
  jolly_roger/logging.py,sha256=04YVHnF_8tKDkXNtXQ-iMyJ2BLV-qowbPAqqMFDxYE4,1338
9
- jolly_roger/plots.py,sha256=LsueygCHpGvBXZe2y4q1fmJEMyjoMl65JzFMzbduawI,5280
9
+ jolly_roger/plots.py,sha256=3aRIy4LcFY5mrlPim_geiz1B22wOYp0EfMvGh90GCUA,5473
10
10
  jolly_roger/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- jolly_roger/tractor.py,sha256=ORkQb7T7jxMFVcDihH1McYYGq07OgsvbfT44D82ghL4,27723
11
+ jolly_roger/tractor.py,sha256=Z6LyrhNZZuTKVyFMUhyOGhLgYAjrkfR9YP93LdsCHOY,27907
12
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,,
13
+ jolly_roger-0.3.0.dist-info/METADATA,sha256=Jzt-pUJETG8TYNSXKCe1HUVuS5Fmc7K07RwhR3SFfiQ,4221
14
+ jolly_roger-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ jolly_roger-0.3.0.dist-info/entry_points.txt,sha256=q8RYosASYsPShzsIo58NxOhIMuB4F-gQ2uG6zS2p224,98
16
+ jolly_roger-0.3.0.dist-info/licenses/LICENSE,sha256=7G-TthaPSOehr-pdj4TJydXj3eIUmerMbCUSatMr8hc,1522
17
+ jolly_roger-0.3.0.dist-info/RECORD,,