autolens.galaxy_table_from_csv#

galaxy_table_from_csv(file_path)[source]#

Load a galaxy population from a CSV with columns y, x, luminosity, redshift?.

The redshift column is optional. If every row in the file populates it, the values are loaded into GalaxyTable.redshifts; if the column is absent or every row leaves it blank, GalaxyTable.redshifts is None. Partial population (some rows have a redshift, others do not) is rejected with ValueError — the partial-population convention mirrors autolens.point.dataset.list_from_csv.

Additional columns are loaded into GalaxyTable.properties keyed by column name — numeric columns as per-galaxy floats, non-numeric ones (names, notes) as strings. Nothing is silently dropped. Row order is preserved.

Parameters:

file_path (Union[str, Path]) – Path to the CSV file. An empty CSV (no header line) and a header-only CSV both return an empty population.