From de2f9de8dcfbd04ea135c04849df27711a93cda4 Mon Sep 17 00:00:00 2001 From: xumi1993 Date: Thu, 23 Nov 2023 22:08:30 +0800 Subject: [PATCH] update plotrt --- seispy/pickrf/pickfigure.py | 20 ++- seispy/pickrf/rpickfigure.py | 2 +- seispy/plotR.py | 10 +- seispy/plotRT.py | 303 +++++++++++++++++++---------------- seispy/rfcorrect.py | 14 +- seispy/scripts.py | 8 +- 6 files changed, 204 insertions(+), 153 deletions(-) diff --git a/seispy/pickrf/pickfigure.py b/seispy/pickrf/pickfigure.py index 683b718e..bfa5d1c3 100644 --- a/seispy/pickrf/pickfigure.py +++ b/seispy/pickrf/pickfigure.py @@ -8,7 +8,7 @@ from matplotlib.figure import Figure from os.path import join, basename from seispy.setuplog import setuplog -from seispy.plotRT import init_figure, set_fig, plot_waves +from seispy.rfcorrect import RFStation def indexpags(evt_num, maxidx=20): @@ -158,6 +158,7 @@ def read_sac(self, dt=0.1, order='baz'): self.log.RFlog.info('A total of {} PRFs loaded'.format(self.evt_num)) self.baz = np.array([tr.stats.sac.baz for tr in self.rrf]) self.gcarc = np.array([tr.stats.sac.gcarc for tr in self.rrf]) + self.rayp = np.array([tr.stats.sac.user0 for tr in self.rrf]) self._sort(order) self.axpages, self.rfidx = indexpags(self.evt_num, self.maxidx) self.staname = (self.rrf[0].stats.network+'.'+self.rrf[0].stats.station).strip('.') @@ -286,8 +287,15 @@ def finish(self): def plot(self): plt.ion() plt.rcParams['toolbar'] = 'None' - stadata = StaData(self.filenames, self.rrf, self.trf, self.baz, self.goodrf) - stadata.time_axis = self.time_axis - self.plotfig, axr, axt, axb, axr_sum, axt_sum = init_figure() - plot_waves(axr, axt, axb, axr_sum, axt_sum, stadata, enf=self.enf) - set_fig(axr, axt, axb, axr_sum, axt_sum, stadata, self.staname) + goodidx = np.where(self.goodrf == 1)[0] + newrfs = obspy.Stream([self.rrf[idx] for idx in goodidx]) + newtrfs = obspy.Stream([self.trf[idx] for idx in goodidx]) + stadata = RFStation.read_stream(newrfs, self.rayp[goodidx], + self.baz[goodidx], prime_comp=self.comp, + stream_t=newtrfs) + stadata.event = np.array([self.filenames[i] for i in goodidx]) + prt = stadata.plotrt(enf=self.enf, xlim=self.xlim, out_path=None) + self.plotfig = prt.fig + # self.plotfig, axr, axt, axb, axr_sum, axt_sum = init_figure() + # plot_waves(axr, axt, axb, axr_sum, axt_sum, stadata, enf=self.enf) + # set_fig(axr, axt, axb, axr_sum, axt_sum, stadata, self.staname) diff --git a/seispy/pickrf/rpickfigure.py b/seispy/pickrf/rpickfigure.py index b31a7669..015f5f04 100644 --- a/seispy/pickrf/rpickfigure.py +++ b/seispy/pickrf/rpickfigure.py @@ -169,5 +169,5 @@ def plot(self): stadata = RFStation.read_stream(newrfs, self.rayp[goodidx], self.baz[goodidx], prime_comp=self.comp) stadata.event = np.array([self.filenames[i] for i in goodidx]) - pr = stadata.plotr(enf=self.enf, xlim=self.xlim, output=None) + pr = stadata.plotr(enf=self.enf, xlim=self.xlim, out_path=None) self.plotfig = pr.fig \ No newline at end of file diff --git a/seispy/plotR.py b/seispy/plotR.py index 1599f4c2..3824d933 100644 --- a/seispy/plotR.py +++ b/seispy/plotR.py @@ -106,11 +106,13 @@ def plot(self, out_path=None, outformat='g', show=False): if outformat is None and not show: return elif outformat == 'g': - self.fig.savefig(join(out_path, self.stadata.staname+'_R_{}order_{:.1f}.png'.format(self.key, self.stadata.f0[0])), - dpi=400, bbox_inches='tight') + self.fig.savefig(join(out_path, self.stadata.staname+'_{}_{}order_{:.1f}.png'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + dpi=400, bbox_inches='tight') elif outformat == 'f': - self.fig.savefig(join(out_path, self.stadata.staname+'_R_{}order_{:.1f}.pdf'.format(self.key, self.stadata.f0[0])), - format='pdf', bbox_inches='tight') + self.fig.savefig(join(out_path, self.stadata.staname+'_{}_{}order_{:.1f}.pdf'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + format='pdf', bbox_inches='tight') if show: plt.show() diff --git a/seispy/plotRT.py b/seispy/plotRT.py index 5fdd1ca5..027926ec 100644 --- a/seispy/plotRT.py +++ b/seispy/plotRT.py @@ -5,133 +5,168 @@ from os.path import join -def init_figure(): - h = plt.figure(figsize=(11.7, 8.3)) - gs = GridSpec(17, 3) - gs.update(wspace=0.25) - axr_sum = plt.subplot(gs[0, 0]) - axr_sum.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') - axr = plt.subplot(gs[1:, 0]) - axr.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') - axt_sum = plt.subplot(gs[0, 1]) - axt_sum.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') - axt = plt.subplot(gs[1:, 1]) - axt.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') - axb = plt.subplot(gs[1:, 2]) - axb.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') - return h, axr, axt, axb, axr_sum, axt_sum - - -def plot_waves(axr, axt, axb, axr_sum, axt_sum, stadata, enf=3): - """Plot PRFs with R and T components - - :param axr: The axis of R component - :type axr: matplotlib.axes - :param axt: The axis of T component - :type axt: matplotlib.axes - :param axb: The axis of back-azimuth - :type axb: matplotlib.axes - :param axr_sum: The axis of R component sum - :type axr_sum: matplotlib.axes - :param axt_sum: The axis of T component sum - :type axt_sum: matplotlib.axes - :param stadata: The PRFs data - :type stadata: seispy.core.StaData - :param enf: The enlarge factor, defaults to 3 - :type enf: int, optional - """ - - bound = np.zeros(stadata.rflength) - for i in range(stadata.ev_num): - datar = stadata.datar[i] * enf + (i + 1) - datat = stadata.datat[i] * enf + (i + 1) - # axr.plot(time_axis, stadata.datar[i], linewidth=0.2, color='black') - axr.fill_between(stadata.time_axis, datar, bound + i+1, where=datar > i+1, facecolor='red', - alpha=0.7) - axr.fill_between(stadata.time_axis, datar, bound + i+1, where=datar < i+1, facecolor='blue', - alpha=0.7) - # axt.plot(time_axis, stadata.datat[i], linewidth=0.2, color='black') - axt.fill_between(stadata.time_axis, datat, bound + i + 1, where=datat > i+1, facecolor='red', - alpha=0.7) - axt.fill_between(stadata.time_axis, datat, bound + i + 1, where=datat < i+1, facecolor='blue', - alpha=0.7) - datar = np.mean(stadata.datar, axis=0) - datar /= np.max(datar) - datat = np.mean(stadata.datat, axis=0) - datat /= np.max(datar) - axr_sum.fill_between(stadata.time_axis, datar, bound, where=datar > 0, facecolor='red', alpha=0.7) - axr_sum.fill_between(stadata.time_axis, datar, bound, where=datar < 0, facecolor='blue', alpha=0.7) - axt_sum.fill_between(stadata.time_axis, datat, bound, where=datat > 0, facecolor='red', alpha=0.7) - axt_sum.fill_between(stadata.time_axis, datat, bound, where=datat < 0, facecolor='blue', alpha=0.7) - axb.scatter(stadata.bazi, np.arange(stadata.ev_num) + 1, s=7) - - -def set_fig(axr, axt, axb, axr_sum, axt_sum, stadata, station, xmin=-2, xmax=30, comp='R'): - y_range = np.arange(stadata.ev_num) + 1 - x_range = np.arange(0, xmax+2, 2) - space = 2 - - # set axr - axr.set_xlim(xmin, xmax) - axr.set_xticks(x_range) - axr.set_xticklabels(x_range, fontsize=8) - axr.set_ylim(0, stadata.ev_num + space) - axr.set_yticks(y_range) - axr.set_yticklabels(stadata.event, fontsize=5) - axr.set_xlabel('Time after P (s)', fontsize=13) - axr.set_ylabel('Event', fontsize=13) - axr.add_line(Line2D([0, 0], axr.get_ylim(), color='black')) - - # set axr_sum - axr_sum.set_title('{} components ({})'.format(comp, station), fontsize=16) - axr_sum.set_xlim(xmin, xmax) - axr_sum.set_xticks(x_range) - axr_sum.set_xticklabels([]) - axr_sum.set_ylim(-0.5, 1.25) - axr_sum.set_yticks([0.375]) - axr_sum.set_yticklabels(['Sum'], fontsize=8) - axr_sum.tick_params(axis='y', left=False) - axr_sum.add_line(Line2D([0, 0], axr_sum.get_ylim(), color='black')) - - # set axt - axt.set_xlim(xmin, xmax) - axt.set_xticks(x_range) - axt.set_xticklabels(x_range, fontsize=8) - axt.set_ylim(0, stadata.ev_num + space) - axt.set_yticks(y_range) - bazi = ['{:.1f}'.format(ba) for ba in stadata.bazi] - axt.set_yticklabels(bazi, fontsize=5) - axt.set_xlabel('Time after P (s)', fontsize=13) - axt.set_ylabel(r'Back-azimuth ($\circ$)', fontsize=13) - axt.add_line(Line2D([0, 0], axt.get_ylim(), color='black')) - - # set axt_sum - axt_sum.set_title('T components ({})'.format(station), fontsize=16) - axt_sum.set_xlim(xmin, xmax) - axt_sum.set_xticks(x_range) - axt_sum.set_xticklabels([]) - axt_sum.set_ylim(-0.5, 1.25) - axt_sum.set_yticks([0.375]) - axt_sum.set_yticklabels(['Sum'], fontsize=8) - axt_sum.tick_params(axis='y', left=False) - axt_sum.add_line(Line2D([0, 0], axt_sum.get_ylim(), color='black')) - - # set axb - axb.set_xlim(0, 360) - axb.set_xticks(np.linspace(0, 360, 7)) - axb.set_xticklabels(np.linspace(0, 360, 7, dtype='i'), fontsize=8) - axb.set_ylim(0, stadata.ev_num + space) - axb.set_yticks(y_range) - axb.set_yticklabels(y_range, fontsize=5) - axb.set_xlabel(r'Back-azimuth ($\circ$)', fontsize=13) - - -def plotrt(rfsta, enf=3, out_path='./', key='bazi', outformat='g', xlim=[-2, 30], show=False): +class PlotRT: + def __init__(self, stadata, enf=3, xlim=[2, 80], key='bazi') -> None: + """Plot receiver function in R and T components + + :param stadata: receiver function data + :type stadata: seispy.rfcorrect.RFStation + :param enf: enlarge factor, defaults to 12 + :type enf: int, optional + :param xlim: xlim, defaults to [2, 80] + :type xlim: list, optional + :param key: sort key, defaults to 'bazi' + :type key: str, optional + """ + self.stadata = stadata + self.stadata.sort(key) + self.enf = enf + self.xlim = xlim + self.key = key + self.init_figure() + + def init_figure(self): + self.fig = plt.figure(figsize=(11.7, 8.3)) + gs = GridSpec(17, 3) + gs.update(wspace=0.25) + self.axr_sum = plt.subplot(gs[0, 0]) + self.axr_sum.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') + self.axr = plt.subplot(gs[1:, 0]) + self.axr.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') + self.axt_sum = plt.subplot(gs[0, 1]) + self.axt_sum.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') + self.axt = plt.subplot(gs[1:, 1]) + self.axt.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') + self.axb = plt.subplot(gs[1:, 2]) + self.axb.grid(color='gray', linestyle='--', linewidth=0.4, axis='x') + + def plot_waves(self): + """Plot PRFs with R and T components + """ + + bound = np.zeros(self.stadata.rflength) + for i in range(self.stadata.ev_num): + datar = self.stadata.data_prime[i] * self.enf + (i + 1) + datat = self.stadata.datat[i] * self.enf + (i + 1) + # axr.plot(time_axis, stadata.datar[i], linewidth=0.2, color='black') + self.axr.fill_between(self.stadata.time_axis, datar, bound + i+1, where=datar > i+1, facecolor='red', + alpha=0.7) + self.axr.fill_between(self.stadata.time_axis, datar, bound + i+1, where=datar < i+1, facecolor='blue', + alpha=0.7) + # axt.plot(time_axis, stadata.datat[i], linewidth=0.2, color='black') + self.axt.fill_between(self.stadata.time_axis, datat, bound + i + 1, where=datat > i+1, facecolor='red', + alpha=0.7) + self.axt.fill_between(self.stadata.time_axis, datat, bound + i + 1, where=datat < i+1, facecolor='blue', + alpha=0.7) + datar = np.mean(self.stadata.data_prime, axis=0) + datar /= np.max(datar) + datat = np.mean(self.stadata.datat, axis=0) + datat /= np.max(datar) + self.axr_sum.fill_between(self.stadata.time_axis, datar, bound, where=datar > 0, facecolor='red', alpha=0.7) + self.axr_sum.fill_between(self.stadata.time_axis, datar, bound, where=datar < 0, facecolor='blue', alpha=0.7) + self.axt_sum.fill_between(self.stadata.time_axis, datat, bound, where=datat > 0, facecolor='red', alpha=0.7) + self.axt_sum.fill_between(self.stadata.time_axis, datat, bound, where=datat < 0, facecolor='blue', alpha=0.7) + self.axb.scatter(self.stadata.bazi, np.arange(self.stadata.ev_num) + 1, s=7) + + + def set_fig(self): + """Set figure + """ + y_range = np.arange(self.stadata.ev_num) + 1 + x_range = np.arange(0, self.xlim[1]+2, 2) + space = 2 + + # set axr + self.axr.set_xlim(self.xlim) + self.axr.set_xticks(x_range) + self.axr.set_xticklabels(x_range, fontsize=8) + self.axr.set_ylim(0, self.stadata.ev_num + space) + self.axr.set_yticks(y_range) + self.axr.set_yticklabels(self.stadata.event, fontsize=5) + self.axr.set_xlabel('Time after P (s)', fontsize=13) + self.axr.set_ylabel('Event', fontsize=13) + self.axr.add_line(Line2D([0, 0], self.axr.get_ylim(), color='black')) + + # set axr_sum + self.axr_sum.set_title('{} components ({})'.format(self.stadata.comp, self.stadata.staname), fontsize=16) + self.axr_sum.set_xlim(self.xlim) + self.axr_sum.set_xticks(x_range) + self.axr_sum.set_xticklabels([]) + self.axr_sum.set_ylim(-0.5, 1.25) + self.axr_sum.set_yticks([0.375]) + self.axr_sum.set_yticklabels(['Sum'], fontsize=8) + self.axr_sum.tick_params(axis='y', left=False) + self.axr_sum.add_line(Line2D([0, 0], self.axr_sum.get_ylim(), color='black')) + + # set axt + self.axt.set_xlim(self.xlim) + self.axt.set_xticks(x_range) + self.axt.set_xticklabels(x_range, fontsize=8) + self.axt.set_ylim(0, self.stadata.ev_num + space) + self.axt.set_yticks(y_range) + bazi = ['{:.1f}'.format(ba) for ba in self.stadata.bazi] + self.axt.set_yticklabels(bazi, fontsize=5) + self.axt.set_xlabel('Time after P (s)', fontsize=13) + self.axt.set_ylabel(r'Back-azimuth ($\circ$)', fontsize=13) + self.axt.add_line(Line2D([0, 0], self.axt.get_ylim(), color='black')) + + # set axt_sum + self.axt_sum.set_title('T components ({})'.format(self.stadata.staname), fontsize=16) + self.axt_sum.set_xlim(self.xlim) + self.axt_sum.set_xticks(x_range) + self.axt_sum.set_xticklabels([]) + self.axt_sum.set_ylim(-0.5, 1.25) + self.axt_sum.set_yticks([0.375]) + self.axt_sum.set_yticklabels(['Sum'], fontsize=8) + self.axt_sum.tick_params(axis='y', left=False) + self.axt_sum.add_line(Line2D([0, 0], self.axt_sum.get_ylim(), color='black')) + + # set axb + self.axb.set_xlim(0, 360) + self.axb.set_xticks(np.linspace(0, 360, 7)) + self.axb.set_xticklabels(np.linspace(0, 360, 7, dtype='i'), fontsize=8) + self.axb.set_ylim(0, self.stadata.ev_num + space) + self.axb.set_yticks(y_range) + self.axb.set_yticklabels(y_range, fontsize=5) + self.axb.set_xlabel(r'Back-azimuth ($\circ$)', fontsize=13) + + + def plot(self, out_path=None, outformat='g', show=False): + """Plot PRFs with R and T components + + :param rfsta: Path to PRFs + :type rfsta: seispy.rfcorrect.RFStation + :param enf: The enlarge factor, defaults to 3 + :type enf: int, optional + :param out_path: The output path, defaults to current directory + :type out_path: str, optional + :param key: The key to sort PRFs, avialible for ``event``, ``evla``, ``evlo``, ``evdp``, + ``dis``, ``bazi``, ``rayp``, ``mag``, ``f0``, defaults to ``bazi`` + :type key: str, optional + :param outformat: File format of the image file, g as \'png\', f as \'pdf\', defaults to 'g' + :type outformat: str, optional + """ + self.plot_waves() + self.set_fig() + if outformat is None and not show: + return + elif outformat == 'g': + self.fig.savefig(join(out_path, self.stadata.staname+'_{}T_{}order_{:.1f}.png'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + dpi=400, bbox_inches='tight') + elif outformat == 'f': + self.fig.savefig(join(out_path, self.stadata.staname+'_{}T_{}order_{:.1f}.pdf'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + format='pdf', bbox_inches='tight') + if show: + plt.show() + +def plotrt(rfsta, out_path='./', xlim=[-2, 30], key='bazi', enf=6, outformat='g', show=False): """Plot PRFs with R and T components :param rfsta: Path to PRFs :type rfsta: seispy.rfcorrect.RFStation - :param enf: The enlarge factor, defaults to 3 + :param enf: The enlarge factor, defaults to 6 :type enf: int, optional :param out_path: The output path, defaults to current directory :type out_path: str, optional @@ -140,22 +175,14 @@ def plotrt(rfsta, enf=3, out_path='./', key='bazi', outformat='g', xlim=[-2, 30] :type key: str, optional :param outformat: File format of the image file, g as \'png\', f as \'pdf\', defaults to 'g' :type outformat: str, optional + :param xlim: xlim, defaults to [-2, 30] + :type xlim: list, optional + :param show: show figure + :type show: bool """ - h, axr, axt, axb, axr_sum, axt_sum = init_figure() - rfsta.sort(key) - plot_waves(axr, axt, axb, axr_sum, axt_sum, rfsta, enf=enf) - set_fig(axr, axt, axb, axr_sum, axt_sum, rfsta, rfsta.staname, xmin=xlim[0], xmax=xlim[1], comp=rfsta.comp) - if outformat is None and not show: - return h - elif outformat == 'g': - h.savefig(join(out_path, rfsta.staname+'_RT_{}order_{:.1f}.png'.format(key, rfsta.f0[0])), - dpi=400, bbox_inches='tight') - elif outformat == 'f': - h.savefig(join(out_path, rfsta.staname+'_RT_{}order_{:.1f}.pdf'.format(key, rfsta.f0[0])), - format='pdf', bbox_inches='tight') - if show: - plt.show() - return h + prt = PlotRT(rfsta, enf=enf, xlim=xlim, key=key) + prt.plot(out_path, outformat, show) + return prt if __name__ == '__main__': diff --git a/seispy/rfcorrect.py b/seispy/rfcorrect.py index ccf92288..dbcc990b 100644 --- a/seispy/rfcorrect.py +++ b/seispy/rfcorrect.py @@ -115,7 +115,7 @@ def init_property(self, ev_num): # self.data_prime = eval('self.data{}'.format(self.comp.lower())) @classmethod - def read_stream(cls, stream, rayp, baz, prime_comp='R'): + def read_stream(cls, stream, rayp, baz, prime_comp='R', stream_t=None): """Create RFStation instance from ``obspy.Stream`` Parameters @@ -131,7 +131,13 @@ def read_stream(cls, stream, rayp, baz, prime_comp='R'): """ if len(stream) == 0: raise ValueError('No such RFTrace read') - rfsta = cls('', only_r=True, prime_comp=prime_comp) + if stream_t is not None and len(stream) != len(stream_t): + raise ValueError('Stream and Stream_t must have the same length') + if stream_t is not None: + only_r = False + else: + only_r = True + rfsta = cls('', only_r=only_r, prime_comp=prime_comp) ev_num = len(stream) if scalar_instance(rayp): rayp = np.ones(ev_num)*rayp @@ -164,6 +170,10 @@ def read_stream(cls, stream, rayp, baz, prime_comp='R'): except: rfsta.f0[i] = tr.stats.sac.user1 rfsta.data_prime[i] = tr.data + if stream_t is not None: + rfsta.datat = np.zeros([rfsta.ev_num, rfsta.rflength]) + for i, tr in enumerate(stream_t): + rfsta.datat[i] = tr.data exec('rfsta.data{} = rfsta.data_prime'.format(rfsta.comp.lower())) return rfsta diff --git a/seispy/scripts.py b/seispy/scripts.py index 392d1e46..ceda931d 100644 --- a/seispy/scripts.py +++ b/seispy/scripts.py @@ -225,6 +225,8 @@ def plot_rt(): from seispy.plotRT import plotrt parser = argparse.ArgumentParser(description="Plot R(Q)&T components for P receiver functions (PRFs)") parser.add_argument('rfpath', help='Path to PRFs with a \'finallist.dat\' in it', type=str, default=None) + parser.add_argument('-c', help='prime component to plot, defaults to \'R\'', + default='R', type=str, metavar='[R|Q]') parser.add_argument('-e', help='Enlargement factor, defaults to 3', dest='enf', type=float, default=3, metavar='enf') parser.add_argument('-k', help='The key to sort PRFs, avialible for \'event\', \'evla\', \'evlo\', \'evdp\',' '\'dis\', \'bazi\', \'rayp\', \'mag\', \'f0\', defaults to \'bazi\'', metavar='key', @@ -236,7 +238,7 @@ def plot_rt(): arg = parser.parse_args() if arg.format not in ('f', 'g'): raise ValueError('Error: The format must be in \'f\' and \'g\'') - rfsta = RFStation(arg.rfpath) + rfsta = RFStation(arg.rfpath, prime_comp=arg.c) plotrt(rfsta, enf=arg.enf, out_path=arg.output, key=arg.k, outformat=arg.format, xlim=[-2, arg.x]) @@ -244,6 +246,8 @@ def plot_r(): from seispy.plotR import plotr parser = argparse.ArgumentParser(description="Plot R&T receiver functions") parser.add_argument('rfpath', help='Path to PRFs with a \'finallist.dat\' in it', type=str) + parser.add_argument('-c', help='prime component to plot, defaults to \'R\'', + default='R', type=str, metavar='[R|Q|L|Z]') parser.add_argument('-e', help='Enlargement factor, defaults to 6', dest='enf', type=float, default=6, metavar='enf') parser.add_argument('-k', help='The key to sort PRFs, avialible for \'event\', \'evla\', \'evlo\', \'evdp\',' '\'dis\', \'bazi\', \'rayp\', \'mag\', \'f0\', defaults to \'bazi\'', metavar='key', @@ -260,6 +264,6 @@ def plot_r(): fmt = 'png' elif arg.format == 'f': fmt = 'pdf' - rfsta = RFStation(arg.rfpath) + rfsta = RFStation(arg.rfpath, prime_comp=arg.c) rfsta.plotr(rfsta, arg.output, enf=arg.enf, key=arg.k, xlim=[-2, arg.x], format=fmt)