diff --git a/rfinder/main.py b/rfinder/main.py index 3eb6e36..2edb504 100644 --- a/rfinder/main.py +++ b/rfinder/main.py @@ -426,13 +426,15 @@ def go(self,cfg_par): rfiFL.rfi_frequency(self.cfg_par,-1) self.logger.warning("------ RFI saved to table ------\n") self.logger.warning("------ End of RFI analysis ------\n") + + else: + rfi.load_from_ms(self.cfg_par,0,0) + self.logger.warning("------ MSfile Loaded -----\n") task = 'plots' if self.cfg_par[task]['plot_summary']['enable']==True: summary_results = {} - if not self.cfg_par['rfi']['rfi_enable']: - rfi.load_from_ms(self.cfg_par,0,0) for axis in self.cfg_par[task]['plot_summary']['axis']: flag_stats = rfiST.get_flags_summary_stats(self.cfg_par, axis) @@ -448,7 +450,7 @@ def go(self,cfg_par): rfiFL.write_html_summaryreport(self.cfg_par) - if self.cfg_par[task]['plot_enable']==True: + if self.cfg_par[task]['plot_details']['enable']==True: if self.cfg_par['rfi']['chunks']['time_enable']==True: @@ -483,39 +485,40 @@ def go(self,cfg_par): rfiPL.plot_rfi_imshow(self.cfg_par,i) self.logger.info("------ RFI in 2D plotted ------\n") - self.cfg_par['plots']['plot_noise'] = 'rfi' - self.cfg_par['plots']['long_short'] = False + self.cfg_par['plots']['plot_details']['plot_noise'] = 'rfi' + self.cfg_par['plots']['plot_details']['long_short'] = False rfiPL.plot_noise_frequency(self.cfg_par,i) - self.cfg_par['plots']['long_short'] = True + self.cfg_par['plots']['plot_details']['long_short'] = True rfiPL.plot_noise_frequency(self.cfg_par,i) - self.cfg_par['plots']['plot_noise'] = 'noise_factor' + self.cfg_par['plots']['plot_details']['plot_noise'] = 'noise_factor' rfiPL.plot_noise_frequency(self.cfg_par,i) - self.cfg_par['plots']['plot_noise'] = 'noise' + self.cfg_par['plots']['plot_details']['plot_noise'] = 'noise' rfiPL.plot_noise_frequency(self.cfg_par,i) self.logger.warning("------ RFI in 1D plotted ------\n") rfiPL.plot_altaz(self.cfg_par,68) self.logger.warning("------ RFI in ALT/AZ plotted ------\n") - if (self.cfg_par['plots']['movies']['altaz_gif']==True or self.cfg_par['plots']['movies']['2d_gif']==True or - self.cfg_par['plots']['movies']['1d_gif']==True): + if (self.cfg_par['plots']['plot_details']['movies']['altaz_gif']==True or + self.cfg_par['plots']['plot_details']['movies']['2d_gif']==True or + self.cfg_par['plots']['plot_details']['movies']['1d_gif']==True): self.logger.warning("------ Making movies ------\n") - if self.cfg_par['plots']['movies']['altaz_gif']==True: + if self.cfg_par['plots']['plot_details']['movies']['altaz_gif']==True: out_animation = self.cfg_par['general']['moviedir']+'AltAz_movie.gif' filenames = rfiFL.find_altaz_plots(self.cfg_par) rfiPL.gif_me_up(self.cfg_par,filenames,out_animation) self.logger.info("------ AltAz movie done ------\n") - if self.cfg_par['plots']['movies']['2d_gif']==True: + if self.cfg_par['plots']['plot_details']['movies']['2d_gif']==True: out_animation = self.cfg_par['general']['moviedir']+'Time_2Dplot_movie.gif' filenames = rfiFL.find_2d_plots(self.cfg_par) rfiPL.gif_me_up(self.cfg_par,filenames,out_animation) self.logger.info("------ 2D movie done ------\n") - if self.cfg_par['plots']['movies']['1d_gif']==True: + if self.cfg_par['plots']['plot_details']['movies']['1d_gif']==True: out_animation = self.cfg_par['general']['moviedir']+'TimeChunks_1D_flags.gif' root_name = 'flags' filenames = rfiFL.find_1d_plots(self.cfg_par,root_name) @@ -532,8 +535,9 @@ def go(self,cfg_par): rfiPL.gif_me_up(self.cfg_par,filenames,out_animation) self.logger.info("------ 1D movies done ------\n") - if (self.cfg_par['plots']['movies']['altaz_gif']==True or self.cfg_par['plots']['movies']['2d_gif']==True or - self.cfg_par['plots']['movies']['1d_gif']==True): + if (self.cfg_par['plots']['plot_details']['movies']['altaz_gif']==True or + self.cfg_par['plots']['plot_details']['movies']['2d_gif']==True or + self.cfg_par['plots']['plot_details']['movies']['1d_gif']==True): self.logger.warning("------ Movies done ------\n") rfiFL.write_html_timereport(self.cfg_par) @@ -554,14 +558,14 @@ def go(self,cfg_par): self.logger.warning("------ Alt/Az plotted ------\n") rfiPL.plot_rfi_imshow(self.cfg_par,-1) self.logger.warning("------ RFI in 2D plotted ------\n") - self.cfg_par['plots']['plot_noise'] = 'rfi' - self.cfg_par['plots']['long_short'] = False + self.cfg_par['plots']['plot_details']['plot_noise'] = 'rfi' + self.cfg_par['plots']['plot_details']['long_short'] = False rfiPL.plot_noise_frequency(self.cfg_par,-1) - self.cfg_par['plots']['long_short'] = True + self.cfg_par['plots']['plot_details']['long_short'] = True rfiPL.plot_noise_frequency(self.cfg_par,-1) - self.cfg_par['plots']['plot_noise'] = 'noise_factor' + self.cfg_par['plots']['plot_details']['plot_noise'] = 'noise_factor' rfiPL.plot_noise_frequency(self.cfg_par,-1) - self.cfg_par['plots']['plot_noise'] = 'noise' + self.cfg_par['plots']['plot_details']['plot_noise'] = 'noise' rfiPL.plot_noise_frequency(self.cfg_par,-1) self.logger.warning("------ RFI in 1D plotted ------\n") diff --git a/rfinder/rfi.py b/rfinder/rfi.py index f718e33..ab069bb 100644 --- a/rfinder/rfi.py +++ b/rfinder/rfi.py @@ -32,7 +32,7 @@ class rfi: def __init__(self): self.logger = logging.getLogger('log-rfinder.log') - #self.logger.setLevel(logging.INFO) + self.logger.setLevel(logging.INFO) #fh = logging.FileHandler('log-rfinder.log') #fh.setLevel(logging.INFO) diff --git a/rfinder/rfinder_default.yml b/rfinder/rfinder_default.yml index cb6bfc3..3562ba1 100644 --- a/rfinder/rfinder_default.yml +++ b/rfinder/rfinder_default.yml @@ -18,7 +18,7 @@ general: rfi: __helpstr: Find RFI in msfile over threshold - rfi_enable: true #if True this module is enabled + rfi_enable: true #if True this module is enabled else only obs info will logged polarization: 'q' #xx, yy, xy, yx, q (also in CAPS) bad_antenna: '[]' #list of bad antennas: for no antennas try '[]' RFInder_mode: 'use_flags' #uses RFI clip method or simply reads the FLAG column 'use_flags' / 'rms_clip' @@ -34,17 +34,19 @@ rfi: plots: __helpstr: plot rfi over different axes - plot_enable: true - plot_noise: 'rfi' #choose to plot % of RFI, 'rfi', or noise, 'noise', or factor of noise increase, 'noise_factor' in 1D plots - plot_long_short: true #plot all baselines, or only the short and the long + plot_detail: + __helpstr: plot formats + enable: true + plot_noise: 'rfi' #choose to plot % of RFI, 'rfi', or noise, 'noise', or factor of noise increase, 'noise_factor' in 1D plots + plot_long_short: true #plot all baselines, or only the short and the long + movies: + __helpstr: make movies of output plots + 2d_gif: true + 1d_gif: true + altaz_gif: true + movies_in_report: true plot_summary: __helpstr: plot total % flagged visibilities enable: true - axis: [ant, scan, corr] # Avalable choices [ant, corr, scan] + axis: [ant, scan, corr, freq] #avalable choices [ant, corr, scan, freq] report: true - movies: - __helpstr: make movies of output plots - 2d_gif: true - 1d_gif: true - altaz_gif: true - movies_in_report: true diff --git a/rfinder/rfinder_stats.py b/rfinder/rfinder_stats.py index ee87ef3..b0ad52d 100644 --- a/rfinder/rfinder_stats.py +++ b/rfinder/rfinder_stats.py @@ -28,7 +28,7 @@ class rfi_stats: def __init__(self): self.logger = logging.getLogger('log-rfinder.log') - #self.logger.setLevel(logging.INFO) + self.logger.setLevel(logging.INFO) #fh = logging.FileHandler('log-rfinder.log') #fh.setLevel(logging.INFO)