Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
898517c
improved docstring
vsmagalhaes Jun 23, 2025
1f3123c
improved docstring
vsmagalhaes Jun 23, 2025
f1242ed
Renamed import that was named as a single letter.
vsmagalhaes Jun 23, 2025
211c3d9
holog_mds now stores an AZ EL summary.
vsmagalhaes Jun 23, 2025
df4dd35
holog now propagates AZ EL summary.
vsmagalhaes Jun 23, 2025
9c4be17
panel now propagates AZ EL summary.
vsmagalhaes Jun 23, 2025
3c0c86d
Az El is now left in radians for convenient conversion at output. fur…
vsmagalhaes Jun 26, 2025
5f33100
Created a routine to format Az El information.
vsmagalhaes Jun 26, 2025
26bc96d
extract_holog.py now extracts and stores an observation summary.
vsmagalhaes Jun 26, 2025
94fd2ac
holog.py now propagates observation information
vsmagalhaes Jun 26, 2025
09bf00d
panel now propagates observation information
vsmagalhaes Jun 26, 2025
0f409f2
extract_holog.py now stores a summary of frequency information.
vsmagalhaes Jun 26, 2025
7a5803a
holog now propagates summary of frequency information.
vsmagalhaes Jun 26, 2025
542a588
panel now propagates summary of frequency information.
vsmagalhaes Jun 26, 2025
dd2a2a5
Fixed right ascension negative values
vsmagalhaes Jun 26, 2025
0c5f144
Added routine to format observation summary
vsmagalhaes Jun 26, 2025
90fbba7
Added routine to format spectral summary
vsmagalhaes Jun 26, 2025
2480f1e
cosmetic alignment.
vsmagalhaes Jun 26, 2025
c1b9d9f
calculate_optimal_grid_parameters now outputs len 2 arrays rather tha…
vsmagalhaes Jun 30, 2025
f0fff58
short term fix.
vsmagalhaes Jun 30, 2025
4cd8062
implemented a more complete summary information dictionary.
vsmagalhaes Jun 30, 2025
a6f2c97
small change caused by key name change
vsmagalhaes Jun 30, 2025
c77a87b
Aggressively removing holog_mds meta data as it is heavily superseded…
vsmagalhaes Jun 30, 2025
a7c6275
improved message
vsmagalhaes Jun 30, 2025
0d69f60
Brought back writting of holog_json.
vsmagalhaes Jun 30, 2025
9e1bd21
some reorganization.
vsmagalhaes Jun 30, 2025
1b6e8bf
Corrected a typo
vsmagalhaes Jun 30, 2025
5930210
holog now uses the data in the summary and passes it along.
vsmagalhaes Jun 30, 2025
f69d14d
grid size is now a list of integers from the get go
vsmagalhaes Jun 30, 2025
3ae695e
panel now uses the summary functionality.
vsmagalhaes Jun 30, 2025
5e9270a
added formating of beam information
vsmagalhaes Jun 30, 2025
41ef018
added formating of aperture information
vsmagalhaes Jun 30, 2025
811dabd
Some formatting changes, added a function to make a centralized header.
vsmagalhaes Jul 1, 2025
3f8b7cc
Added a generalized routine capable of printing observation summary.
vsmagalhaes Jul 1, 2025
2b8e0e3
It is now possible to retrieve returns when using compute_graph.
vsmagalhaes Jul 1, 2025
fc5acf0
Removed print toggle
vsmagalhaes Jul 1, 2025
3db4869
Added observation summary method to AstrohackHologFile Class.
vsmagalhaes Jul 1, 2025
4d25753
Added missing methods to the AstrohackHologFile Class summary.
vsmagalhaes Jul 1, 2025
d638ac0
Added observation summary to AstrohackPanelFile Class.
vsmagalhaes Jul 1, 2025
8a53c7c
Added observation summary to AstrohackImageFile Class.
vsmagalhaes Jul 1, 2025
a76e9a1
Added duration to observation summary and renamed some routines.
vsmagalhaes Jul 1, 2025
49ccb31
Added formating of duration in seconds to a more comprehensible string.
vsmagalhaes Jul 1, 2025
9cffbbe
Added a comment on the dates being MJD in days
vsmagalhaes Jul 1, 2025
fa0fd76
Added units.radec to custom_unit_checker
vsmagalhaes Jul 1, 2025
128c0d9
Added parameter checking to observation summary.
vsmagalhaes Jul 1, 2025
d1ee86e
Fixed bug introduced when trying to open a telescope from a xds.
vsmagalhaes Jul 1, 2025
e1e99e2
Updated tutorial_vla.ipynb to use the new observation summaries.
vsmagalhaes Jul 1, 2025
a078f88
Fixing remaining small bugs on visualization routines caused by the c…
vsmagalhaes Jul 1, 2025
03da0d7
Antenna stations are now included in the observation summary.
vsmagalhaes Jul 2, 2025
063f4d6
Imposed an order on the displaying of the general information.
vsmagalhaes Jul 2, 2025
df4b265
Improved spectral summary.
vsmagalhaes Jul 2, 2025
44bc797
Implemented Z scale determination in the image_comparison_tool.py
vsmagalhaes Jul 2, 2025
fde4f1a
Fake update to 0.7.2 to allow for tests blocking use of files from 0.…
vsmagalhaes Jul 2, 2025
93d3d89
Az el key default is now center.
vsmagalhaes Jul 2, 2025
ff93e79
Added a function to check if file can be opened.
vsmagalhaes Jul 2, 2025
f564326
Fixed a bug in the labelling of panels.
vsmagalhaes Jul 2, 2025
b540d0b
Added .point_input, improved error message.
vsmagalhaes Jul 2, 2025
96c3177
Extract_holog now checks if the point file can be opened.
vsmagalhaes Jul 2, 2025
6e51ffd
panel now checks if the image file can be opened.
vsmagalhaes Jul 2, 2025
dbe0472
holog now checks if the holog file can be opened.
vsmagalhaes Jul 2, 2025
f074124
Locit can now check if locit file can be opened.
vsmagalhaes Jul 2, 2025
5098361
Open functions now check if they can open a file.
vsmagalhaes Jul 2, 2025
6362293
fixed circular import in locit.py
vsmagalhaes Jul 2, 2025
775058c
fixed circular import in holog.py
vsmagalhaes Jul 2, 2025
1bb7a2b
Low confidence fix to panel.
vsmagalhaes Jul 2, 2025
4b75a6d
Corrected the fact that the L cell size must be negative. Also protec…
vsmagalhaes Jul 3, 2025
ab13a35
Fixed definition RingPanel center.
vsmagalhaes Jul 3, 2025
0fa8d03
Fixed VLA stakeholder by fixing the grid and cell sizes. Also removed…
vsmagalhaes Jul 3, 2025
2ba1973
Fixed antenna class tests by reverting to previous values.
vsmagalhaes Jul 3, 2025
ea5b91f
calculate_optimal_grid_parameters now guarantees that L and M axes wi…
vsmagalhaes Jul 3, 2025
7b74760
Fixed holog tests by explicitly defining the grid and beam sizes to a…
vsmagalhaes Jul 3, 2025
9bb5745
holog now updates the beam section of the summary when gridding the b…
vsmagalhaes Jul 3, 2025
dbb7589
Added tests on open_position and open_locit
vsmagalhaes Jul 3, 2025
0c5c912
Black compliance.
vsmagalhaes Jul 3, 2025
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
1,610 changes: 1,129 additions & 481 deletions docs/tutorial_vla.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "astrohack"
version = "0.7.1"
version = "0.7.2"
description = "Holography Antenna Commissioning Kit"
readme = "README.md"
requires-python = ">= 3.11, < 3.14"
Expand Down
42 changes: 8 additions & 34 deletions src/astrohack/antenna/antenna_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,6 @@
self.v_axis = inputxds.v_prime.values
self.computephase = False

