API Reference
This page provides detailed information about the galaxyGenius API.
Core Classes
Configuration
- class galaxyGenius.config.Configuration(surveys: str | list[str] | None = None)[source]
Bases:
object
The Configuration class handles all configuration settings for galaxyGenius, including:
Main configuration settings
Survey-specific configurations
Configuration validation and management
- __init__(surveys: str | list[str] | None = None)[source]
Initialize a Configuration object for GalaxyGenius.
- add_survey(surveys: str | list[str] | None = None)[source]
Add surveys. Call
get_config()
to get the updated configs.
- remove_survey(surveys: str | list[str] | None = None)[source]
Remove surveys. Call
get_config()
to get the updated configs.
- save_config(conf: dict | None = None)[source]
Save the current configuration to files.
The configuration is saved to config.toml for the main settings, and separate config_{survey}.toml files for each survey’s specific settings.
- Parameters:
conf (dict or None, optional) – Dictionary containing configuration updates to apply before saving. If None, saves the current configuration without modifications.
PreProcess
- class galaxyGenius.preprocess.PreProcess(config: dict)[source]
Bases:
object
The PreProcess class handles the preparation of data for SKIRT simulation:
Reading and processing subhalo data
Preparing particle data
Creating SKIRT input files
Managing simulation parameters
- __init__(config: dict)[source]
Initialize a PreProcess object for preparing simulation data for SKIRT.
The PreProcess class handles tasks like loading and converting particle data, calculating derived quantities, and preparing input files for SKIRT simulations.
- Parameters:
config (dict) – Configuration dictionary containing simulation parameters and settings.
- get_subhalos() dict [source]
Get subhalos
- Returns:
dictionary containing number of subhalos, subhaloIDs, subhaloSFRs
- Return type:
subhalos
- subhalo(subhaloID: int)[source]
Specify one subhalo to be processed
- Parameters:
subhaloID (
int
) – subhaloID of the subhalo to be processed
DataGeneration
- class galaxyGenius.generation.DataGeneration(config: dict)[source]
Bases:
object
The DataGeneration class manages the SKIRT radiative transfer simulation process:
Running SKIRT simulations
Managing input/output files
Handling data cube generation
- __init__(config: dict)[source]
Initialize a DataGeneration object for running SKIRT simulations and managing outputs.
- Parameters:
config (dict) – Configuration dictionary containing simulation parameters and settings.
PostProcess
- class galaxyGenius.postprocess.PostProcess(subhaloID: int)[source]
Bases:
object
The PostProcess class handles the post-processing of simulation results:
Processing data cubes
Generating bandpass images
Creating SEDs
Visualizing results
- __init__(subhaloID: int)[source]
Initialize a PostProcess object for post-processing SKIRT simulation outputs.
The PostProcess class handles tasks like PSF convolution, filter application, and image processing of SKIRT datacubes to create synthetic observations that match specific surveys.
- Parameters:
subhaloID (int) – ID of the subhalo/galaxy to process
Utility Functions
Utility functions for various operations including:
Data conversion and manipulation
File handling
Mathematical operations
Visualization helpers
- galaxyGenius.utils.u2temp(u_energy: float, x_e: float) float [source]
Convert internal energy to temperature
- galaxyGenius.utils.convert_to_rgb(bandpassImage: ndarray | list, idx: list = [2, 3, 5]) ndarray [source]
Convert the bandpass image to RGB image
- galaxyGenius.utils.split(string: str, castType: type | None = None) list [source]
Split the string into a list
- galaxyGenius.utils.get_wavelength_scale(filename: str) float [source]
Get the wavelength scale of the filter
- Parameters:
filename (
str
) – filename of the filter- Returns:
wavelength scale of the filter
- Return type:
wavelength_scale
- galaxyGenius.utils.calc_pivot(dataDir: str, survey: str, filter: str) float [source]
Calculate the pivot wavelength of the filter
- galaxyGenius.utils.copyfile(src: str, tar: str)[source]
Copy a file from source to target location if target doesn’t exist