diff --git a/murgtools/getdata/getDataFRF.py b/murgtools/getdata/getDataFRF.py index ed7ee1b..e13ee58 100755 --- a/murgtools/getdata/getDataFRF.py +++ b/murgtools/getdata/getDataFRF.py @@ -683,9 +683,9 @@ def getWind(self, gaugenumber=0, collectionlength=10): valid_gauges = [0, 1, 2, 3, 'derived', 'Derived'] raise InvalidGaugeError(gaugenumber, valid_gauges=valid_gauges) - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=collectionlength * 60, start=self.d1, end=self.d2, - server=self.server) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=collectionlength * 60, start=self.d1, end=self.d2, + server=self.server) self.winddataindex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) @@ -848,8 +848,8 @@ def getGaugeWL(self, gaugenumber=5, roundto=1): self._wlGageURLlookup(gaugenumber) # parsing out data of interest in time - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=roundto * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=roundto * 60) try: self.wldataindex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, @@ -938,19 +938,11 @@ def getBathyTransectFromNC(self, profilenumbers=None, method=1, forceReturnAll=F # acceptableProfileNumbers = [None, ] self.dataloc = 'geomorphology/elevationTransects/survey/surveyTransects.ncml' # location # of the gridded surveys - dataReturns = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, server=self.server, + self.ncfile, self.allEpoch, indexRef = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, server=self.server, dtRound=1 * 60, epoch1=self.epochd1, epoch2=self.epochd2) - if len(dataReturns) == 2: - self.ncfile = dataReturns[0] - self.allEpoch = dataReturns[1] - indexRef=0 - elif len(dataReturns) == 3: - self.ncfile = dataReturns[0] - self.allEpoch = dataReturns[1] - indexRef = dataReturns[2] try: self.bathydataindex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, - epochEnd=self.epochd2, indexRef=indexRef[0]) + epochEnd=self.epochd2, indexRef=indexRef[0] if indexRef is not None else 0) except IOError: # when data are not on CHL thredds self.bathydataindex = None # returning None object is convention and must be followed/handled down the line @@ -1078,8 +1070,8 @@ def getBathyTransectProfNum(self, method=1): # acceptableProfileNumbers = [None, ] self.dataloc = 'geomorphology/elevationTransects/survey/surveyTransects.ncml' # location # of the gridded surveys - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=1 * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=1 * 60) try: self.bathydataindex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, @@ -1695,8 +1687,8 @@ def getLidarRunup(self, removeMasked=True): """ self.dataloc = 'oceanography/waves/lidarWaveRunup/lidarWaveRunup.ncml' - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=1 * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=1 * 60) self.lidarIndex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) @@ -1904,8 +1896,8 @@ def getALT(self, gaugeName=None, removeMasked=True): else: raise NotImplementedError('Please use one of the following keys\n'.format(gauge_list)) - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=1 * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=1 * 60) altdataindex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) @@ -2014,8 +2006,8 @@ def getLidarWaveProf(self, removeMasked=True): """ self.dataloc = 'oceanography/waves/lidarHydrodynamics/lidarHydrodynamics.ncml' - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=1 * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=1 * 60) self.lidarIndex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) if np.size(self.lidarIndex) > 0 and self.lidarIndex is not None: @@ -2249,8 +2241,8 @@ def getBathyGridcBathy(self, **kwargs): fillValue = -999 # assumed fill value from the rest of the files taken as less than or # equal to self.dataloc = 'projects/bathyduck/data/cbathy_old/cbathy.ncml' - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=30 * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=30 * 60) self.cbidx = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) self.cbtime = nc.num2date(self.allEpoch[self.cbidx], 'seconds since 1970-01-01', @@ -2373,8 +2365,8 @@ def getArgus(self, type, **kwargs): self.dataloc = "projects/bathyduck/data/argus/timex/timex.ncml" ################ go get data index - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=1 * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=1 * 60) self.idxArgus = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) @@ -2571,8 +2563,8 @@ def getGridCMS(self, method): """ self.dataloc = 'grids/CMSwave_v1/CMSwave_v1.ncml' - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, - dtRound=1 * 60) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, + dtRound=1 * 60) try: self.bathydataindex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) # getting the index of the grid @@ -3221,7 +3213,7 @@ def getWaveSpecModel(self, prefix, gaugenumber, model='STWAVE', removeBadWLFlag= # parsing out data of interest in time self.dataloc = urlFront + '/' + fname - self.ncfile, self.allEpoch = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, dtRound=1 * 60,server=self.server) + self.ncfile, self.allEpoch, _ = getnc(dataLoc=self.dataloc, callingClass=self.callingClass, dtRound=1 * 60,server=self.server) try: # go get indices of interest self.wavedataindex = gettime(allEpoch=self.allEpoch, epochStart=self.epochd1, @@ -3310,7 +3302,7 @@ def getCSHOREOutput(self, prefix): """ dataLoc = 'morphModels/CSHORE/{0}/{0}.ncml'.format(prefix) - ncfile, allEpoch = getnc(dataLoc, self.THREDDS, self.callingClass) + ncfile, allEpoch, _ = getnc(dataLoc, self.THREDDS, self.callingClass) dataIndex = gettime(allEpoch, epochStart=self.epochd1, epochEnd=self.epochd2) if dataIndex is None: print(('There\'s no data in time period ' + self.start.strftime('%Y-%m-%dT%H%M%SZ') +