Configuration of Data Format¶
The config.Config class defines the global configuration of spectral and spatial grids for all simulations in GEHONG.
It determines the wavelength range, sampling step, spatial resolution, and field-of-view of simulated spectra and data cubes.
This configuration is required by all modules, including 1D spectra, 2D maps, and 3D datacubes.
Three Usage Modes¶
The class supports three configuration modes:
mode='sim': Preset for use withcsst-ifs-sim, the CSST CCD image simulator.mode='etc'(default): Preset for use withcsst-ifs-etc, the exposure time calculator.mode=None: Fully customized mode. All parameters must be specified manually.
Spectral Configuration¶
The wavelength grid is defined by:
wave_min: Starting wavelength (\(\mathring{\text{A}}\))wave_max: Ending wavelength (\(\mathring{\text{A}}\))dlam: Wavelength step size (\(\mathring{\text{A}}\))
Internally, these parameters define a 1D wavelength array:
Spatial Configuration¶
The spatial field of view (FoV) is modeled as a regular grid of square spaxels, with:
nx: Number of pixels along the X axisny: Number of pixels along the Y axisdpix: Size of each spaxel (in arcseconds)
The total field of view is then:
Preset Parameters¶
The built-in presets for mode='etc' and mode='sim' are as follows:
Usage Example¶
Here is an example of creating a custom configuration:
from gehong import config
# Fully custom configuration
cfg = config.Config(
mode=None,
wave_min=3500.0,
wave_max=9000.0,
dlam=1.0,
nx=64,
ny=64,
dpix=0.15
)
print("Wavelength grid size:", len(cfg.wave)) # e.g., 5500 pixels
print("Field of view (arcsec):", cfg.fov_x, "x", cfg.fov_y)