try:
self.resolution = inputxds.attrs["aperture_resolution"]
except KeyError:

logger.warning("holog image does not have resolution information")
logger.warning(
"Rerun holog with astrohack v>0.1.5 for aperture resolution information"
)
self.resolution = None

def _read_panel_xds(self, inputxds):
self.wavelength = inputxds.attrs["wavelength"]
self.amp_unit = inputxds.attrs["amp_unit"]
Expand All @@ -171,24 +161,7 @@
self.u_axis = inputxds.u.values
self.v_axis = inputxds.u.values
self.panel_distribution = inputxds["PANEL_DISTRIBUTION"].values
try:
self.amplitude_noise = inputxds["AMP_NOISE"].values
except KeyError:
logger.warning(
"Input panel file does not have amplitude noise information, noise statistics will be "
"flawed"
)
self.amplitude_noise = np.full_like(self.amplitude, np.nan)

try:
self.resolution = inputxds.attrs["aperture_resolution"]
except KeyError:

logger.warning("Input panel file does not have resolution information")
logger.warning(
"Rerun holog with astrohack v>0.1.5 for aperture resolution information"
)
self.resolution = None
self.amplitude_noise = inputxds["AMP_NOISE"].values

Check warning on line 164 in src/astrohack/antenna/antenna_surface.py

View check run for this annotation

Codecov / codecov/patch

src/astrohack/antenna/antenna_surface.py#L164

Added line #L164 was not covered by tests

