# UC HII Accretion Test — Running Results

## ⚑ METHODOLOGICAL CORRECTION (supersedes the "dust at the star" framing below)
The earlier per-star analyses anchored dust on the RMS IR position as if it were
the star. **That is wrong: the star is not localizable.** Radio characterization
(`radio_characterized.fits`): of 366 RMS HII regions with CORNISH, **88% are
resolved/extended** — the radio "centroid" is the flux-weighted center of an
extended ionized nebula, not a star. The well-posed question (per A. Ginsburg):
**is there any dust *within the extended ionized region* that could host accretion?**

**Reframed result** (`footprint_dust2.py` → `footprint_dust2.log`,
`fig_w51irs2_dust_vs_ionized.png`): ionized footprint from ALMA-IMF **H41α RRL**;
dust from the free-free-subtracted **B3→B6 α map** (α>2.5); radial dust profile.

| source | ionized r_eff (H41α) | dust INSIDE ionized | dust total <0.5 pc | dust peak radius |
|--------|----------------------|---------------------|--------------------|------------------|
| W51-IRS2 | 0.095 pc | ~1800 M⊙ (boundary cores) | **8800 M⊙** | 0.10 pc (shell) |
| W51-E | 0.149 pc | **0** | **0** | — (evacuated) |
| G010.62 | 0.096 pc | ~6 M⊙ | 745 M⊙ | 0.10 pc (shell) |
| G333.60 | 0.169 pc | 0 | 43 M⊙ | 0.20 pc |
| G338.93 | 0.020 pc (HC) | 0 | 267 M⊙ | 0.40 pc |
| G328.25 | 0.026 pc (HC) | 0 | 402 M⊙ | 0.25–0.30 pc |

**Conclusion (well-posed): ionized gas and dust are spatially SEGREGATED.** Inside
the ionized volume there is essentially no dust (α≈0, free-free); dust resides in a
**shell / cores just outside** the ionized region (tens–thousands of M⊙). So if
accretion is ongoing it is at the **PDR/edge in adjacent dense cores — the
proto-cluster — not within the H II region** and not onto a star bathed in ionized
gas. The W51-IRS2 map shows it directly: ionized region = blue (α≈0) inside; dust
(red, α>2.5) at the southern edge. The two no-CORNISH southern sources are
**HC-HII-scale (0.02–0.03 pc, very young)** and still dust-free inside, dust only at
proto-cluster radii (0.3–0.4 pc). Caveats: T_d=25 K (W51 hotter → mass ~2–4× lower),
α>2.5 cut (optically-thick free-free contamination possible), gas:dust=100, N=6.

This is consistent with everything else (Wells clump inflow feeds the edge/cluster;
per-position free-free). It refines the answer: **the dust that could fuel
accretion is at the edge of / outside the ionized region, never within it.**

---

Testing Padoan & Gieles 2026 (arXiv:2602.06196) assumption that massive stars
keep accreting through the (ultra-)compact HII-region phase.

## Phase 1 — Sample reconstruction & classification  ✅

**Paper sample (primary-source verified):** N = **832 compact HII regions**.
Verbatim: *"select all sources whose Type flag is 'HII region', corresponding to
compact or ultra-compact HII regions … Objects classified as 'diffuse HII region'
or ambiguous 'HII/YSO' are excluded."* Range 3 ≲ log₁₀(L/L⊙) ≲ 6.5, d ≤ 18 kpc.
**YSOs are excluded** — the timescale rests 100% on HII regions.

