Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change DirtyImager to store minimal visibility data, Hermitian conjugates computed on the fly via @property #230

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions src/mpol/gridding.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,22 +597,40 @@ def __init__(
# make sure we still fit into the grid
self.coords.check_data_fit(uu, vv)

# expand the vectors to include complex conjugates
uu_full = np.concatenate([uu, -uu], axis=1)
vv_full = np.concatenate([vv, -vv], axis=1)
# initialize base objects
# Hermitian conjugates taken care of by @property below
self.uu_base = uu
self.vv_base = vv
self.weight_base = weight
self.data_re_base = data_re
self.data_im_base = data_im

# make sure we still fit into the grid (with expansion)
self.coords.check_data_fit(uu_full, vv_full)

self.uu = uu_full
self.vv = vv_full
self.weight = np.concatenate([weight, weight], axis=1)
self.data_re = np.concatenate([data_re, data_re], axis=1)
self.data_im = np.concatenate([data_im, -data_im], axis=1)
self.coords.check_data_fit(self.uu, self.vv)

# and register cell indices against data
self._create_cell_indices()

@property
def uu(self):
return np.concatenate([self.uu_base, -self.uu_base], axis=1)

@property
def vv(self):
return np.concatenate([self.vv_base, -self.vv_base], axis=1)

@property
def weight(self):
return np.concatenate([self.weight_base, self.weight_base], axis=1)

@property
def data_re(self):
return np.concatenate([self.data_re_base, self.data_re_base], axis=1)

@property
def data_im(self):
return np.concatenate([self.data_im_base, -self.data_im_base], axis=1)

def _grid_visibilities(
self,
weighting="uniform",
Expand Down