Commit 9f2d7018 authored by mickael's avatar mickael

update for new Buoy Service

parent dd71aec1
......@@ -109,7 +109,9 @@ def findBuoyElement( id, mydatetime, provider ='cdip_globwave_wave',intervaldays
#return index,filepath
def returnBuoyElement( buoyFile, indexSpectrum, provider ='cdip_globwave_wave'):
return SpectrumReader.read_spectrum(buoyFile,provider_to_type[provider],indexSpectrum)
if provider in provider_to_type.keys():
provider=provider_to_type[provider]
return SpectrumReader.read_spectrum(buoyFile,provider,indexSpectrum)
#Find all Element in fileSystem between startDate and endDate
......@@ -151,7 +153,7 @@ def findBuoyElementListFromFiles( id, startDate,endDate=None, provider ='cdip_gl
if returnSpectra:
listSpectra.append(SpectrumReader.read_spectrum(buoyFile,provider_to_type[provider],startIndex))
else:
listSpectra.append([buoyFile,provider_to_type[provider],startIndex])
listSpectra.append([buoyFile,provider,startIndex])
cpt+=1
#If limit exceed return list
if cpt>limit:
......
......@@ -72,7 +72,7 @@ class SpectrumReaderBuoyGlobwave(AbstractSpectrumReader):
@staticmethod
def read_spec_data_globwave(ncf,index,mode='buoyglobwavendbc',phi = np.arange(0,365,10),con='to'):
time = nc.num2date( ncf.variables['time'][:], ncf.variables['time'].units )
time = time[index]
time = time[int(index)]
c1 = ncf.variables['theta1'][index,:] # theta1
c2 = ncf.variables['theta2'][index,:] # theta2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment