Пример #1
0
def aprint(a,decimals=2):
    """prints array / masked array of floats"""
    if isinstance(a, Numeric.ArrayType):
        print Numeric.around(a.astype(Numeric.Float0),decimals)
    elif type(a) == MA.MaskedArray:
        print MA.around(a.astype(Numeric.Float0),decimals)
Пример #2
0
 def function(self,p):
     """
     Return a square-wave grating (alternating black and white bars).
     """
     return around(0.5 + 0.5*sin(p.frequency*2*pi*self.pattern_y + p.phase))