def sort(ref):
    from vista.set import Constants
    from vista.set import ElementFilterIterator
    dx=[]
    iter=ElementFilterIterator(ref.data.iterator, Constants.DEFAULT_FLAG_FILTER)
    while not iter.atEnd():
        dx.append(iter.element.y)
        iter.advance()
    dx.sort()
    return dx
Example #2
0
def sort(ref):
    from vista.set import Constants
    from vista.set import ElementFilterIterator
    dx=[]
    iter=ElementFilterIterator(ref.data.iterator, Constants.DEFAULT_FLAG_FILTER)
    while not iter.atEnd():
        dx.append(iter.element.y)
        iter.advance()
    dx.sort()
    return dx
Example #3
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)
Example #4
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)
Example #5
0
def sort(ref, end_of_sept=True, tw=None):
    from vista.set import Constants
    from vista.set import ElementFilterIterator
    if tw != None:
        data=ref.data.createSlice(tw)
    dx=[]
    iter=ElementFilterIterator(data.iterator, Constants.DEFAULT_FLAG_FILTER)
    while not iter.atEnd():
        if (end_of_sept) :
            if (iter.element.XString.find('30SEP')>=0):
                dx.append(iter.element.y)
        else:
            dx.append(iter.element.y)
        iter.advance()
    dx.sort()
    return dx
Example #6
0
def sort(ref, end_of_sept=True, tw=None):
    from vista.set import Constants
    from vista.set import ElementFilterIterator
    if tw != None:
        data=ref.data.createSlice(tw)
    dx=[]
    iter=ElementFilterIterator(data.iterator, Constants.DEFAULT_FLAG_FILTER)
    while not iter.atEnd():
        if (end_of_sept) :
            if (iter.element.XString.find('30SEP')>=0):
                dx.append(iter.element.y)
        else:
            dx.append(iter.element.y)
        iter.advance()
    dx.sort()
    return dx
Example #7
0
# the x value: element.getX()
# the y value: element.getY()
# the flag (if available else = 0): element.getFlag()
element = missing_iterator.getElement()
print element.getX(), element.getY(), element.getFlag()
# 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
Example #8
0
# the x value: element.getX()
# the y value: element.getY()
# the flag (if available else = 0): element.getFlag()
element = missing_iterator.getElement()
print element.getX(), element.getY(), element.getFlag()
# 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