Miscellaneous classes and functions#
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Miscellaneous, quite general objects used by the SED fitting classes.
- class pixSED.misc.misc.NamedColumn(name: str, unit: str, end: str = '', log=False)[source]#
Bases:
object
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
A general named column to assicate to an Enum object.
Arguments
- Parameters:
name (
str
) – name of the column when included in a Tableunit (
str
) – unit of the column
Keyword arguments
- Parameters:
end (
str
) – end string to append to the associate enum namelog (
bool
) – whether this column holds log values. This will trigger a conversion to the power of 10 ifTrue
.
- Raises:
TypeError – if name, unit and end are not of type
str
- class pixSED.misc.misc.PhysicalLogQuantity(value: Any, *args, unit: str = '', **kwargs)[source]#
Bases:
object
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Implement an Astropy Quantity which can have log of physical values.
Arguments
- Parameters:
value – value to pass to the constructor
Keyword arguments
- Parameters:
unit (
str
) – data unit
- __str__(*args, **kwargs) str [source]#
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Slightly modified string representation.
- toPhysical(*args, **kwargs) Quantity [source]#
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Go to physical unit by raising to the power of 10 and converting to the right unit.
- exception pixSED.misc.misc.ShapeError(arr1: ndarray, arr2: ndarray, msg: str = '', **kwargs)[source]#
Bases:
Exception
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Error which is caught when two arrays do not share the same shape.
- pixSED.misc.misc.check_type(dtype)[source]#
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
A decorator which check data type of the first mandatory parameter of the function.
- Parameters:
dtype – type the parameter must have
- Raises:
TypeError – if data has the wrong type.
ValueError – if there is no data to check the type
- pixSED.misc.misc.check_type_in_list(dtype)[source]#
Code author: Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
A decorator which check data type of the first mandatory parameter of the function.
- Parameters:
dtype – type the parameter must have
- Raises:
TypeError – if data has the wrong type.
ValueError – if there is no data to check the type