Unverified Commit 779a75d1 authored by Akke Viitanen's avatar Akke Viitanen
Browse files

add columns option for reading the truth catalog

parent f1fa0a40
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ class CatalogCombined:
        Binary star catalog.
    sql_query: str
        Input SQL query if a database file is read.
    columns: str
        Input columns if a FITS file is read.
    cache: bool
        Use an existing catalog whenever available. Otherwise, always overwrite
        the one in disk.
@@ -54,6 +56,7 @@ class CatalogCombined:
        catalog_star=None,
        catalog_binary=None,
        sql_query=None,
        columns=None,
        cache=True,
    ):
        """
@@ -68,7 +71,7 @@ class CatalogCombined:
        # NOTE: short-circuit for an existing truth catalog
        if cache and os.path.exists(filename := self.get_filename()):
            logger.info(f"Found catalog FITS file {filename}")
            self.catalog_combined = util.read_fits(filename)
            self.catalog_combined = util.read_fits(filename, columns=columns)
            return

        # NOTE: short-circuit for an existing database truth catalog