Esempio n. 1
0
    def _plot(self,
              S_list,
              ax=None,
              unmasked=True,
              sepmode='lines',
              legend_loc='upper right',
              **kw):
        S = S_list[0]
        if ax is None:
            fig = get_tfig(xlab=S.xlab, viewers=self.viewers, **kw)
            ax = fig.axes[0]
        ax.set_ylabel(S.ylab)

        if unmasked:
            for S in S_list:
                S.unmasked().plot(ax)
        else:
            for S in S_list:
                S.plot(ax)

        if sepmode is not None:
            self.plot_separatrix_crossings([ax], sepmode=sepmode, color='k')
        if legend_loc is not None:
            ax.legend(loc=legend_loc)
        return ax
Esempio n. 2
0
    def figure(self,
               fig=None,
               shape=(5, 1),
               figsize=(6, 6),
               CEZ_viewer=False,
               MIR_viewer=False,
               **kw):
        self.viewers = self.eqi.viewers[:]
        if CEZ_viewer:
            S = self.S['CEZ']
            y, x = S['vrot'][:, :24] * 1e-3, S['R'].x[:24]
            viewer_kw = dict(xlab='R (m)', ylab=r'vrot (km s$^{\text{-1}}$)')
            CEZ_viewer = ProfViewerAUG(x,
                                       y,
                                       menu_entry='CEZ viewer',
                                       **viewer_kw)
            self.viewers.append(CEZ_viewer)

        if MIR_viewer:
            MIR_viewer = MIRViewerAUG(self.S['MIR'])
            self.viewers.append(MIR_viewer)

        fig = get_tfig(fig,
                       pos=(450, 150),
                       shape=shape,
                       figsize=figsize,
                       xlab='t (s)',
                       viewers=self.viewers,
                       **kw)
        fig.axes[0].set_xlim((1, 7))
        return fig
Esempio n. 3
0
 def viewer(self, event):
     fig = get_tfig(figsize=(6, 5), xlab="V (V)")
     self.ax = fig.axes[0]
     self.ax.set_ylabel("I (A)")
     self.ax.set_xlim(self.IV.plot_range_V())
     self.ax.set_ylim(self.IV.plot_range_I())
     self.colors = ('b', 'g', 'r', 'c', 'm')
Esempio n. 4
0
 def viewer(self, event=None, **kw):
     kw2 = self.kw.copy()
     kw2.update(kw)
     fig = get_tfig(pos=(950, 150), figsize=(5, 5), **kw2)
     self.ax = ax = fig.axes[0]
     ax.set_xlim((1.5, 2.5))
     ax.set_ylim((-50, 100))
     return ax
Esempio n. 5
0
    def plot(self,
             fig=None,
             keys=None,
             xkey='t',
             plunge=None,
             inout=None,
             mirror=False,
             figsize=(10, 10),
             usetex=False,
             **kw):
        y = self.eval(plunge, inout)

        x = self.fact[xkey] * self.clip(y[xkey], self.lim[xkey])
        if mirror:
            x = -x
        xlab = self.make_label(xkey, usetex)

        label = "%d" % self.shn
        tM = self.R.tM(plunge)
        if len(tM) == 1:
            label += ".%d" % (1e3 * tM[0])
        if inout == 'out':
            label += " (out)"

        if keys is None:
            keys = (('Dt', 'R'), ('n', 'Mach'), ('Vf', 'mnv'), ('Te', 'pe'),
                    ('Vp', 'pe_tot'))
        keys = np.array(keys, ndmin=2)

        if xkey == 't':
            viewers = self.probe.viewers
        else:
            viewers = ()

        fig = get_tfig(fig,
                       keys.shape,
                       xlab=xlab,
                       figsize=figsize,
                       usetex=usetex,
                       viewers=viewers)

        for key, ax in zip(keys.ravel(), fig.axes):
            self.plot_key(key, x, y, ax=ax, label=label)

        self.probe.plot_separatrix_crossings(fig.axes,
                                             xkey=xkey,
                                             fact=self.fact[xkey],
                                             plunge=plunge,
                                             inout=inout,
                                             **kw)

        fig.axes[0].legend(loc='upper left')
        fig.canvas.draw()
        return fig
Esempio n. 6
0
    def viewer(self, event=None, **kw):
        self.refine = kw.pop('refine', 1)
        self.flv = FieldLineViewer(self.eqi)
        self.flv_vtk = FieldLineViewerVtk(self.eqi)

        fig = get_tfig(viewers=[self.flv, self.flv_vtk], **kw)
        self.ax = ax = fig.axes[0]
        try:
            self.eqi.vessel.plot(ax)
        except AttributeError:
            pass
        return ax
Esempio n. 7
0
    def plot_raw(self, ID='IV', fig=None):
        if fig is None:
            self.viewers = [IVViewer(self, ID=ID), IVViewerIt(self, ID=ID)]

            fig = get_tfig(shape=(len(self.x), 1),
                           figsize=(10, 10),
                           xlab=self.x.values()[0].S.xlab,
                           ylab=[x.S.ylab for x in self],
                           viewers=self.viewers)

        for ax, x in zip(fig.axes, self.x.values()):
            x.plot_raw(ax=ax, ID=ID)
        return fig
Esempio n. 8
0
    def plot(self, ID='IV', fig=None, **kw):
        if fig is None:
            self.viewers = [IVViewer(self, ID=ID), IVViewerIt(self, ID=ID)]

            fig = get_tfig(shape=(3, 1),
                           figsize=(10, 10),
                           viewers=self.viewers,
                           xlab='t (s)',
                           ylab=('Isat (A)', 'Vf (V)', 'Te (eV)'))

        for ax, p in zip(fig.axes, self.PP[ID]):
            p.plot(ax=ax, **kw)
        return fig
Esempio n. 9
0
    def specgram(self, **kw):
        S_list = [
            self.XPR['tip1+tip2'], self['MAC']['Ipolsoli'],
            self['MIR']['C09-23'], self['XVS']['S2L1A10']
        ]

        fig = get_tfig(shape=(6, 1), figsize=(6, 9), xlab='t (s)')
        self.plot_density(ax=fig.axes[0])
        self.plot_XPR_I_Mach(ax=fig.axes[1])

        for ax, S in zip(fig.axes[2:], S_list):
            S.specgram(ax=ax, **kw)
            ax.set_ylabel('%s f (kHz)' % S.name)
        return fig
Esempio n. 10
0
    def plot_raw(self, ID='IV', ax=None):
        if ax is None:
            self.viewers = [
                IVViewer(self, ID=ID),
                IVViewerIt(self, ID=ID),
                IVViewerItIntegrated(self, ID=ID)
            ]

            fig = get_tfig(xlab=self.S.xlab,
                           ylab=self.S.ylab,
                           viewers=self.viewers)
            ax = fig.axes[0]

        self.S.plot(ax=ax)
        self.get_Sfit(ID=ID).plot(ax=ax)
        return ax
Esempio n. 11
0
 def viewer(self, event=None, **kw):
     fig = get_tfig(pos=(950, 150), figsize=(5, 5), xlab="Number", **kw)
     self.ax = ax = fig.axes[0]
     ax.set_xlim((0, 33))
     ax.set_ylim((-2, 2))
     return ax