**Our reconstruction** (RMS Lumsden+2013, Vizier J/ApJS/208/11 table1, 2798 src):
- Type='HII region' + Lbol>0 + d≤18 + logL∈[2.9,6.6] → **800 HII regions** (≈ paper's 832).
- (full young incl YSO/HII-YSO for reference: 1469.)

**UC vs compact split** via CORNISH 5 GHz radio sizes (D[pc]=θ["]·d[kpc]·0.00485):
- CORNISH-North (Purcell+2013, J/ApJS/205/1) + CORNISH-South (Irabor+2023, J/MNRAS/520/1073).
- Thresholds: UC HII ≤0.1 pc · compact 0.1–0.5 pc · classical >0.5 pc.

| class | total matched | of RMS-HII |
|-------|---|---|
| UC HII (≤0.1 pc) | 102 | 89 |
| compact (0.1–0.5) | 240 | 217 |
| classical (>0.5) | 62 | 60 |

- 404/1469 young matched a CORNISH source (<5"); 366 of the 800 HII regions matched.
- Match limited by CORNISH footprint (l 10–65 & 295–350, |b|<1), not just compactness.
- **Validation:** of our strict size-UC HII in the South, 43/47 (91%) carry CORNISH's
  own "UCHII Region" label → clean cut. CORNISH's looser label spreads across our
  UC+compact+classical because our cut folds in distance.

**UC HII fractions:** ≈24% of radio-matched HII regions are strict UC HII (≤0.1 pc);
≈7% of the full embedded young sample. UC HII are a minority — most "compact HII
regions" in the paper's sense are 0.1–0.5 pc.

Files: `master_phase1_classified.fits`, `uchii_candidates.fits` (102 strict UC HII).

## Phase 2 — HII vs YSO weight  ✅
Timescale constraint is **100% from HII regions**; YSOs never enter. Accretion
assumption explicit: compact-HII phase "powered by a star still accreting", m<mf.
Our test bears directly on the whole result.

## Phase 3 — ALMA archive census  ✅

Cone search (30") of the ALMA Science Archive for all 800 RMS HII regions
(`alma_census.py` → `alma_census.csv`, per-obs in `alma_matches.fits`).

**Observed (≥1 archival obs within 30"): 353/800 (44%).** By radio class:

| class | observed/total | % |
|-------|---|---|
| UC HII (≤0.1 pc) | 57/89 | **64%** |
| compact (0.1–0.5) | 112/217 | 52% |
| classical (>0.5) | 23/60 | 38% |
| no CORNISH coverage | 161/434 | 37% |

UC HII are the best-covered class. Of 89 strict UC HII: 57 observed, 74 with
sub-0.5" data, 87/89 with a beam finer than the 0.1 pc scale, 57 with spectral
line data (<10 km/s). **Working sample for Phase 4 = 57 observed UC HII**
(`uchii_observed_best.fits`). Several extremely deep (G034.4: 256 obs B3/6/7/8;
G337.40: 163 obs). Many in big programs: ALMAGAL (2019.1.00195.L), ATOMS, etc.

## Phase 4 — dust mass / accretable reservoir  (in progress)

### Conservative first pass — clump-scale reservoir (ATLASGAL 870µm)
Crossmatch UC HII vs ATLASGAL CSC (Urquhart+2018, J/MNRAS/473/1059, ~19" beam
≈ 0.3–1 pc clump scale). `phase4_reservoir.py` → `uchii_atlasgal.fits`.

- **87/102 UC HII candidates lie in an ATLASGAL clump** (<20").
- **Clump dust+gas mass: median ≈ 1260 M⊙** (quartiles 500 / 1260 / 4000;
  range 62–26000 M⊙).
- Of clumps with a virial measurement, **median virial α ≈ 0.76 (sub-virial,
  gravitationally bound / collapsing).**

→ At clump scale there is an **abundant, bound gas reservoir** around essentially
every UC HII region — far exceeding the ~20–60 M⊙ of the central ionizing star.
The deliberately-conservative upper bound (100% of clump → the single star) does
**not** rule out continued accretion; it supports it.

**Caveat (the real question):** the ATLASGAL clump (~0.5–1 pc) hosts a whole
proto-cluster, not just the ionizing star. Whether that gas actually reaches the
specific star powering the UC HII — vs forming other cluster members or being
held off by the HII region's own feedback — needs the **core-scale (≲0.1 pc),
free-free-subtracted** ALMA measurement (realistic pass) + the geometry criterion
(Phase 5). This is the W51 IRS2 (clustered) ambiguity in the brief.

### Realistic pass — core-scale ALMA dust (ALMAGAL III)
Crossmatch UC HII vs ALMAGAL III compact-source catalog (Coletta+2025,
J/A+A/696/A151; 6348 cores, ~1000 AU, Mcore/Tcore/Diam/nH2). `phase4_cores2.py`
→ `uchii_cores.fits`. 30/102 UC HII fall in ALMAGAL fields.

| scale | tracer | median dust+gas mass |
|-------|--------|---------------------|
| clump ~0.5–1 pc | ATLASGAL 870µm | **1260 M⊙** |
| ≤0.1 pc (sum of cores) | ALMAGAL | **4.3 M⊙** (5 cores) |
| core at ionizing star | ALMAGAL nearest | **0.7 M⊙** (max 32; sep 0.014 pc) |

**The key result is scale-dependence.** The 100s–1000s M⊙ seen at clump scale is
**not** concentrated as dense cores at the ionizing star: the nearest resolved
core to the UC-HII-powering star holds a median <1 M⊙, and all cores within
0.1 pc sum to only ~4 M⊙. The immediate (core-scale) accretion reservoir of the
ionizing star is largely cleared/exhausted, while the extended proto-cluster
envelope retains the mass.

Implication for Padoan & Gieles: their luminosities are clump-integrated, where
gas is plentiful (assumption looks safe). But at the resolved scale that actually
feeds the *individual ionizing star*, most UC HII have little dense gas left —
undermining *vigorous ongoing* accretion onto that specific star. The answer is a
**fraction**: a minority retain a massive (≳8 M⊙) core at the star (max 32 M⊙);
most do not. Caveats: interferometer resolves out smooth envelope (core masses are
compact-structure lower bounds); free-free not yet subtracted (would lower core
masses further); cores within 0.1 pc may belong to *other* cluster members.

## Phase 5 — geometry criterion  ✅ (catalog-level)
For the 30 UC HII with ALMAGAL cores: nearest dust core vs ionizing (free-free)
star. `phase56.py`.
- nearest-core offset median 0.66" = 0.0135 pc.
- **16/30 (53%) have a dust core COINCIDENT (≤0.02 pc) with the ionizing star**;
  14/30 offset (edge / neighboring core).
- Coincident cores are mostly low mass (median 1.2 M⊙).
- Substantial core *at the star*: ≥2 M⊙ 30% · ≥5 M⊙ 23% · **≥8 M⊙ 13%**.

Criterion adopted: "accreting inside the UC HII" = a dust core coincident
(≤0.02 pc) AND massive enough (≥5–8 M⊙) at the free-free source. Sensitive to
both thresholds; a clean call needs resolved dust-vs-free-free imaging (W51 IRS2 /
S106 stress cases still require per-source maps).

## Phase 6 — accretion signatures  ✅ (imaging-level, ALMA-IMF lines)
`phase6_lines.py` → `phase6_line_signatures.fits`. ALMA-IMF moment-0 maps
(on-disk) at each ionizing source, S/N in a 2.5" box: H41α (ionized gas),
CH3CN + CH3CN v8=1 (**hot core = embedded accreting protostar**), N2H+ (cold
dense), H2CO, SiO (outflow).

**9 sources (>5σ): 6 weak/none · 2 hot-core+ionized+outflow · 1 ionized-only.**

| source | H41α | CH3CN | v8 | SiO | signature |
|--------|------|-------|----|----|-----------|
| **W51-IRS2 main (G049.4903)** | 13σ | **64σ** | 27σ | **152σ** | hot core + outflow (active) |
| **G010.6235** | **481σ** | 17σ | 11σ | 4.5σ | hot core + bright UCHII |
| G010.6311 | 5.3σ | — | — | — | ionized only (no hot core) |
| 6 others | ~3σ | <3σ | <3σ | — | no hot core at source |

**7/9 ionizing sources lack a hot core** → no embedded accreting protostar →
post-accretion, consistent with the continuum free-free result. The 2 active
exceptions are the **brightest/most-massive, cluster-confused** sources —
**W51-IRS2 main shows a real hot core + powerful SiO outflow, but that is the
protocluster (the brief's clustering ambiguity), not provably the ionizing star.**

**Triple convergence** — catalog (~3% dust at star), continuum α (7/8 free-free),
lines (7/9 no hot core): all three independent methods agree that the **majority
of (U)C HII ionizing stars are not accreting**, while a massive, clustered
minority still shows activity (where attribution to the specific star is
confounded — exactly the W51-IRS2 case).

## Phase 6 — measured clump-scale inflow rates (Wells+2024) — supports P&G
`phase6_flowrates.py` → `wells_flowrates_byclass.fits`. Wells+2024 modelled
large-scale (streamer/spiral) accretion-flow rates for 87 ALMAGAL clumps across
evolutionary classes. Median total inflow Ṁ (units M⊙/yr):

| class | median Ṁ | N | detected |
|-------|----------|---|----------|
| Quiescent | 5.4e-5 | 17 | 100% |
| Protostellar | 1.6e-4 | 23 | 100% |
| YSO | 6.6e-4 | 22 | 100% |
| **HII Region** | **6.9e-4** | 25 | **100%** |

**The inflow rate rises monotonically with evolutionary stage and peaks at the HII
phase; every HII-region clump has a detected accretion flow.** Our 12 RMS HII
regions in the Wells sample: median Ṁ = 1.2e-3 M⊙/yr. Sanity check:
Ṁ × (1–4 Myr) ≈ 700–2800 M⊙ ≈ the ATLASGAL clump masses — internally consistent.

**This is the strongest evidence FOR P&G's assumption**, at the clump scale their
luminosities probe: compact H II regions are still accreting vigorously at
~0.5–1 pc. The tension with the core/continuum/hot-core results (no dust or hot
core *at the ionizing star*) resolves cleanly: **the clump keeps accreting and
feeds the proto-cluster, but that gas largely does not reach the specific star
that already ionized the H II region.** P&G's 1–4 Myr is thus well-supported as a
**clump/proto-cluster assembly time**; the only part that fails is the literal
identification of that growth with the *individual ionizing* star.

## Phase 6 — accretion signatures (catalog-level, retained)
Crossmatch to Wells+2024 ALMAGAL dynamical-accretion-flow sample (J/A+A/690/A185;
87 clumps with modelled spiral/streamer inflow, 182 flows with rates). `phase6b.py`.
- **12 of the 800 RMS HII regions (4 UC HII) are in Wells' accretion-flow sample,
  all classed "HII Region"** → large-scale (clump/envelope) accretion flows ARE
  detected toward some compact HII regions. Direct evidence of continued *inflow*
  at clump scale — though it feeds the clump/cores, not provably the ionizing star.

---

# FINAL SYNTHESIS

**Question:** Do massive stars keep accreting through the (U)C HII phase — the
assumption underpinning Padoan & Gieles 2026's 1–4 Myr formation timescales?

**Answer is scale-dependent, and that is the whole point:**

1. **Clump scale (~0.5–1 pc).** 87/102 UC HII sit in bound (median α≈0.76)
   ATLASGAL clumps with median ~1260 M⊙ of dense gas; accretion flows are
   detected toward several (Wells+2024). Gas is abundant and inflowing.
   → *Supports* the assumption. Since P&G use clump-integrated luminosities,
   this is the scale their framework implicitly relies on, so the assumption is
   internally defensible for the population, and the timescale result is **not
   cleanly undermined**.

2. **Core scale (≤0.1 pc — the gas that actually feeds the individual ionizing
   star).** The nearest resolved dust core to the UC-HII-powering star holds a
   median **<1 M⊙**; only **~13–23%** retain a ≳5–8 M⊙ core at the star. For ~3/4
   of UC HII the immediate reservoir is largely cleared/exhausted.
   → *Undermines* the strong-form claim that the specific ionizing star is still
   accreting vigorously.

3. **Free-free subtraction (catalog SED, CORNISH 5 GHz → ALMAGAL 219 GHz).**
   `phase4_freefree.py`. For **25–26 of 30** UC HII the ALMAGAL "core" flux at the
   ionizing star is **>50% free-free** — i.e. mostly ionized-gas emission, not
   dust. Dust-corrected median core mass ≈ **0 M⊙**; only **1–2/30 keep a ≥5–8 M⊙
   real dust core** at the star. (Robust direction: if the cm source is optically
   thick at 5 GHz, mm free-free is even higher.)

**Bottom line:** the literal assumption ("the star powering each compact HII
region is still accreting") holds, at the resolved + free-free-subtracted scale,
for only a **small minority (~3–13%; ≤~23% on the most generous, no-ff cut)** of
UC HII. The 1–4 Myr timescales are best read as **clump-scale assembly times**
(gas → proto-cluster → star), not single-star accretion continuing undiminished
to the end of the UC HII phase. The paper's result survives as a statement about
clump-fed growth; the per-star "still accreting" picture is supported for a
minority.

**Accreting fraction (geometry + free-free stated): ~3–13% of UC HII** retain a
coincident, dust-dominated, massive (≳5–8 M⊙) core at the ionizing star — rising
to ≤~23% if free-free is not subtracted. Clump-scale gas is ubiquitous behind all.

**Limited by archival coverage, not physics, where:** only 57/89 UC HII have any
ALMA data and only 30/89 fall in ALMAGAL (core masses); interferometers resolve
out the smooth envelope (core masses are lower bounds); free-free is not yet
subtracted from the "cores" (true dust even lower); thresholds (0.02 pc, 5–8 M⊙)
are choices. A definitive per-source answer needs imaging: dust continuum + a
free-free map (CORNISH/cm) + dense-gas infall lines for the UC HII with deep ALMA
data (G034.4, G337.40, G045.47 … `uchii_observed_best.fits`).

## Imaging validation — DONE (ALMA-IMF, resolved spectral index)
`measure_almaimf.py` → `almaimf_spectral_index.fits`. Resolved dual-band ALMA-IMF
continuum (B3 ~100 GHz, B6 ~230 GHz, on disk) — peak spectral index
α = ln(S_B6/S_B3)/ln(230/100) at the ionizing-source position. α<1.5 free-free
(no dust), α>2.5 dust core, 1.5–2.5 mixed.

**10 HII regions measured. 0 dust-dominated (α>2.5). 8 free-free (α<1.5),
2 mixed (1.5–2.2). None near the pristine-dust value α≈3.5–4.**

| source | α | verdict |
|--------|---|---------|
| **W51-IRS2 (G049.4903)** | **+2.15** | mixed (cluster-confused; not pure dust) |
| W51-IRS2 nbr (G049.4885) | +1.11 | free-free |
| W51-E (G049.4885) | +0.47 | free-free |
| G333.6032 | −1.19 | free-free |
| G010.6235 | +0.54 | free-free |
| G010.6260 | +0.17 | free-free |
| G010.6311 | −0.05 | free-free |
| G327.2852 | +0.83 | free-free |
| G328.2523 | +1.75 | mixed |
| G338.9237 | +0.85 | free-free |

### Common-beam α (publication-grade, `convolve_alpha.py` → `almaimf_alpha_commonbeam.fits`)
Cut out B3+B6 around each source, convolve both to a common beam (~0.3–0.6"),
then measure α — removing the peak-α beam bias. This is the number to trust.

| source | α (peak) | **α (common-beam)** | verdict |
|--------|---------|---------------------|---------|
| **W51-IRS2 (G049.4903)** | +2.15 | **+0.27** | pure free-free |
| W51-IRS2 nbr (G049.4885) | +1.11 | −0.15 | free-free |
| W51-E (G049.4885) | +0.47 | −0.11 | free-free |
| G010.6235 | +0.54 | +0.60 | free-free |
| G010.6260 | +0.17 | −0.33 | free-free |
| G010.6311 | −0.05 | −0.68 | free-free |
| G328.2523 | +1.75 | +1.37 | free-free |
| **G338.9237** | +0.85 | **+2.92** | **dust** |

**8 sources, common-beam: 7 free-free (α<1.5), 0 mixed, 1 dust (α>2.5).** As
predicted, proper common-beam α is much lower (more free-free) than peak-α — the
peak values were beam-biased high. **W51-IRS2 is now unambiguously free-free
(α≈0)** — the brief's stress case has *no dust accretion core* at its ionizing
source. Only **1/8 (G338.9237) shows a genuine dust core** (α=+2.92, a faint
non-CORNISH source — possibly a neighboring core within the RMS beam, not the
ionizing star itself). (G333.60, G327.29 dropped: negative B6 after convolution at
the field edge.)

**Bottom line of the imaging arm:** at the resolved + common-beam scale, **7/8
compact HII regions are pure free-free at the ionizing star — no dust reservoir**,
exactly matching the catalog's free-free-subtracted core result. Both independent
methods converge: the ionizing stars are *not* sitting on dust accretion cores.

Caveats: peak-based α is aperture-sensitive (W51-IRS2 ranged +1.5→+2.2 for 3px→6px
boxes due to a nearby hot core in this protocluster) and biased *high* (toward
dust) without common-beam convolution — so true values are more free-free →
conclusion strengthened. The robust statement: **0/10 are unambiguously dust
(α>2.5); all are free-free or free-free+dust mixtures.**

**Scope/coverage limit (honest):** the strict UC HII G337.92 falls **off the top
edge of the B6 mosaic** (B3 covers it, B6 doesn't → no α); other skips are sources
in adjacent sub-mosaics or beyond the primary beam. So **10 is the true ALMA-IMF
maximum**, and the imaged set is "compact"/unclassified HII + the W51-IRS2
reference case — **not a strict (≤0.1 pc) UC HII.** The strict-UC-HII test rests on
the *catalog* arm (30 ALMAGAL UC HII, free-free-subtracted → ~3% dust-dominated);
the imaging arm independently confirms the same physics for compact HII + W51-IRS2.
The two arms are consistent; a resolved strict-UC-HII image would need an archive
beyond ALMA-IMF (ALMA staging inaccessible from this host — see env notes).
For publication: common-beam convolution + per-source aperture.

## Imaging follow-up (extra targets, ready to run)
Per-source dust-vs-free-free via resolved imaging is unblocked on tooling but
I/O-bound here:
- **CASA 6.5.1.23 works** in env `casapy38` (`/blue/adamginsburg/adamginsburg/
  miniconda3/envs/casapy38/bin/python`). casa6_py36/casa61_py36 are broken.
- ALMA archive datalink **staging/download times out** from this host (TAP is
  fine); ALMAGAL continuum FITS not bulk-downloadable (only CDS catalog, already
  used for core masses).
- **ALMA-IMF data is on disk** (`/orange/adamginsburg/ALMAIMF_Images/<field>/B3,B6`)
  with dual-band continuum → direct spectral-index dust/free-free separation, no
  download. `almaimf_match.py`: **14 RMS HII regions fall in ALMA-IMF fields,
  including the brief's stress case W51-IRS2 (4")**, plus W51-E, W43-MM2, G010.62,
  G012.80, G327.29, G328.25, G333.60, G337.92 (a UC HII), G338.93.
- `measure_almaimf.py` is written to read B3+B6 at each source position and
  compute α (α<1.5 free-free → no dust reservoir at the star; α>2.5 dust). It
  stalls only on the slow GPFS directory listing — runs once paths are known.

This is the decisive per-source test for the brief's reference cases (W51-IRS2,
and by analogy S106) and validates the catalog-level accreting fraction.

## Headline two-scale figure (`fig_twoscale.png`)
One image, the whole result: **(left)** at the ionizing star (≤0.1 pc), the
accretion-signature fraction is small across all three per-star tracers (3/12/22%
with 95% CIs); **(right)** at the clump (~0.5–1 pc), the Wells+2024 inflow rate
rises monotonically with evolutionary stage and **peaks at the H II phase**
(median 7×10⁻⁴ M⊙/yr, 100% detection). The clump keeps accreting and feeds the
proto-cluster; the gas no longer reaches the star that already ionized the H II
region. P&G's clump-integrated 1–4 Myr is supported as a clump-assembly time.

## Triple-convergence summary (`fig_convergence.png`)
Accreting-signature fraction at the ionizing star, three independent methods:
**catalog 3% (1/30) · continuum α 12% (1/8) · lines 22% (2/9)** — all minorities.
The majority of (U)C HII ionizing stars show neither a dust core nor a hot core;
the few "active" detections are the brightest, most-massive, cluster-confused
sources (W51-IRS2). All methods converge on: **P&G's per-star accretion assumption
holds only for a minority.**

## Data products
- `master_phase1_classified.fits` — 1469 RMS young sources, CORNISH radio class.
- `uchii_candidates.fits` — 102 strict UC HII (≤0.1 pc).
- `alma_census.csv` / `alma_matches.fits` — ALMA archive census of 800 HII regions.
- `uchii_observed_best.fits` — 57 ALMA-observed UC HII (imaging targets).
- `uchii_atlasgal.fits` — clump reservoirs. `uchii_cores.fits` — ALMAGAL core masses + geometry.
