-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinterferometer_plots.py
More file actions
146 lines (133 loc) · 3.83 KB
/
interferometer_plots.py
File metadata and controls
146 lines (133 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import numpy as np
from typing import Optional
import matplotlib.pyplot as plt
from autoarray.plot.array import plot_array
from autoarray.plot.grid import plot_grid
from autoarray.plot.yx import plot_yx
from autoarray.plot.utils import subplot_save, hide_unused_axes, conf_subplot_figsize
from autoarray.structures.grids.irregular_2d import Grid2DIrregular
def subplot_interferometer_dataset(
dataset,
output_path: Optional[str] = None,
output_filename: str = "dataset",
output_format: str = "png",
colormap=None,
use_log10: bool = False,
):
"""
2×3 subplot of interferometer dataset components.
Panels: Visibilities | UV-Wavelengths | Amplitudes vs UV-distances |
Phases vs UV-distances | Dirty Image | Dirty S/N Map
Parameters
----------
dataset
An ``Interferometer`` dataset instance.
output_path
Directory to save the figure. ``None`` calls ``plt.show()``.
output_filename
Base filename without extension.
output_format
File format.
colormap
Matplotlib colormap name.
use_log10
Apply log10 normalisation to image panels.
"""
fig, axes = plt.subplots(2, 3, figsize=conf_subplot_figsize(2, 3))
axes = axes.flatten()
plot_grid(dataset.data.in_grid, ax=axes[0], title="Visibilities", xlabel="", ylabel="")
plot_grid(
Grid2DIrregular.from_yx_1d(
y=dataset.uv_wavelengths[:, 1] / 10**3.0,
x=dataset.uv_wavelengths[:, 0] / 10**3.0,
),
ax=axes[1],
title="UV-Wavelengths",
xlabel="",
ylabel="",
)
plot_yx(
dataset.amplitudes,
dataset.uv_distances / 10**3.0,
ax=axes[2],
title="Amplitudes vs UV-distances",
xtick_suffix='"',
ytick_suffix="Jy",
plot_axis_type="scatter",
)
plot_yx(
dataset.phases,
dataset.uv_distances / 10**3.0,
ax=axes[3],
title="Phases vs UV-distances",
xtick_suffix='"',
ytick_suffix="deg",
plot_axis_type="scatter",
)
plot_array(
dataset.dirty_image,
ax=axes[4],
title="Dirty Image",
colormap=colormap,
use_log10=use_log10,
)
plot_array(
dataset.dirty_signal_to_noise_map,
ax=axes[5],
title="Dirty Signal-To-Noise Map",
colormap=colormap,
use_log10=use_log10,
)
hide_unused_axes(axes)
plt.tight_layout()
subplot_save(fig, output_path, output_filename, output_format)
def subplot_interferometer_dirty_images(
dataset,
output_path: Optional[str] = None,
output_filename: str = "dirty_images",
output_format: str = "png",
colormap=None,
use_log10: bool = False,
):
"""
1×3 subplot of dirty image, dirty noise map, and dirty S/N map.
Parameters
----------
dataset
An ``Interferometer`` dataset instance.
output_path
Directory to save the figure. ``None`` calls ``plt.show()``.
output_filename
Base filename without extension.
output_format
File format.
colormap
Matplotlib colormap name.
use_log10
Apply log10 normalisation.
"""
fig, axes = plt.subplots(1, 3, figsize=conf_subplot_figsize(1, 3))
plot_array(
dataset.dirty_image,
ax=axes[0],
title="Dirty Image",
colormap=colormap,
use_log10=use_log10,
)
plot_array(
dataset.dirty_noise_map,
ax=axes[1],
title="Dirty Noise Map",
colormap=colormap,
use_log10=use_log10,
)
plot_array(
dataset.dirty_signal_to_noise_map,
ax=axes[2],
title="Dirty Signal-To-Noise Map",
colormap=colormap,
use_log10=use_log10,
)
hide_unused_axes(axes)
plt.tight_layout()
subplot_save(fig, output_path, output_filename, output_format)