from numpy import *
from matplotlib.pyplot import *
from scipy.optimize import leastsq
import time, datetime, re
from scipy.sparse import spdiags, eye
from scipy.sparse.linalg import spsolve, splu
from scipy.signal import medfilt, fftconvolve, convolve
from scipy.stats.mstats import mquantiles
from scipy.constants import pi,mu_0,k,eV
#from urllib import urlopen #python 2.7
from urllib.request import urlopen #python 3.0
ShotNo = 31733
#Create a path to data
#baseURL = "http://golem.fjfi.cvut.cz/utils/data/" #remote access
baseURL = "file:///golem/database/operation/shots/" #local access
#dataURL = urlopen(baseURL+ str(ShotNo) + '/' + diagnSPEC + '.npz')
dataURL = urlopen(baseURL+ str(ShotNo) + '/DASs/TektrMSO56Standard/LoopVoltageCoil_raw'+'.csv')
DataFile = np.loadtxt(dataURL,skiprows=9, delimiter=",")
tvec=DataFile[:,0]
Uloop=DataFile[:,1]
plot(tvec,Uloop);show();clf();