Try to convert frequencies to wavelength
All checks were successful
esbo_ds/ESBO-ETC/pipeline/head This commit looks good
All checks were successful
esbo_ds/ESBO-ETC/pipeline/head This commit looks good
This commit is contained in:
parent
04a58d3684
commit
3c55434c71
@ -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:
|
||||
|
||||
|
@ -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
|
||||
^^^^^
|
||||
|
@ -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() + "'."
|
||||
|
Loading…
Reference in New Issue
Block a user