Catalogue classes#

Code author: Hugo Plombat - LUPM <hugo.plombat@umontpellier.fr> & Wilfried Mercier - IRAP/LAM <wilfried.mercier@lam.fr>

Base classes used to generate catalogues for LePhare or Cigale SED fitting codes.

class pixSED.catalogues.Catalogue(fname: str, table: Table, *args, **kwargs)[source]#

Bases: ABC

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Class implementing a catalogue consisting of as Astropy Table and additional information used by the SED fitting codes. This is supposed to be subclassed to account for specificities of LePhare or Cigale catalogues.

Parameters:
  • fname (str) – name of the catalogue file where the catalogue is written into when saving

  • table (Astropy Table) – input table

Raises:

TypeError

save(path: str = '', **kwargs) None[source]#

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Save the catalogue into the given file.

Parameters:
  • path (str) – (Optional) a path to append to the file name

  • **kwargs – optional parameters passed to Table.write()

Raises:

TypeError – if path is not of type str

property text: str#

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Return a text representation of the catalogue used when making the parameter files.

Returns:

output representation

Return type:

str

class pixSED.catalogues.CigaleCat(fname: str, table: Table)[source]#

Bases: Catalogue

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Class implementing a catalogue compatible with Cigale SED fitting code.

Parameters:
  • fname (str) – name of the output file containing the catalogue when it is saved (without any extension, e.g. galaxy1 instead of galaxy1.mag)

  • table (Astropy Table) – input table

save(path: str = '', **kwargs) None[source]#

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Save LePhare catalogue into the given file.

Parameters:
  • path (str) – (Optional) a path to append to the file name

  • **kwargs – optional parameters passed to Table.write() method

Raises:

TypeError – if path is not of type str

class pixSED.catalogues.LePhareCat(fname: str, table: Table, tunit: TableUnit = TableUnit.MAG, magtype: MagType = MagType.AB, tformat: TableFormat = TableFormat.MEME, ttype: TableType = TableType.LONG, nlines: List[int] = [0, 100000000])[source]#

Bases: Catalogue

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Class implementing a catalogue compatible with LePhare SED fitting code.

Parameters:
  • fname (str) – name of the output file containing the catalogue when it is saved (without any extension, e.g. galaxy1 instead of galaxy1.in)

  • table (Astropy Table) – input table

  • tunit (TableUnit) – (Optional) unit of the table data. Must either be TableUnit.MAG for magnitude or TableUnit.FLUX for flux.

  • magtype (MagType) – (Optional) magnitude type if data are in magnitude unit. Must either be MagType.AB or MagType.VEGA.

  • tformat (TableFormat) – (Optional) format of the table. Must either be TableFormat.MEME if data and error columns are intertwined or TableFormat.MMEE if columns are first data and then errors.

  • ttype (TableType) – (Optional) data type. Must either be TableType.SHORT or TableType.LONG.

  • nlines (list[int]) – (Optional) first and last line of the catalogue to be used during the SED fitting

Raises:
  • TypeError

    • if table is not an Astropy Table

    • if fname is not of type str

    • if nlines is not a list[int]

  • ValueError

    • if nlines values are not int

    • if the first value is less than 0

    • if the second value is less than the first one

save(path: str = '', **kwargs) None[source]#

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Save LePhare catalogue into the given file.

:param path:(Optional) a path to append to the file name :type path: str :param **kwargs: optional parameters passed to Table.write() method

Raises:

TypeError – if path is not of type str

property text: str#

Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>

Return a text representation of the catalogue used when making the parameter files.

Returns:

output representation

Return type:

str