diff --git a/pyvisgen/simulation/observation.py b/pyvisgen/simulation/observation.py index e6ee4fb..814aad4 100644 --- a/pyvisgen/simulation/observation.py +++ b/pyvisgen/simulation/observation.py @@ -359,13 +359,12 @@ def create_rd_grid(self): # define resolution res = fov / self.img_size - ra = torch.deg2rad(self.ra) dec = torch.deg2rad(self.dec) 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 @@ -391,18 +390,13 @@ def create_lm_grid(self): 3d array Returns a 3d array with every pixel containing a l and m value """ - ra = torch.deg2rad(self.ra) dec = torch.deg2rad(self.dec) 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) - ).T + lm_grid[:, :, 0] = (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[..., 1]) * torch.sin(dec) * torch.cos(self.rd[..., 0]) ).T return lm_grid diff --git a/pyvisgen/simulation/scan.py b/pyvisgen/simulation/scan.py index cf6dc8e..2b92e9e 100644 --- a/pyvisgen/simulation/scan.py +++ b/pyvisgen/simulation/scan.py @@ -115,7 +115,7 @@ def angularDistance(rd, ra, dec): Returns angular Distance for every pixel in rd grid with respect to source position """ - r = rd[..., 0] - torch.deg2rad(ra.to(rd.device)) + r = rd[..., 0] d = rd[..., 1] - torch.deg2rad(dec.to(rd.device)) theta = torch.arcsin(torch.sqrt(r**2 + d**2)) return theta