Ejemplo n.º 1
0
dev_name = 'W7X'
dev = pyfusion.getDevice(dev_name)
shot = da['info']['shotdata']['shot'][0]
chan = da['info']['channels'][0]
echdata = dev.acq.getdata(shot,'W7X_TotECH')
wech = np.where(echdata.signal > 100)[0]
tech = echdata.timebase[wech[0]]
t0_utc = int(tech * 1e9) + echdata.utc[0]
dtprobe = (da['info']['params']['i_diag_utc'][0] - t0_utc)/1e9
tslice = da['t_mid'][s-step//2] + dtprobe
dtaverage = da['t_mid'][s] - da['t_mid'][s-step]
dtstr = '{dt:.2f}s avg'.format(dt=dtaverage)
# axu.set_title('{fn}, time={t:.4f} {dt}'.format(fn=da.name, t=tslice, dt=dtstr))
tit = axu.get_title()
cfg, cfg_dict = get_mag_config(shot)
if cfg is None:
    ind = ''
else:
    ind = 13 - 12*cfg[2]/.3904
    if abs(ind - round(ind)) < .03:
        ind = int(round((ind)))
    ind = 'Ind {ind}'.format(ind=ind)

axu.set_title(tit+'\nProgram Id {s}, time={t:.4f} {ind}'# {dt}'
              .format(s=shot, fn=da.name, t=tslice, dt=dtstr, ind=ind))

if cfg_dict is not None:
    plot_trim(axu, mag_dict=cfg_dict, color='g', aspect=1.2)

if time_strip_h > 0:
Ejemplo n.º 2
0
                          tr=t_range, sh=shot_number))
            fitsigs.append(fitsig1)

        sold, td, sig2, ebar2 = LCFS_plot(da, diag2, nrm=nrm, ax=axLCne, Tesmooth=fitsig1, **kwargs)
        sigs.append(sig2)
        tds.append(td)
        solds.append(sold)
        for fp in fp_list:
            fp.write(', Integral =  {intg:.1f}\n'.format(intg=integrate(sig2, td)))

        # if diag1 in fits: params = fitgauss(sold, sig1, ebar1, ax=axLCne)

        maxTe = max(maxTe, np.nanmax(sig1))
        maxne = max(maxne, np.nanmax(sig2))
        #1/0
    cfg, cfg_dict = get_mag_config(shot_number)
    if cfg_dict is not None:
        plot_trim(axLCTe, mag_dict=cfg_dict, aspect=2.6, size=0.06, color='g')
        ind = 13 - 12*cfg[2]/.3904
        if abs(ind - round(ind)) < .03:
            ind = int(round((ind)))
        ind = 'Ind {ind}'.format(ind=ind)
    else:
        ind = ''

    tb = 'LP t_mid' if use_t_mid else 'into ECH'
    figLCFS.subplots_adjust(hspace=0, right=0.87)
    # figLCFS.suptitle('shot {s}, {avname} over time {fr}-{t}s {tb}: {ind}' 
    title = str('shot {s}, {avname} filter over time {fr}-{t}s {tb}: {ind}' 
                .format(s=[da['date'][0], da['progId'][0]],
                        fr=t_range[0],t=t_range[1], tb=tb,
Ejemplo n.º 3
0
dev_name = 'W7X'
dev = pyfusion.getDevice(dev_name)
shot = da['info']['shotdata']['shot'][0]
chan = da['info']['channels'][0]
echdata = dev.acq.getdata(shot, 'W7X_TotECH')
wech = np.where(echdata.signal > 100)[0]
tech = echdata.timebase[wech[0]]
t0_utc = int(tech * 1e9) + echdata.utc[0]
dtprobe = (da['info']['params']['i_diag_utc'][0] - t0_utc) / 1e9
tslice = da['t_mid'][s - step // 2] + dtprobe
dtaverage = da['t_mid'][s] - da['t_mid'][s - step]
dtstr = '{dt:.2f}s avg'.format(dt=dtaverage)
# axu.set_title('{fn}, time={t:.4f} {dt}'.format(fn=da.name, t=tslice, dt=dtstr))
tit = axu.get_title()
cfg, cfg_dict = get_mag_config(shot)
if cfg is None:
    ind = ''
else:
    ind = 13 - 12 * cfg[2] / .3904
    if abs(ind - round(ind)) < .03:
        ind = int(round((ind)))
    ind = 'Ind {ind}'.format(ind=ind)

axu.set_title(tit + '\nProgram Id {s}, time={t:.4f} {ind}'  # {dt}'
              .format(s=shot, fn=da.name, t=tslice, dt=dtstr, ind=ind))

if cfg_dict is not None:
    plot_trim(axu, mag_dict=cfg_dict, color='g', aspect=1.2)

if time_strip_h > 0: