diff --git a/docs/source/developer/images/SpectralQty.pdf b/docs/source/developer/images/SpectralQty.pdf index 45b9b66..89a6419 100644 Binary files a/docs/source/developer/images/SpectralQty.pdf and b/docs/source/developer/images/SpectralQty.pdf differ diff --git a/esbo_etc/classes/SpectralQty.py b/esbo_etc/classes/SpectralQty.py index 698bd7b..bc0549e 100644 --- a/esbo_etc/classes/SpectralQty.py +++ b/esbo_etc/classes/SpectralQty.py @@ -182,7 +182,7 @@ class SpectralQty: Returns ------- - sum : SpectralQty + diff : SpectralQty The difference of both objects """ # Subtrahend is of type int or float, use same unit @@ -228,7 +228,7 @@ class SpectralQty: Returns ------- - sum : SpectralQty + prod : SpectralQty The product of both objects """ # Factor is of type int, float or Quantity, just multiply @@ -270,7 +270,7 @@ class SpectralQty: Returns ------- - sum : SpectralQty + quot : SpectralQty The quotient of both objects """ # Factor is of type int, float or Quantity, just multiply @@ -297,6 +297,24 @@ class SpectralQty: else: logger.error("Units are not matching for division.") + def __pow__(self, other: Union[int, float]) -> "SpectralQty": + """ + Raise to spectral quantity to the given power. + + Parameters + ---------- + other : Union[int, float] + The exponent for this object. + + Returns + ------- + prod : SpectralQty + The spectral quantity raised to the given power. + """ + # Factor is of type int, float or Quantity, just multiply + if isinstance(other, int) or isinstance(other, float): + return SpectralQty(self.wl, self.qty ** other) + def rebin(self, wl: u.Quantity) -> "SpectralQty": """ Resample the spectral quantity sqty(wl) over the new grid wl, rebinning if necessary, otherwise interpolates.