Skip to content

Commit

Permalink
Remove r.a. addition of source position from lm grid calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross03 committed Jul 12, 2024
1 parent b48b076 commit 14966e9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pyvisgen/simulation/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ def __init__(
len(self.array.st_num) * (len(self.array.st_num) - 1) / 2
)
self.baselines.times_unique = torch.unique(self.baselines.time)
self.ra = torch.tensor([0]).to(self.device)
self.dec = torch.tensor([0]).to(self.device)

self.rd = self.create_rd_grid()
self.lm = self.create_lm_grid()
Expand Down Expand Up @@ -366,7 +364,7 @@ def create_rd_grid(self):

r = (
torch.arange(self.img_size, device=self.device, dtype=torch.float64) - self.img_size / 2
) * res + ra
) * res
d = (
torch.arange(self.img_size, device=self.device, dtype=torch.float64) - self.img_size / 2
) * res + dec
Expand Down Expand Up @@ -396,13 +394,13 @@ def create_lm_grid(self):

lm_grid = torch.zeros(self.rd.shape, device=self.device, dtype=torch.float64)
lm_grid[:, :, 0] = (
torch.cos(self.rd[..., 1]) * torch.sin(self.rd[..., 0] - ra)
torch.cos(self.rd[..., 1]) * torch.sin(self.rd[..., 0])
).T
lm_grid[:, :, 1] = (
torch.sin(self.rd[..., 1]) * torch.cos(dec)
- torch.cos(self.rd[..., 1])
* torch.sin(dec)
* torch.cos(self.rd[..., 0] - ra)
* torch.cos(self.rd[..., 0])
).T
return lm_grid

Expand Down

0 comments on commit 14966e9

Please sign in to comment.