Skip to content

Commit c27e05e

Browse files
committed
Helper functions for ska simulations
1 parent 29f0981 commit c27e05e

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

‎processing_components/simulation/simulation_helpers.py‎

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def valid_elevation(time, location, phasecentre):
3737
return valid_start_times
3838

3939

40-
def plot_uvcoverage(vis_list, plot_file='uvcoverage.png'):
40+
def plot_uvcoverage(vis_list, plot_file='uvcoverage.png', **kwargs):
4141
plt.clf()
4242
for ivis, vis in enumerate(vis_list):
4343
plt.plot(-vis.u, -vis.v, '.', color='b', markersize=0.2)
@@ -49,7 +49,7 @@ def plot_uvcoverage(vis_list, plot_file='uvcoverage.png'):
4949
plt.show(block=False)
5050

5151

52-
def plot_azel(bvis_list, plot_file='azel.png'):
52+
def plot_azel(bvis_list, plot_file='azel.png', **kwargs):
5353
plt.clf()
5454
r2d = 180.0 / numpy.pi
5555
for ibvis, bvis in enumerate(bvis_list):
@@ -71,15 +71,7 @@ def plot_azel(bvis_list, plot_file='azel.png'):
7171
plt.show(block=False)
7272

7373

74-
def plot_pb(pb, components=None, plot_file='PB_png', title=''):
75-
76-
show_image(pb, title=title, components=components, vmax=1.0, vmin=0.0)
77-
78-
plt.savefig(plot_file)
79-
plt.show(block=False)
80-
81-
82-
def plot_gaintable(gt_list, title='', plot_file='gaintable.png'):
74+
def plot_gaintable(gt_list, title='', plot_file='gaintable.png', **kwargs):
8375
plt.clf()
8476
for gt in gt_list:
8577
amp = numpy.abs(gt[0].gain[:, 0, 0, 0, 0])
@@ -89,7 +81,7 @@ def plot_gaintable(gt_list, title='', plot_file='gaintable.png'):
8981
plt.savefig(plot_file)
9082
plt.show(block=False)
9183

92-
def plot_pointingtable(pt_list, plot_file, title):
84+
def plot_pointingtable(pt_list, plot_file, title, **kwargs):
9385
plt.clf()
9486
r2a = 180.0 * 3600.0 / numpy.pi
9587
rms_az = 0.0
@@ -111,7 +103,7 @@ def plot_pointingtable(pt_list, plot_file, title):
111103
plt.show(block=False)
112104

113105

114-
def find_pb_width_null(pbtype, frequency):
106+
def find_pb_width_null(pbtype, frequency, **kwargs):
115107
if pbtype == 'MID':
116108
HWHM_deg = 0.596 * 1.36e9 / frequency[0]
117109
null_az_deg = 2.0 * HWHM_deg
@@ -136,8 +128,8 @@ def find_pb_width_null(pbtype, frequency):
136128
return HWHM_deg, null_az_deg, null_el_deg
137129

138130

139-
def calculate_simulation_components(context, phasecentre, frequency, pbtype, offset_dir, flux_limit,
140-
pbradius, pb_npixel, pb_cellsize):
131+
def create_simulation_components(context, phasecentre, frequency, pbtype, offset_dir, flux_limit,
132+
pbradius, pb_npixel, pb_cellsize):
141133
# Construct the skycomponents
142134

143135
HWHM_deg, null_az_deg, null_el_deg = find_pb_width_null(pbtype, frequency)

0 commit comments

Comments
 (0)