if self.solved:
self.panel_fallback = inputxds["PANEL_FALLBACK"].values
Expand Down Expand Up @@ -216,17 +189,18 @@
inputxds: X array dataset
"""
# Origin dependant reading

if self.reread:
self._read_panel_xds(inputxds)
else:
self._read_holog_xds(inputxds)

# Common elements
self.antenna_name = inputxds.attrs["ant_name"]
self.summary = inputxds.attrs["summary"]
self.antenna_name = inputxds.attrs["summary"]["general"]["antenna name"]
self.resolution = inputxds.summary["aperture"]["resolution"]
self.ddi = inputxds.attrs["ddi"]
self.label = create_dataset_label(
inputxds.attrs["ant_name"], inputxds.attrs["ddi"]
)
self.label = create_dataset_label(self.antenna_name, inputxds.attrs["ddi"])

def _define_amp_clip(self, clip_type, clip_level):
self.amplitude_noise = np.where(self.base_mask, np.nan, self.amplitude)
Expand Down Expand Up @@ -907,8 +881,6 @@
xds = xr.Dataset()
gains = self.gains()
rms = self.get_rms(unit="m")
xds.attrs["telescope_name"] = self.telescope.name
xds.attrs["ant_name"] = self.antenna_name
xds.attrs["ddi"] = self.ddi
xds.attrs["wavelength"] = self.wavelength
xds.attrs["amp_unit"] = self.amp_unit
Expand All @@ -919,6 +891,8 @@
xds.attrs["fitted"] = self.fitted
xds.attrs["aperture_resolution"] = self.resolution
xds.attrs["pol_state"] = self.pol_state
xds.attrs["summary"] = self.summary

xds["AMPLITUDE"] = xr.DataArray(self.amplitude, dims=["u", "v"])
xds["PHASE"] = xr.DataArray(self.phase, dims=["u", "v"])
xds["DEVIATION"] = xr.DataArray(self.deviation, dims=["u", "v"])
Expand Down
6 changes: 3 additions & 3 deletions src/astrohack/antenna/base_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def plot_label(self, ax, rotate=True):
else:
angle = 0
ax.text(
self.center.yc,
self.center.xc,
self.center.yc,
self.label,
fontsize=fontsize,
ha="center",
Expand All @@ -181,8 +181,8 @@ def plot_screws(self, ax):
"""
for iscrew, screw in enumerate(self.screws):
ax.scatter(
screw.yc,
screw.xc,
screw.yc,
marker=self.markers[iscrew],
lw=self.linewidth,
s=markersize,
Expand All @@ -208,7 +208,7 @@ def plot_corrections(self, ax, cmap, corrections, threshold, vmin, vmax):
else:
corr = corrections[iscrew]
circle = plt.Circle(
(screw.yc, screw.xc),
(screw.xc, screw.yc),
self.plot_screw_size,
color=cmap(norm(corr)),
fill=True,
Expand Down
16 changes: 5 additions & 11 deletions src/astrohack/antenna/telescope.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,15 @@

@classmethod
def from_xds(cls, xds):
if xds.attrs["telescope_name"] == "ALMA":
telescope_name = "_".join(
(xds.attrs["telescope_name"], xds.attrs["ant_name"][0:2])
)
tel_name = xds.attrs["summary"]["general"]["telescope name"]
if tel_name == "ALMA":
telescope_name = "_".join((tel_name, xds.attrs["ant_name"][0:2]))

Check warning on line 56 in src/astrohack/antenna/telescope.py

View check run for this annotation

Codecov / codecov/patch

src/astrohack/antenna/telescope.py#L56

Added line #L56 was not covered by tests
return cls(telescope_name)
elif (
xds.attrs["telescope_name"] == "EVLA"
or xds.attrs["telescope_name"] == "VLA"
):
elif tel_name == "EVLA" or tel_name == "VLA":
telescope_name = "VLA"
return cls(telescope_name)
else:
raise ValueError(
"Unsupported telescope {0:s}".format(xds.attrs["telescope_name"])
)
raise ValueError("Unsupported telescope {0:s}".format(tel_name))

Check warning on line 62 in src/astrohack/antenna/telescope.py

View check run for this annotation

Codecov / codecov/patch

src/astrohack/antenna/telescope.py#L62

Added line #L62 was not covered by tests

@staticmethod
def _get_telescope_file_name(name):
Expand Down
14 changes: 11 additions & 3 deletions src/astrohack/config/image_comparison_tool.param.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@
"required": false,
"type": ["boolean"]
},
"export_to_fits":{
"nullable": false,
"z_scale_limits": {
"nullable": true,
"required": false,
"type": ["boolean"]
"type": ["list", "tuple", "ndarray"],
"struct_type": ["float"],
"minlength": 2,
"maxlength": 2
},
"colormap":{
"nullable": false,
Expand All @@ -86,6 +89,11 @@
"required": false,
"type": ["boolean"]
},
"export_to_fits":{
"nullable": false,
"required": false,
"type": ["boolean"]
},
"parallel":{
"nullable": false,
"required": false,
Expand Down
Loading
Loading