Count rates (wcc_sim.starflux)

Convert Gaia photometry to WCC detector count rates via wcc_etc.

Each star: BP-RP -> nearest Pickles dwarf template for the SED (and the PSF colour); the count rate is interpolated in log(rate) between the templates bracketing the star’s colour. Each template is normalized to G = REF_MAG (vegamag) in the Gaia DR3 G bandpass and integrated through the instrument throughput by wcc_etc; rates are memoized per (spt, sensorfilter) and scaled analytically per star.

wcc_sim.starflux.gaia_bandpass(band='g')[source]

Gaia DR3 passband (SVO FPS GAIA/GAIA3.G, .Gbp, .Grp) as a SpectralElement.

wcc_sim.starflux.gaia_g_bandpass()[source]

Gaia DR3 G passband (SVO FPS: GAIA/GAIA3.G) as a SpectralElement.

wcc_sim.starflux.column_floats(cat, name, default=nan)[source]

Column name as float, with masked and non-finite entries -> default.

np.asarray on a MaskedColumn returns the data under the mask (0.0 for a value astropy read back from an ECSV cache), so a magnitude that was never measured would be used as if it had been: a masked BP with 0 underneath turned a G = 18 star into an O5V. Read the mask itself.

wcc_sim.starflux.spt_from_bp_rp(bp_rp)[source]

Nearest-neighbor Pickles dwarf type for BP-RP; NaN/masked -> ‘G2V’.

wcc_sim.starflux.spt_from_b_v(b_v)[source]

Nearest-neighbor Pickles dwarf type for Johnson B-V; NaN/masked -> ‘G2V’.

The B-V counterpart of spt_from_bp_rp, for catalogs (Hipparcos) that give Johnson photometry instead of Gaia’s.

wcc_sim.starflux.g_minus_v(spt)[source]

Synthetic Gaia G - Johnson V for a Pickles type.

wcc_sim.starflux.g_minus_v_at_b_v(b_v)[source]

Synthetic Gaia G - Johnson V interpolated in B-V.

Taking the nearest template’s G-V makes the derived G a step function of colour: between M2V (B-V 1.461, G-V -0.859) and M4V (1.618, -1.408) it jumps 0.55 mag at the midpoint, well inside Hipparcos’s own B-V error for a red star. The template still sets the SED; only this conversion is interpolated. NaN colour falls back to the G2V entry, matching spt_from_b_v’s own fallback.

Colours outside the tabulated range are clamped to the end templates (np.interp’s default), which is the right behaviour: extrapolating a colour-colour sequence off its end is worse than saturating it.

wcc_sim.starflux.bp_rp_for_spt(spt)[source]

The BP-RP that spt_from_bp_rp maps back to this type.

wcc_sim.starflux.make_star_simulation(spt, sensorfilter, mag=15.0)[source]

wcc_etc Simulation for one Pickles star normalized in Gaia G (vegamag).

wcc_sim.starflux.rate_for_spt(spt, sensorfilter)[source]

Total point-source rate (e-/s) at G = REF_MAG, memoized.

spt is coerced to a plain str: wcc_etc.scene dispatches on an exact type(x) is str check, so a numpy.str_ (as produced by indexing the array spt_from_bp_rp returns) silently falls through to a spectrum-less scene and a rate of 0.0 instead of raising.

wcc_sim.starflux.log_rate_at_bp_rp(bp_rp, sensorfilter)[source]

log10 of the rate (e-/s) at G = REF_MAG, interpolated in BP-RP.

Snapping to the nearest template made the rate a step function of colour: M2V -> M4V is -40% in r and +40% in z at fixed G, about +-20% rate error across the M dwarfs from the lookup alone. Interpolating log(rate) between the two bracketing templates removes the steps; the nearest template (spt_from_bp_rp) still sets the SED and the PSF colour. Colours outside the table clamp to the end templates. A missing colour gets the G2V rate, matching spt_from_bp_rp’s fallback.

wcc_sim.starflux.bp_rp_from_catalog(catalog)[source]

Per-row BP-RP, NaN wherever either magnitude is masked or non-finite.

wcc_sim.starflux.color_fallback(catalog)[source]

True where a row’s SED and rate come from the G2V fallback.

A row has no usable BP-RP and no spt override. Written to the CAT extension as spt_fallback so the provenance is visible downstream.

wcc_sim.starflux.rates_for_catalog(catalog, sensorfilter)[source]

Per-star (rate_e_s, spt) arrays for a Gaia catalog Table.

Masked or non-finite BP/RP mean “no colour”: the G2V template and rate. A masked or non-finite G gives a NaN rate; callers decide whether to drop the row. An optional spt column overrides the BP-RP lookup row-wise (empty string = no override) and uses that template’s own rate rather than the colour interpolation.

wcc_sim.starflux.sky_and_dark_rates(sim)[source]

(sky_e_s_per_pix, dark_e_s_per_pix) for a base simulation.