Пример #1
0
def getLast25hours(ref):
 dsi = ref.getData().getIterator()
 esi = ElementFilterIterator(dsi, Constants.DEFAULT_FLAG_FILTER)
 while not esi.atEnd():
  esi.advance()
 esi.retreat()
 el = esi.getElement()
 endTime = TimeFactory.getInstance().createTime(el.getXString())
 tidalDay = TimeFactory.getInstance().createTimeInterval('25hours')
 startTime = endTime.create(endTime)
 startTime.incrementBy(tidalDay,-1)
 tw = TimeFactory.getInstance().createTimeWindow(startTime,endTime)
 return DataReference.create(ref,tw)
Пример #2
0
def getLast25hours(ref):
    dsi = ref.getData().getIterator()
    esi = ElementFilterIterator(dsi, Constants.DEFAULT_FLAG_FILTER)
    while not esi.atEnd():
        esi.advance()
    esi.retreat()
    el = esi.getElement()
    endTime = TimeFactory.getInstance().createTime(el.getXString())
    tidalDay = TimeFactory.getInstance().createTimeInterval('25hours')
    startTime = endTime.create(endTime)
    startTime.incrementBy(tidalDay, -1)
    tw = TimeFactory.getInstance().createTimeWindow(startTime, endTime)
    return DataReference.create(ref, tw)
Пример #3
0
# get the 30th good value
missing_iterator.positionAtIndex(29)
element = missing_iterator.getElement()
print element.getX(), element.getY(), element.getFlag()
# a loop to loop over all the values till it 
# reaches the end
# we get the element and advance, then check if are at end
# if not we continue doing so till we hit the end
while not missing_iterator.atEnd():
	element = missing_iterator.getElement();
	missing_iterator.advance()
#
# lets step through back, always retreat then get element then check
# 
while not missing_iterator.atStart():
	missing_iterator.retreat()
	element = missing_iterator.getElement()
#
# to rewind quickly
missing_iterator.resetIterator();
#
# Lets now do the flags
#
# each flag filter is predefined in FlagUtils class
questionable_filter = FlagUtils.QUESTIONABLE_FILTER
reject_filter = FlagUtils.REJECT_FILTER

# to make our job easier there is a composite filter called
# CompositeFilter. It accepts an array of ElementFilter's
# and its isAcceptable method returns true only when all the
# contained element filters consider the element acceptable
Пример #4
0
# get the 30th good value
missing_iterator.positionAtIndex(29)
element = missing_iterator.getElement()
print element.getX(), element.getY(), element.getFlag()
# a loop to loop over all the values till it
# reaches the end
# we get the element and advance, then check if are at end
# if not we continue doing so till we hit the end
while not missing_iterator.atEnd():
    element = missing_iterator.getElement()
    missing_iterator.advance()
#
# lets step through back, always retreat then get element then check
#
while not missing_iterator.atStart():
    missing_iterator.retreat()
    element = missing_iterator.getElement()
#
# to rewind quickly
missing_iterator.resetIterator()
#
# Lets now do the flags
#
# each flag filter is predefined in FlagUtils class
questionable_filter = FlagUtils.QUESTIONABLE_FILTER
reject_filter = FlagUtils.REJECT_FILTER

# to make our job easier there is a composite filter called
# CompositeFilter. It accepts an array of ElementFilter's
# and its isAcceptable method returns true only when all the
# contained element filters consider the element acceptable