SED fitting code output classes#
Code author: Hugo Plombat - LUPM <hugo.plombat@umontpellier.fr> & Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>
Classes used by the sed objects to generate objects loading output tables and producing resolved maps.
- class pixSED.outputs.CigaleOutput(file: str, *args, **kwargs)[source]#
Bases:
Output
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Init the output class.
- Parameters:
file (
str
) – name of the SED fitting outut file
- _getUnits(hdr: Header, *args, **kwargs) Dict[str, str] [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Get and return the units from a Cigale output fits file header and map them to their column names.
- Parameters:
hdr (Astropy Header) – header to read the units from
- Returns:
mapping between column names and units
- Return type:
dict[str, str]
- link(filterList: FilterList, *args, **kwargs) None [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Provide the default image properties from a FilterList object.
- Parameters:
filterList (FilterList) – FilterList object from which the image properties are retrieved
- Raises:
TypeError – if filterList is not of type
FilterList
- toImage(name: str, shape: Optional[Tuple[int]] = None, **kwargs) Quantity [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Generate an image from the Astropy Table given column name.
- Parameters:
name (
str
) – name of the column to generate the image fromshape (
tuple[int]
) – (Optional) shape of the output image. The shape must be such thatshape[0]*shape[1] == len(self.table)
. IfNone
, the default value provided in thelink()
method is used.
- Returns:
output image as an Astropy Quantity. Use .data method to only get the array.
- Return type:
- Raises:
TypeError –
if name is not of type
str
if shape is neither a
tuple
nor alist
ValueError – if shape is not of length 2
- units#
Mapping between column names and units
- class pixSED.outputs.LePhareOutput(file: str, *args, **kwargs)[source]#
Bases:
Output
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Implement an output class for LePhare.
- Parameters:
file (
str
) – name of the SED fitting outut file
- load(*args, **kwargs) Table [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Load data from LePhare output file.
- Returns:
the astropy table
- Return type:
- readHeader(*args, **kwargs) Dict[str, str] [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Read the header of LePhare output file.
- Returns:
dict mapping between column names and column number
- Return type:
dict[str, str]
- toImage(name: str, shape: Optional[Tuple[int]] = None, scaleFactor: Optional[Union[int, float]] = None, meanMap: Optional[ndarray] = None, **kwargs) Quantity [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Generate an image from the Astropy Table given column name.
Note
Depending on the type of output quantity one wants to generate an image from, scaleFactor can have different values:
if the output quantity is extensive, then this is the same scaleFactor which was used to scale down the filters data
if the output quantity is intensive, then it must be
1
The shape, scaleFactor and meanMap parameters can also be passed as default values using
output = LePhareOutput('someFileName.out') output.link(filterList)
where filterList is the
FilterList
object used to perform the SED fitting.These parameters always override the default values if provided.
- Parameters:
name (
str
) – name of the column to generate the image fromshape (
tuple[int]
) – (Optional) shape of the output image. The shape must be such thatshape[0]*shape[1] == len(self.table)
. IfNone
, the default value provided in thelink()
method is used.scaleFactor (
int/float
) – (Optional) scale factor used to scale up the image. IfNone
, the default value provided in thelink()
method is used.meanMap (ndarray) – (Optional) mean map used during the filterList table creation to normalise the data. If
None
, the default value provided in thelink()
method is used.
- Returns:
output image as an Astropy Quantity. Use .data method to only get the array.
- Return type:
- Raises:
TypeError –
if name is not of type
str
if shape is neither a
tuple
nor alist
if scaleFactor is neither an
int
nor afloat
if meanMap is not a ndarray
ValueError – if shape is not of length 2
- class pixSED.outputs.Output(file: str, *args, **kwargs)[source]#
Bases:
ABC
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Abstract SED fitting code output class.
- Parameters:
file (
str
) – name of the SED fitting outut file
- config: str#
Configuration dictionary with info from the header
- file: str#
SED fitting code output file name used
- imProp: Dict[str, Any]#
Image properties corresponding to the output table (keys are None by default, update using the link method with a FilterList object)
- link(filterList: FilterList, *args, **kwargs) None [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Provide the default image properties from a FilterList object.
- Parameters:
filterList (FilterList) – FilterList object from which the image properties are retrieved
- Raises:
TypeError – if filterList is not of type
FilterList
- abstract load(*args, **kwargs) Table [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Load data from a file into an astropy Table object.
- Returns:
the astropy table
- Return type:
- table: Table#
Table gathering data
- abstract toImage(*args, **kwargs) Quantity [source]#
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Generate a resolved map.
- Returns:
the image
- Return type: