# function for downloading and storing data into variables.defget_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*1000data.data-=data.data[0:10].mean()returndata
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
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;
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;