Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions getDataFRF.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def gettime(allEpoch, epochStart, epochEnd, indexRef=0):
finally:
return idx

def getnc(dataLoc, callingClass, epoch1=0, epoch2=0, dtRound=60, cutrange=100000,**kwargs):
def getnc(dataLoc, callingClass, epoch1=0, epoch2=0, dtRound=60, cutrange=100000, **kwargs):
"""Function grabs the netCDF file interested.

Responsible for drilling down to specific monthly file if applicable to speed things up.
Expand Down Expand Up @@ -95,6 +95,9 @@ def getnc(dataLoc, callingClass, epoch1=0, epoch2=0, dtRound=60, cutrange=100000
if callingClass == 'getDataTestBed': # overwrite pName if calling for model data
pName = u'cmtb'

if os.system("ping -c 1 " + THREDDSloc) ~= 0:
return ConnectionError(f"Not able to see {THREDDSloc))

# now set URL for netCDF file call,
if start is None and end is None:
ncfileURL = urljoin('[FillMismatch]'+THREDDSloc, pName, dataLoc)
Expand Down Expand Up @@ -245,7 +248,7 @@ def __init__(self, d1, d2, **kwargs):
self._comp_time()
assert type(self.d2) == DT.datetime, 'd1 need to be in python "Datetime" data types'
assert type(self.d1) == DT.datetime, 'd2 need to be in python "Datetime" data types'

def _comp_time(self):
"""Test if times are backwards."""
assert self.d2 >= self.d1, 'finish time: end needs to be after start time: start'
Expand Down