diff --git a/docs/source/configuration/common.rst b/docs/source/configuration/common.rst index a99156c..3548000 100644 --- a/docs/source/configuration/common.rst +++ b/docs/source/configuration/common.rst @@ -12,7 +12,7 @@ Attributes: * | **val:** float | The value of the minimal wavelength. * | **val_unit:** str, *optional* = "m" - | The unit of the minimal wavelength. This has to be one of [``m``, ``cm``, ``mm``, ``um``, ``nm``, ``pm``]. The default is ``m``. + | The unit of the minimal wavelength. This has to be one of [``m``, ``cm``, ``mm``, ``um``, ``nm``, ``pm``, ``Hz``, ``kHZ``, ``MHz``, ``GHz``, ``THz``]. The default is ``m``. wl_max ------ @@ -26,7 +26,7 @@ Attributes: * | **val:** float | The value of the maximal wavelength. * | **val_unit:** str, *optional* = "m" - | The unit of the maximal wavelength. This has to be one of [``m``, ``cm``, ``mm``, ``um``, ``nm``, ``pm``]. The default is ``m``. + | The unit of the maximal wavelength. This has to be one of [``m``, ``cm``, ``mm``, ``um``, ``nm``, ``pm``, ``Hz``, ``kHZ``, ``MHz``, ``GHz``, ``THz``]. The default is ``m``. .. _wl_delta: @@ -42,7 +42,7 @@ Attributes: * | **val:** float | The value of the wavelength grid size. * | **val_unit:** str, *optional* = "m" - | The unit of the wavelength grid size. This has to be one of [``m``, ``cm``, ``mm``, ``um``, ``nm``, ``pm``]. The default is ``m``. + | The unit of the wavelength grid size. This has to be one of [``m``, ``cm``, ``mm``, ``um``, ``nm``, ``pm``, ``Hz``, ``kHZ``, ``MHz``, ``GHz``, ``THz``]. The default is ``m``. .. _res: diff --git a/docs/source/configuration/sensor.rst b/docs/source/configuration/sensor.rst index e498564..0252a9a 100644 --- a/docs/source/configuration/sensor.rst +++ b/docs/source/configuration/sensor.rst @@ -310,7 +310,7 @@ Attributes: * | **val:** float | The wavelength of the observed line. * | **val_unit:** str, *optional* = "m" - | The unit of the observed line wavelength. This has to be on of [``nm``, ``um``, ``mm``, ``cm``, ``m``]. + | The unit of the observed line wavelength. This has to be on of [``nm``, ``um``, ``mm``, ``cm``, ``m``, ``Hz``, ``kHZ``, ``MHz``, ``GHz``, ``THz``]. kappa ^^^^^ diff --git a/esbo_etc/classes/Entry.py b/esbo_etc/classes/Entry.py index f14673f..339043a 100644 --- a/esbo_etc/classes/Entry.py +++ b/esbo_etc/classes/Entry.py @@ -83,7 +83,11 @@ class Entry(object): return "Expected parameter '" + name + "' with unit '" + unit.to_string() + "' but got no unit." if not attr.unit.is_equivalent(unit): if unit == u.K and attr.unit == u.Celsius: - setattr(self, name, attr.to(u.K, equivalencies=u.temperature())) + setattr(self, name, attr.to(unit, equivalencies=u.temperature())) + setattr(self, name + '_unit', unit.to_string()) + elif unit.is_equivalent(u.m) and attr.unit.is_equivalent(u.Hz): + setattr(self, name, attr.to(unit, equivalencies=u.spectral())) + setattr(self, name + '_unit', unit.to_string()) else: return "Expected parameter '" + name + "' with unit equivalent to '" + unit.to_string() + \ "' but got unit '" + attr.unit.to_string() + "'."