Data processing for GOLEM tokamak

(Copy paste examples)

Jupyter/Python3



Uloop
In [1]:
# Basic libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from urllib import request
In [2]:
# function for downloading and storing data into variables.
def get_data(shot,identifier,*argv):
    try:
        data = pd.read_csv(f'http://golem.fjfi.cvut.cz/shots/{shot}/DASs/StandardDAS/{identifier}.csv',
                          names = ['t','data'])
    except:    
        data.t = data.t*1000
        data.data -= data.data[0:10].mean()
    return data
In [3]:
shot_no = 34251
Uloop = get_data(shot_no,'LoopVoltageCoil_raw')
fig,ax = plt.subplots(1)
Uloop[['t', 'data']].plot(x='t',ax=ax)
# ax.plot(Uloop_vac.t,Uloop_vac.data)
ax.set_xlabel('t [ms]')
ax.set_ylabel(r'$U_\mathrm{loop}$ [V]')
ax.grid(True)
plt.savefig('Uloop') 



Gnuplot



Gnuplot: Data processing for GOLEM

Script

ShotNo=0
gnuplot -e  "set terminal jpeg;set datafile separator ',';set title 'Uloop';plot '< wget -q -O - http://golem.fjfi.cvut.cz/shots/"$ShotNo"/DASs/StandardDAS/LoopVoltageCoil_raw.csv' u 1:2 w l t 'Uloop'" >plot.jpg

Result




Octave



Octave: Data processing for GOLEM

Script

ShotNo=0;
baseURL='http://golem.fjfi.cvut.cz/shots/';
diagnPATH='/DASs/StandardDAS/LoopVoltageCoil_raw.csv';
%Create a path to data
dataURL=strcat(baseURL,int2str(ShotNo),diagnPATH); 
% Write data from GOLEM server to a local file
urlwrite(dataURL,'LoopVoltage');
% Load data
data = load('LoopVoltage', '\t'); 
% Plot and save the graph 
plot(data(:,1)*1000, data(:,2), '.') ;
xlabel('Time [ms]')
ylabel('U_l [V]')
saveas(gcf, 'plot', 'jpeg');
exit;

Result




Matlab



Matlab: Data processing for GOLEM

Script

ShotNo=0;
baseURL='http://golem.fjfi.cvut.cz/shots/';
diagnPATH='/DASs/StandardDAS/LoopVoltageCoil_raw.csv';
%Create a path to data
dataURL=strcat(baseURL,int2str(ShotNo),diagnPATH); 
% Write data from GOLEM server to a local file
urlwrite(dataURL,'LoopVoltage');
% Load data
data = load('LoopVoltage', '\t'); 
% Plot and save the graph 
f = figure('visible', 'off');
hold on
plot(data(:,1)*1000, data(:,2), '.') ;
xlabel('Time [ms]')
ylabel('U_l [V]')
hold off
print -djpeg plot.jpg
close(f)
exit;

Result