def convert_y(self,newUnit): """converts the y axis of the array (changes the numerical values) into the newUnit if compatible""" if self.unit_y is Unit.dBm: if Unit.isUnit(newUnit,Unit.W): self.setXY(self.X,10**(self.Y/10)*0.001) self.set_unit_y(newUnit) return else: raise IncompatibleUnitsError(Unit.dBm,newUnit) fact = Unit.inUnit(self.unit_y,newUnit) self.Y = self.Y*fact self.unit_y = newUnit
def convert_y(self, newUnit): """converts the y axis of the array (changes the numerical values) into the newUnit if compatible""" if self.unit_y is Unit.dBm: if Unit.isUnit(newUnit, Unit.W): self.setXY(self.X, 10**(self.Y / 10) * 0.001) self.set_unit_y(newUnit) return else: raise IncompatibleUnitsError(Unit.dBm, newUnit) fact = Unit.inUnit(self.unit_y, newUnit) self.Y = self.Y * fact self.unit_y = newUnit
def convert_x(self,newUnit): """converts the x axis of the array (changes the numerical values) into the newUnit if compatible""" fact = Unit.inUnit(self.unit_x,newUnit) self.X = self.X*fact self.unit_x = newUnit
def convert_x(self, newUnit): """converts the x axis of the array (changes the numerical values) into the newUnit if compatible""" fact = Unit.inUnit(self.unit_x, newUnit) self.X = self.X * fact self.unit_x = newUnit