|
7 | 7 |
|
8 | 8 | from astrohack import get_proper_telescope |
9 | 9 | from astrohack.utils.file import load_holog_file |
10 | | -from astrohack.utils import create_dataset_label, data_statistics, statistics_to_text, convert_unit, sig_2_fwhm, \ |
11 | | - format_frequency, format_value_unit, to_db, fontsize |
| 10 | +from astrohack.utils import create_dataset_label, convert_unit, sig_2_fwhm, \ |
| 11 | + format_frequency, format_value_unit, to_db |
12 | 12 | from astrohack.visualization import create_figure_and_axes, scatter_plot, close_figure |
13 | 13 | from astrohack.visualization.plot_tools import set_y_axis_lims_from_default |
14 | | -import matplotlib.ticker as mticker |
| 14 | + |
| 15 | +lnbr = '\n' |
15 | 16 |
|
16 | 17 |
|
17 | 18 | def process_beamcut_chunk(beamcut_chunk_params): |
@@ -57,6 +58,7 @@ def process_beamcut_chunk(beamcut_chunk_params): |
57 | 58 |
|
58 | 59 | plot_cuts_in_amplitude(cut_list, summary, beamcut_chunk_params) |
59 | 60 | plot_cuts_in_attenuation(cut_list, summary, beamcut_chunk_params) |
| 61 | + create_report_chunk(cut_list, summary, beamcut_chunk_params) |
60 | 62 |
|
61 | 63 | def time_scan_selection(scan_time_ranges, time_axis): |
62 | 64 | time_selections = [] |
@@ -207,13 +209,13 @@ def add_lobe_identification_to_plot(ax, centers, peaks, y_off, attenunation_plot |
207 | 209 | ax.text(centers[i_peak], peak+y_off, f'{i_peak+1})', ha='center', va='bottom') |
208 | 210 |
|
209 | 211 |
|
210 | | -def make_parallel_hand_subplot_title(direction, time_string): |
| 212 | +def make_parallel_hand_sub_title(direction, time_string): |
211 | 213 | return f'{direction}, {time_string} UTC' |
212 | 214 |
|
213 | 215 |
|
214 | 216 | def plot_single_cut_amp_parallel_corrs(cut_dict, axes, par_dict): |
215 | 217 | # Init |
216 | | - sub_title = make_parallel_hand_subplot_title(cut_dict["direction"], cut_dict["time_string"]) |
| 218 | + sub_title = make_parallel_hand_sub_title(cut_dict["direction"], cut_dict["time_string"]) |
217 | 219 | max_amp = cut_dict['max_amp'] |
218 | 220 | y_off = 0.05*max_amp |
219 | 221 | lm_unit = par_dict['lm_unit'] |
@@ -277,6 +279,7 @@ def create_beamcut_header(summary, par_dict): |
277 | 279 | title += f'El ~ {format_value_unit(mean_azel[1], 'deg', decimal_places=0)}' |
278 | 280 | return title |
279 | 281 |
|
| 282 | + |
280 | 283 | def plot_cuts_in_amplitude(cut_list, summary, par_dict): |
281 | 284 | # Init |
282 | 285 | n_cuts = len(cut_list) |
@@ -355,7 +358,7 @@ def beamcut_fit(cut_list, telescope, summary): |
355 | 358 |
|
356 | 359 |
|
357 | 360 | def plot_single_cut_attenuation_parallel_corrs(cut_dict, ax, par_dict): |
358 | | - sub_title = make_parallel_hand_subplot_title(cut_dict["direction"], cut_dict["time_string"]) |
| 361 | + sub_title = make_parallel_hand_sub_title(cut_dict["direction"], cut_dict["time_string"]) |
359 | 362 | lm_unit = par_dict['lm_unit'] |
360 | 363 | lm_fac = convert_unit('rad', lm_unit, 'trigonometric') |
361 | 364 | corr_colors = ['blue', 'red'] |
@@ -425,4 +428,22 @@ def plot_cuts_in_attenuation(cut_list, summary, par_dict): |
425 | 428 | close_figure(fig, title, filename, par_dict['dpi'], par_dict['display']) |
426 | 429 |
|
427 | 430 |
|
| 431 | +def create_report_chunk(cut_list, summary, par_dict): |
| 432 | + outstr = '' |
| 433 | + |
| 434 | + outstr += create_beamcut_header(summary, par_dict)+2*lnbr |
| 435 | + for icut, cut_dict in enumerate(cut_list): |
| 436 | + sub_title = make_parallel_hand_sub_title(cut_dict["direction"], cut_dict["time_string"]) |
| 437 | + for i_corr, parallel_hand in enumerate(cut_dict['available_corrs']): |
| 438 | + outstr += f'{parallel_hand} {sub_title}{lnbr}' |
| 439 | + |
| 440 | + outstr += lnbr |
| 441 | + |
| 442 | + outstr += lnbr |
| 443 | + |
| 444 | + print(outstr) |
| 445 | + |
| 446 | + |
| 447 | + |
| 448 | + |
428 | 449 |
|
0 commit comments