MAP2D¶
- map2d.GradMap2D(x, y, a0=10.0, r_eff=1.0, gred=-0.3, ellip=0.5, theta=0.0, x_0=0.0, y_0=0.0, floor_radius=0.01)¶
Compute a 2D map with a logarithmic radial gradient.
- The radial profile follows:
A(r) = a0 + gred * log10(r / r_eff)
- Parameters
x (array_like) – X-coordinates of spatial positions (in pixels).
y (array_like) – Y-coordinates of spatial positions (in pixels).
a0 (float, optional) – Central value at r = r_eff. Default is 10.0 (arbitrary units).
r_eff (float, optional) – Effective radius in pixels (normalization radius). Default is 1.0.
gred (float, optional) – Gradient per dex in radius (dA / dlog(r)). Default is -0.3.
ellip (float, optional) – Ellipticity of the disk. Default is 0.5.
theta (float, optional) – Position angle in degrees (counterclockwise from +X axis). Default is 0.0.
x_0 (float, optional) – X-coordinate of the center. Default is 0.0.
y_0 (float, optional) – Y-coordinate of the center. Default is 0.0.
floor_radius (float, optional) – Minimum radius for log calculation (to avoid log(0)). Default is 0.01.
- Returns
map – 2D distribution with log-radius gradient (arbitrary units).
- Return type
ndarray
- class map2d.IonizedGasMap(config, halpha=None, sfr=None, zh=None, vel=None, vpec=None, vdisp=None, ebv=None, z=None)¶
Container for 2D maps of ionized gas properties used in nebular emission modeling.
Supports both Hα-calibrated and SFR-calibrated modes, determined by input availability. Each spaxel’s parameters are passed to the HII_Region class to generate the emission line spectrum.
- Parameters
config (Config) – Global configuration object.
halpha (Map2D, optional) – Hα flux map in units of 1e-17 erg/s/cm². Required for Hα-calibrated mode.
sfr (Map2D, optional) – Star formation rate map (M☉/yr). Required for SFR-calibrated mode.
zh (Map2D, optional) – Gas-phase metallicity map (in log Z/Z☉). Required.
vel (Map2D, optional) – Line-of-sight velocity map (km/s). Required in Hα mode.
vpec (Map2D, optional) – Galaxy peculiar velocity map (km/s). Required in SFR mode.
vdisp (Map2D, optional) – Velocity dispersion map (km/s). Required.
ebv (Map2D, optional) – Dust extinction map E(B−V). Required.
z (float, optional) – Global redshift. Required in SFR mode.
- class map2d.Map2D(config)¶
A class to generate 2D maps of galaxy properties based on analytical models or user-defined inputs.
This is a core utility for constructing spatial distributions (maps) of galaxy properties such as surface brightness (Sérsic profile), velocity fields (tanh disk rotation), and parameter gradients (e.g., age, metallicity).
- map2d.Sersic2D(x, y, mag=12.0, r_eff=1.0, n=2.0, ellip=0.5, theta=0.0, x_0=0.0, y_0=0.0, pixelscale=0.01)¶
Compute the 2D surface brightness distribution based on the Sérsic profile.
- Parameters
x (array_like) – X-coordinates of spatial positions (in pixels).
y (array_like) – Y-coordinates of spatial positions (in pixels).
mag (float, optional) – Total integrated magnitude of the Sérsic profile. Default is 12.0 mag.
r_eff (float, optional) – Effective (half-light) radius in pixels. Default is 1.0.
n (float, optional) – Sérsic index. Default is 2.0.
ellip (float, optional) – Ellipticity, defined as 1 - b/a. Default is 0.5.
theta (float, optional) – Position angle (PA) in degrees, measured counterclockwise from +X axis. Default is 0.0.
x_0 (float, optional) – X-coordinate of the Sérsic model center. Default is 0.0.
y_0 (float, optional) – Y-coordinate of the Sérsic model center. Default is 0.0.
pixelscale (float, optional) – Pixel area in arcsec² (used for magnitude normalization). Default is 0.01.
- Returns
sb_mag – Surface brightness distribution in units of AB magnitude per arcsec².
- Return type
ndarray
- class map2d.StellarPopulationMap(config, sb=None, sfh=None, sfh_age=None, ceh=None, ceh_age=None, vel=None, vdisp=None, ebv=None, vpec=None, z=None)¶
Container for 2D and 3D maps of stellar population properties used in spectrum synthesis.
Supports both single-SSP and composite SFH/CEH modes, and handles observational vs physical flux calibration. Each spaxel’s parameters are passed to the StellarContinuum class to generate the corresponding spectrum.
- Parameters
config (Config) – Global configuration object.
sb (Map2D, optional) – Surface brightness map (mag/arcsec²), used for flux calibration in mag-mode.
sfh (Map2D or ndarray, optional) – Either 2D map of mean stellar age (Gyr), or 3D array of shape (nx, ny, N) representing SFR(t) history. The corresponding time axis must be provided via sfh_age of shape (N,).
sfh_age (ndarray, optional) – Array of shape (N,) representing the age grid (Gyr) used in SFH cube.
ceh (Map2D or ndarray, optional) – Either 2D map of [Fe/H], or 3D array of shape (nx, ny, N) representing [Fe/H](t) history. The corresponding time axis must be provided via ceh_age of shape (N,).
ceh_age (ndarray, optional) – Array of shape (N,) representing the age grid (Gyr) used in CEH cube.
vel (Map2D, optional) – 2D map of line-of-sight velocity (km/s). Required in mag-mode.
vdisp (Map2D, optional) – 2D map of stellar velocity dispersion (km/s).
ebv (Map2D, optional) – 2D map of dust extinction (E(B−V)).
vpec (Map2D, optional) – 2D map of galaxy peculiar velocity (km/s). Required in physical mode.
z (float, optional) – Global cosmological redshift. Required in physical mode.
- map2d.VelMap2D(x, y, vmax=200.0, rt=1.0, ellip=0.5, theta=0.0, x_0=0.0, y_0=0.0)¶
Compute a 2D velocity field based on a rotating disk model.
- The rotation curve follows a hyperbolic tangent (tanh) profile:
v(r) = vmax * tanh(r/rt)
- Parameters
x (array_like) – X-coordinates of spatial positions (in pixels).
y (array_like) – Y-coordinates of spatial positions (in pixels).
vmax (float, optional) – Asymptotic (maximum) rotational velocity in km/s. Default is 200.0.
rt (float, optional) – Turn-over radius of the rotation curve in pixels. Default is 1.0.
ellip (float, optional) – Ellipticity of the disk. Default is 0.5.
theta (float, optional) – Position angle (PA) in degrees, counterclockwise from +X axis. Default is 0.0.
x_0 (float, optional) – X-coordinate of disk center. Default is 0.0.
y_0 (float, optional) – Y-coordinate of disk center. Default is 0.0.
- Returns
velocity_map – Line-of-sight velocity field in km/s.
- Return type
ndarray