def __init__(self): Observable.__init__(self) self.name = "" self.attackStrength = 0 self.healthPoints = 0 self.vulnerability = [] self.weakness = "None"
def Smooth(self, O): dn = filters.gaussian_filter(O.data,self.posres,self.order,mode='wrap') dn = np.ma.masked_array(dn, O.data.mask) olst = [dn, O.N, O.norm, O.lname, O.sname, O.units, O.colmap, O.axes, O.rotation, self.poshwhm] nobs = Observable(olst) self.Nyquist(nobs) # Keep bounds the same as simulation resolution, for consistency. nobs.bounds = O.bounds self.Writer.WriteObservable(nobs) return nobs
def SmoothPolarizationFraction(self, Q, U, I): pdata = np.sqrt(Q.data**2 + U.data**2)/I.data pdata = np.ma.masked_array(pdata, I.data.mask) p = Observable([pdata, Q.N, 'log', 'Polarization Fraction', '$p$', 'None', 'plasma', Q.axes, Q.rotation, Q.beam]) self.Nyquist(p) self.Writer.WriteObservable(p) return p
def notifyObservers(self): if not self.outer.isOpen and not self.alreadyClosed: self.setChanged() Observable.notifyObservers(self) self.alreadyClosed = 1
def __init__(self, outer): Observable.__init__(self) self.outer = outer self.alreadyClosed = 0
def __init__(self, outer): Observable.__init__(self) self.outer = outer self.alreadyOpen = 0
def notifyObservers(self): if not self.outer.isOpen and \ not self.alreadyClosed: self.setChanged() Observable.notifyObservers(self) self.alreadyClosed = 1
def notifyObservers(self): if self.outer.isOpen and \ not self.alreadyOpen: self.setChanged() Observable.notifyObservers(self) self.alreadyOpen = 1