Skip to content

Commit

Permalink
Merge branch 'main' into polarisation
Browse files Browse the repository at this point in the history
  • Loading branch information
aknierim committed Oct 25, 2024
2 parents be9bc13 + 05c9809 commit c8c3c2e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/changes/38.optimization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Use `obs.layout` instead of passing the layout name separately in `pyvisgen.fits.writer.create_vis_hdu`
3 changes: 3 additions & 0 deletions docs/changes/40.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Fix image rotation caused by bug in rd/lm grid computation in ``pyvisgen.simulation.observation.Obseravtion``
- Fix field order in ``pyvisgen.simulation.observation.ValidBaselineSubset`` data class
- Flip input image at the beginning of ``pyvisgen.simulation.visibility.vis_loop`` to ensure correct indexing, e.g. for plotting
6 changes: 3 additions & 3 deletions pyvisgen/fits/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pyvisgen.layouts.layouts as layouts


def create_vis_hdu(data, obs, layout="vlba", source_name="sim-source-0"):
def create_vis_hdu(data, obs, source_name="sim-source-0"):
u = data.u

v = data.v
Expand Down Expand Up @@ -105,8 +105,8 @@ def create_vis_hdu(data, obs, layout="vlba", source_name="sim-source-0"):
hdu_vis.header["EXTNAME"] = ("AIPS UV", "AIPS UV")
hdu_vis.header["EXTVER"] = (1, "Version number of table")
hdu_vis.header["OBJECT"] = (source_name, "Source name")
hdu_vis.header["TELESCOP"] = (layout, "Telescope name")
hdu_vis.header["INSTRUME"] = (layout, "Instrument name (receiver or ?)")
hdu_vis.header["TELESCOP"] = (obs.layout, "Telescope name")
hdu_vis.header["INSTRUME"] = (obs.layout, "Instrument name (receiver or ?)")
hdu_vis.header["DATE-OBS"] = (date_obs, "Observation date")
hdu_vis.header["DATE-MAP"] = (date_map, "File processing date")
hdu_vis.header["BSCALE"] = (1, "Always 1")
Expand Down
4 changes: 2 additions & 2 deletions pyvisgen/simulation/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def create_rd_grid(self):
Returns
-------
3d array
rd_grid : 3d array
Returns a 3d array with every pixel containing a RA and Dec value
"""
# transform to rad
Expand Down Expand Up @@ -474,7 +474,7 @@ def create_lm_grid(self):
Returns
-------
3d array
lm_grid : 3d array
Returns a 3d array with every pixel containing a l and m value
"""
dec = torch.deg2rad(self.dec)
Expand Down
10 changes: 5 additions & 5 deletions pyvisgen/simulation/visibility.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from dataclasses import dataclass, fields
from tqdm import tqdm

import torch
import scipy.ndimage
import torch
from tqdm import tqdm

import pyvisgen.simulation.scan as scan

Expand Down Expand Up @@ -119,7 +119,7 @@ def __init__(
) # noqa: E741

def linear(self) -> None:
"""Computes the stokes parameters I, Q, U, and V
r"""Computes the stokes parameters I, Q, U, and V
for linear polarisation.
.. math::
Expand All @@ -144,7 +144,7 @@ def linear(self) -> None:
)

def circular(self) -> None:
"""Computes the stokes parameters I, Q, U, and V
r"""Computes the stokes parameters I, Q, U, and V
for circular polarisation.
.. math::
Expand Down Expand Up @@ -323,7 +323,7 @@ def rand_polarisation_field(


def vis_loop(
obs: "Observation",
obs,
SI: torch.tensor,
num_threads: int = 10,
noisy: bool = True,
Expand Down

0 comments on commit c8c3c2e

Please sign in to comment.