Extended sources (wcc_sim.extended)

Analytic extended-source (Sersic) components for wcc-sim frames.

Components are rendered in e-/s/pix on the NATIVE detector grid and convolved once per (template, ebv) group with an effective-PSF kernel (FFT). The native grid is adequate because the in-focus PSF FWHM is ~3 px; the cuspy Sersic center is the exception and is re-evaluated on a refined subgrid. Rendering on the 11x point-source grid would need ~TB of memory for a full frame; sampling profiles as dense point grids would need ~1e6 stamp placements per component. See the design spec (docs/superpowers/specs/2026-07-02-extended-sources-cepheids-design.md).

class wcc_sim.extended.SersicComponent(ra, dec, n, r_eff_arcsec, ellip=0.0, pa_deg=0.0, total_mag=None, sb_mag_arcsec2=None, template='G2V', ebv=0.0)[source]

Bases: object

One elliptical Sersic component.

Exactly one of total_mag (integrated Gaia-G vegamag, same normalization convention as point sources) or sb_mag_arcsec2 (surface brightness at r_eff, mag/arcsec^2) sets the flux. pa_deg is the major-axis angle in degrees CCW from the +x detector axis. n=1 is an exponential disk, n=4 a de Vaucouleurs bulge.

Parameters:
ra: float
dec: float
n: float
r_eff_arcsec: float
ellip: float = 0.0
pa_deg: float = 0.0
total_mag: float = None
sb_mag_arcsec2: float = None
template: str = 'G2V'
ebv: float = 0.0
wcc_sim.extended.sersic_total_over_amplitude(n, r_eff_pix, ellip)[source]

F_total / amplitude for a Sersic2D profile (analytic).

Sersic2D’s amplitude is the surface brightness at r_eff per pixel area; integrating the profile over the plane gives 2 pi n r_eff^2 (1-ellip) e^bn bn^(-2n) Gamma(2n).

wcc_sim.extended.component_amplitude(comp, sensorfilter, plate_scale_mas)[source]

Sersic2D amplitude in e-/s/pix for the (reddened) component.

wcc_sim.extended.render_component_profile(comp, wcs, shape, plate_scale_mas, sensorfilter)[source]

Component surface brightness in e-/s/pix on the native grid (unconvolved); None if the 99.9%-flux footprint misses the frame.

The profile is evaluated at pixel centers in row chunks (full-frame float64 temporaries would be ~GB); a box around the center is re-evaluated on a _REFINE x subgrid and averaged, since a Sersic cusp changes across a pixel while the rest of the profile does not.

wcc_sim.extended.render_extended(components, wcs, shape, plate_scale_mas, sensorfilter, kernels, wing=None)[source]

PSF-convolved sum of all components, e-/s/pix on the native grid.

kernels maps (template, ebv) -> native-resolution PSF kernel; the caller decides whether those are chromatic effective PSFs or copies of the monochromatic one. Kernels are normalized to unit sum here and, when a wing model is given, scaled by 1/wing.flux_norm(half) so extended flux follows the same stamp-truncation convention as add_star. No wing halo is drawn: for smooth extended light the halo is a sub-noise redistribution.