Skip to content

Commit dedc8c8

Browse files
Add on the fly rephasing and beam interpolation/reprojection to hci worker (#139)
* don't depend on tart2ms * switch hci worker to ray * == instead of > typo in hci * switch hci worker to ray. fix initial rephasing issues. add basic beam interpolation and reprojection code * do not change the order/number of antennas during UVW recomputation * add ant to index mapping in uvw computation * allow implicit_stokes in degrid * initial beam interp+reprojection functional * add multi-ms support to hci worker + beam zarr outputs * fix output names and pass new ra dec through to fits headers * add fid to init outputs * add separate beam interpolation function to perform both spatial and pol rotation * move target compuattion to after rephasing + beam reproject * check npix is even if passed in from cli * fix mask typo * rephase fiddle factors * rephase like chgcentre * fix beam orientation * remove debugging statements * add implicit_stokes=True when calling convert in degrid * add frequency axis to zarr outputs of hci worker * more generic ant to index mapping in synthesize_uvw * depend on africanus master * add stack option to hci to produce a single zarr cube instead of slices * modify mean and flag computation to not rewrite all data vars * add log messages for scaffold creation * add log message for reduction to compute mean * add stacked-ds as an hci output * do not flag planes in hci (breifast also makes diagnostic plots) * change wsum -> weight + remove flag and initialise nonzero in hci * sync remote * remove unintialised flag from outputs of hci * single hci output * bester -> landmanbester in dependabot config * update beam-model info string
1 parent 32e2c6a commit dedc8c8

File tree

16 files changed

+1198
-508
lines changed

16 files changed

+1198
-508
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ updates:
99
time: "09:00"
1010
open-pull-requests-limit: 10
1111
reviewers:
12-
- "@bester"
12+
- "@landmanbester"
1313
assignees:
14-
- "@bester"
14+
- "@landmanbester"
1515
commit-message:
1616
prefix: "ci"
1717
include: "scope"

pfb/operators/gridder.py

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ def image_data_products(dsl,
335335
do_residual=True,
336336
do_weight=True,
337337
do_noise=False,
338-
do_beam=False):
338+
do_beam=False,
339+
min_padding=1.7):
339340
'''
340341
Function to compute image space data products in one go
341342
@@ -474,11 +475,20 @@ def image_data_products(dsl,
474475
if robustness is not None:
475476
numba_threads = np.maximum(nthreads, 1)
476477
numba.set_num_threads(numba_threads)
478+
# we need to compute the weights on the padded grid
479+
# but we don't have control over the optimal gridding
480+
# parameters so assume a minimum
481+
nx_pad = int(np.ceil(min_padding*nx))
482+
if nx_pad%2:
483+
nx_pad += 1
484+
ny_pad = int(np.ceil(min_padding*ny))
485+
if ny_pad%2:
486+
ny_pad += 1
477487
counts = _compute_counts(uvw,
478488
freq,
479489
mask,
480490
wgt,
481-
nx, ny,
491+
nx_pad, ny_pad,
482492
cellx, celly,
483493
uvw.dtype,
484494
k=0,
@@ -492,7 +502,7 @@ def image_data_products(dsl,
492502
freq,
493503
wgt,
494504
mask,
495-
nx, ny,
505+
nx_pad, ny_pad,
496506
cellx, celly,
497507
robustness,
498508
usign=1.0 if flip_u else -1.0,
@@ -711,26 +721,23 @@ def compute_residual(dsl,
711721
# do not apply weights in this direction
712722
convim = np.zeros_like(dirty)
713723
for c in range(ncorr):
714-
try:
715-
model_vis = dirty2vis(
716-
uvw=uvw,
717-
freq=freq,
718-
dirty=beam[c]*model[c],
719-
pixsize_x=cellx,
720-
pixsize_y=celly,
721-
center_x=x0,
722-
center_y=y0,
723-
flip_u=flip_u,
724-
flip_v=flip_v,
725-
flip_w=flip_w,
726-
epsilon=epsilon,
727-
do_wgridding=do_wgridding,
728-
nthreads=nthreads,
729-
divide_by_n=False, # incorporate in smooth beam
730-
sigma_min=1.1, sigma_max=3.0,
731-
verbosity=0)
732-
except:
733-
import ipdb; ipdb.set_trace()
724+
model_vis = dirty2vis(
725+
uvw=uvw,
726+
freq=freq,
727+
dirty=beam[c]*model[c],
728+
pixsize_x=cellx,
729+
pixsize_y=celly,
730+
center_x=x0,
731+
center_y=y0,
732+
flip_u=flip_u,
733+
flip_v=flip_v,
734+
flip_w=flip_w,
735+
epsilon=epsilon,
736+
do_wgridding=do_wgridding,
737+
nthreads=nthreads,
738+
divide_by_n=False, # incorporate in smooth beam
739+
sigma_min=1.1, sigma_max=3.0,
740+
verbosity=0)
734741

735742
vis2dirty(
736743
uvw=uvw,

pfb/parser/hci.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ inputs:
9595
- double
9696
info:
9797
Gridding precision
98+
beam-model:
99+
dtype: str
100+
info:
101+
Path to beam model as an xarray dataset backed by zarr
98102
field-of-view:
99103
dtype: float
100104
abbreviation: fov
@@ -205,6 +209,11 @@ inputs:
205209
info:
206210
Rephase visibilities to this phase center.
207211
Should be a string in the format 'HH:MM:SS,DD:MM:SS' (note the , delimiter)
212+
stack:
213+
dtype: bool
214+
default: false
215+
info:
216+
Stack everything into a single xarray dataset
208217

209218
_include:
210219
- (.)gridding.yml
@@ -218,9 +227,6 @@ outputs:
218227
dtype: Directory
219228
must_exist: false
220229
mkdir: false
221-
# optional-fits:
222-
# implicit: '{current.output-filename}_{current.product}.fits'
223-
# required: false
224230

225231
policies:
226232
pass_missing_as_none: true

0 commit comments

Comments
 (0)