def plot(self, ax=None): lut = self.get_C09() ax = get_axes(ax) for coil in lut.itervalues(): ax.plot(coil['R'], coil['z'], 'rs') return ax
def plot(self, ax=None, fun='get_xy', lines=None): x, y = getattr(self, fun)() sty = (dict(linewidth=1.5), ) ax = get_axes(ax) if lines is None: lines = [] Nl, Ny = len(lines), len(y) for li, yi in zip(lines, y): li.set_data(x, yi) li.set_visible(True) for li in lines[Ny:]: li.set_visible(False) if Nl > 0: color = lines[0].get_color() else: color = ax._get_lines.color_cycle.next() sty = (dict(), ) + sty for yi, styi in zip(y[Nl:], sty): li, = ax.plot(x, yi, color=color, **styi) lines.append(li) return lines
def plot_Tdiv(self, ax=None, **kw): S = self.S['MAC']['Tdiv'] ax = get_axes(ax) ax.set_ylabel('Temp (eV)') S.plot(ax) ax.legend() return ax
def plot_gas(self, ax=None, **kw): S = self.S['UVS'] ax = get_axes(ax) ax.set_ylabel(r'Gas (10$^{\text{21}}$ el s$^{\text{-1}}$)') (S['D_tot'] * 1e-21).t_between(0.5, 6.).plot(ax, label='D total') ax.legend() return ax
def plot_ipvl(self, ax=None, **kw): S = self.S['MAG'] ax = get_axes(ax) (S['Ipa'] * 1e-6).plot(ax, label='Ip (MA)') S['ULid12'].t_between(0.5, 6.).plot(ax, label='V loop (V)') ax.legend() return ax
def plot_rad(self, ax=None, **kw): S = self.S['BPD'] ax = get_axes(ax) ax.set_ylabel('Power (MW)') (S['Pradtot'] * 1e-6).t_lt(6.).plot(ax) ax.legend() return ax
def plot_Ipolsol(self, ax, **kw): S = self.S['MAC'] ax = get_axes(ax) ax.set_ylabel('Div. cur. (kA)') (S['Ipolsola'] * 1e-3).t_lt(6.).plot(ax, label='Outer') (S['Ipolsoli'] * 1e-3).t_lt(6.).plot(ax, label='Inner') ax.legend() return ax
def plot_Da(self, ax=None, **kw): S = self.S['POT'] ax = get_axes(ax) ax.set_ylabel('Photons (au)') S['ELMa-Han'].t_lt(6.).plot(ax, label='Da outer') S['ELMi-Han'].t_lt(6.).plot(ax, label='Da inner') ax.legend() return ax
def plot_key(self, key, x, y, ax=None, label=None): ax = get_axes(ax) ylab = self.make_label(key, ax.figure.usetex) ax.set_ylabel(ylab) yc = self.clip(y[key], self.lim[key]) ax.plot(x, self.fact[key] * yc, label=label)
def plot_n(self, ax=None, chn=('H-1_corr', 'H-4_corr', 'H-5_corr'), **kw): S = self.S['TOT'] ax = get_axes(ax) ax.set_ylabel(r'n (10$^{\text{19}}$ m$^{\text{-3}}$)') for c in chn: (S[c] * 1e-19).nonneg().plot(ax, **kw) ax.legend() return ax
def plot_density(self, ax=None, chn=('H-1', 'H-4', 'H-5'), **kw): S = self.DCN ax = get_axes(ax) ax.set_ylabel(r'$\int$n dl (10$^{\text{19}}$ m$^{\text{-2}}$)') for c in chn: (S[c] * 1e-19).plot(ax, **kw) ax.legend() return ax
def plot_power(self, ax=None, **kw): S = self.S ax = get_axes(ax) ax.set_ylabel('Power (MW)') (S['ECS']['PECRH'] * 1e-6).plot(ax, label="ECRH") (S['NIS']['PNI'] * 1e-6).plot(ax, label="NBI") (S['FPG']['Wmhd'] * 1e-5).plot(ax, label="WMHD (x10)") ax.legend() return ax
def plot_CER(self, ax=None, name='vrot', ylab=r'vrot (km s$^{\text{-1}}$)', **kw): S = self.S['CEZ'] ax = get_axes(ax) ax.set_ylabel(ylab) i = [0, 14, 23] R = S['R'].x[i] S = S[name][:, i] * 1e-3 S.plot(ax) ax.legend(['R = %.2f m' % x for x in R]) return ax
def plot(self, ax=None, facecolor=facecolor, edgecolor=edgecolor): from matplotlib.patches import Polygon ax = get_axes(ax) arrowprops = dict(edgecolor='none', facecolor=facecolor, shrink=0) ax.annotate('', xytext=self.arrow[0], xy=self.arrow[1], arrowprops=arrowprops) ax.add_patch( Polygon(self.antenna, facecolor=facecolor, edgecolor=edgecolor)) ax.annotate("V-band\nX-mode\nfixed ant.", xycoords='data', xy=(2.25, -0.35), fontsize=15, ha='left', va='bottom', color=facecolor, backgroundcolor='w') return ax
def plot(self, ax=None, unfilled=(4, 5), edgecolors='k', facecolors=(0.75, 0.75, 0.75)): from matplotlib.path import Path from matplotlib.collections import PathCollection ax = get_axes(ax, xlab="R (m)", ylab="z (m)") ax.set_aspect('equal') ax.set_xlim((0.5, 2.5)) ax.set_ylim((-1.5, 1.5)) paths = [Path(xy) for i, xy in enumerate(self.xy) if i not in unfilled] pc = PathCollection(paths, facecolors=facecolors, edgecolors=edgecolors) ax.add_collection(pc) paths = [Path(self.xy[i]) for i in unfilled] pc = PathCollection(paths, facecolors='none', edgecolors=edgecolors) ax.add_collection(pc) return ax
def plot_rays(self, ax=None, names=names, **kw): kw.setdefault('linewidth', 1) rays = self.get_rays(names) ax = get_axes(ax) return ax.plot(rays[:, :, 0].T, rays[:, :, 1].T, **kw)
def plot_head(self, ti, ax=None): ax = get_axes(ax) R, z = self.pos(ti, masked=True).x[0] self.head.plot(ax, R, z) return ax
def plot_AXUV(self, ax=None, **kw): S = self.S['XVS']['S2L1A10'] ax = get_axes(ax) S.plot(ax) ax.legend() return ax
def plot_mirn(self, ax=None, **kw): S = self.S['MIR']['C09-23'] ax = get_axes(ax) S.plot(ax) ax.legend() return ax
def plot(self, ax=None, **kw): ax = get_axes(ax) ax.plot(self.y[:, 0], self.y[:, 1], **kw) return ax
def plot(self, ax=None, **kw): kw.setdefault('edgecolors', 'r') ax = get_axes(ax) pc = self.as_path_collection(**kw) ax.add_collection(pc) return ax