<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addmag(self, magval):
 """Add a scalar magnitude to existing flux values. .. math:: \\textnormal{flux}_{\\textnormal{new}} = 10^{-0.4 \\; \\textnormal{magval}} \\; \\textnormal{flux} Parameters magval : number Magnitude value. Returns ------- sp : `CompositeSourceSpectrum` New source spectrum with adjusted flux values. Raises ------ TypeError Magnitude value is not a scalar number. """

        if N.isscalar(magval):
            factor = 10**(-0.4*magval)
            return self*factor
        else:
            raise TypeError(".addmag() only takes a constant scalar argument")