---
title: "Reading one cube as maps, spectra and moments"
description: "Define moments from finite-channel brightness, track beam mixing and cropped flux, and test masks against correlated-noise counterexamples."
canonical_url: "https://sandboxphysics.com/stories/molecular-line-cube/moments-beams-and-a-saved-ppv-cube/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/molecular-line-cube/moments-beams-and-a-saved-ppv-cube/"
last_modified: "2026-11-04"
---

[Molecular line cubes: space, velocity and hidden depth](https://sandboxphysics.com/stories/molecular-line-cube/)

Molecular line cubes · L3

# Reading one cube as maps, spectra and moments

Sandbox Physics · 2026-11-04

A channel map, a pixel spectrum and a position–velocity diagram can be different cuts through one saved cube. Moments compress its velocity axis further. Each compression deserves a question: which distinctions survive, and which physically different situations acquire the same number?

## Before you begin

Use the earlier line-area, opacity and channel-average definitions. Moments are introduced as weighted averages.

## Name the three coordinates first

A PPV cube has two sky coordinates and one recession-velocity coordinate. Fix velocity for a channel image. Fix a sky pixel for a spectrum. Take every velocity along an image row for a position–velocity cut.

The interactive record contains $128\times128\times96$ brightness samples. Its length unit is 0.1 parsec, the saved sky window is one parsec wide and velocity edges span $\pm4\,\mathrm{km\,s^{-1}}$. The observer remains on the positive-depth side. Rotating the display camera changes your view of the physical cloud without changing that observer’s data.

Colours in the physical cloud identify local velocities. Transfer through overlapping depths and beam mixing produces the measured quantity in the separate data row. A local velocity highlight is not the escaping intensity from a visible surface.

Every diagnostic and export reads the latest completely accepted record. While new settings compute, the previous record remains intact. Combining a new channel image with an old spectrum would create an inconsistency that no physical cloud produced.

Reading: Sandbox Physics independent molecular-line science producer and reader package · Mangum & Shirley, How to Calculate Molecular Column Density, arXiv 1501.01703v4 (2017)

## Ask a distinct question of each moment

Let $T_i$ be the saved average brightness and $v_i$ the centre of channel $i$. The zeroth moment is line area. The first is brightness-weighted mean velocity. The second central moment measures velocity spread around that mean. The last two become fragile when their shared denominator approaches zero.

An equal double peak has its mean in the intervening dip. Mean velocity need not identify a parcel. Width can combine separate components, opacity broadening and a velocity gradient within the beam, so it does not by itself determine temperature or turbulent energy.

For a numerical example, take a transparent Gaussian with dispersion $250\,\mathrm{m\,s^{-1}}$ and channel width $83.333\,\mathrm{m\,s^{-1}}$. Replacing each bin’s brightness by a weight at its centre adds approximately $\Delta v^2/12=578.7\,\mathrm{m^2\,s^{-2}}$ to the variance in the smooth, fine-channel limit. The resulting discrete width is about $251.2\,\mathrm{m\,s^{-1}}$. This is a useful limit, not a universal correction for narrow or truncated lines.

$$
W=\sum_iT_i\Delta v_i,\quad \bar v=\frac{\sum_i v_iT_i\Delta v_i}{W},\quad \sigma_v^2=\frac{\sum_i(v_i-\bar v)^2T_i\Delta v_i}{W}
$$

The units are brightness times velocity, velocity and velocity squared. These definitions use saved channel centres.

Reading: Sandbox Physics independent molecular-line science producer and reader package

## A beam brings neighbours into a spectrum

A finite beam, the telescope’s angular response, mixes nearby sky positions. When their peaks occur at different velocities, mixing can broaden the spectrum of one image pixel. The spatial averaging has broadened the line even though the local microscopic motion stayed fixed.

The model uses a nonnegative, pixel-integrated Gaussian kernel. It pads the sky with zeros, computes the full convolution and then crops the saved window. Total signal is conserved on the full convolution plane. Cropping can remove signal that the beam carried beyond the map.

A retained edge counterexample loses about 0.589 percent of integrated signal from the saved map. Renormalizing that crop to its input total would hide the loss and change its surface brightness. The interactive model keeps a tighter map-loss gate and retains the last valid record on rejection.

Refine sky and velocity sampling separately. Some original 64-pixel sky cases failed the independent reference; the 128-pixel version passed those registered comparisons. A quarter- or half-pixel translation tests whether a narrow feature happens to land at a pixel centre or between samples. Cold, thin, maximum-shear and these translated cases were added explicitly. An error theorem over every continuous control combination remains unproved; the evidence covers those particular calculations.

Reading: Sandbox Physics independent molecular-line science producer and reader package · Bendo, Avison & Freestone, Measuring the Rotation of TW Hydrae (19 June 2019)

## A mask selects noise too

A mask selects which pixels and channels enter a calculation. Imagine a signal-free noise distribution symmetric about zero. Keep only samples above three standard deviations and every retained sample is positive. Adding them can manufacture a positive apparent line area.

The same threshold removes genuine weak wings, reducing signal area and width. The independent counterexamples retain both effects. The noiseless Lab instead uses a relative-brightness display mask to hide unstable moments in extremely weak pixels. That mask is not a significance test.

The real ALMA teaching cube has Hanning-related channel correlations. In the declared blank annulus and velocity window, the estimated adjacent-channel correlation is about 0.668. A two-channel sum then has roughly 1.29 times the noise standard deviation predicted by independence. This describes that empirical window, without certifying all channels or adaptive masks.

A fixed-window linear sum can propagate a covariance matrix. Selecting a mask from the same noisy data adds a selection effect. The real exercise therefore preserves signed fixed-window integrals alongside positive-threshold integrals.

$$
\operatorname{Var}\!\left(\sum_iw_iT_i\right)=\sum_{ij}w_iC_{ij}w_j=\boldsymbol w^{\mathsf T}C\boldsymbol w
$$

For fixed weights, off-diagonal channel covariances contribute to the integrated uncertainty.

Reading: Sandbox Physics independent molecular-line science producer and reader package · Bendo, Avison & Freestone, Measuring the Rotation of TW Hydrae (19 June 2019)

## Exercises and explanations

1. Equal peaks lie at plus and minus one kilometre per second. Does their zero first moment imply stationary gas?

   Read the explanation

   No. The weighted average vanishes by symmetry, although neither peak is at zero. Inspect the spectrum to distinguish an average from a component, then consider whether opacity also affects the interpretation.

2. Why can a map lose integrated signal when its full beam convolution conserves it?

   Read the explanation

   Convolution can move signal outside the saved window. Conservation concerns the full plane; cropping changes the integration domain. Expand the window or account for missed flux. Renormalizing a crop would change its surface brightness.

## Try the prediction

### [Connect the projections of one record](https://sandboxphysics.com/labs/molecular-line-cube/)

1. Drag the sightline in the channel image and follow the same row in the position–velocity cut. Move to a wing channel and compare channel brightness with the integrated image.
2. Choose the centroid map, find a near-zero pixel and inspect its full spectrum. Identify the symmetry that produced its mean.
3. Translate the cloud to an allowed endpoint and change its axis. All plots should update together. On a rejected state, check that the previous complete record remains exportable.

[Previous: When gas obscures its own line](https://sandboxphysics.com/stories/molecular-line-cube/opacity-and-the-planck-line-source/) [Next: Replay real ALMA velocity slices of the TW Hya disk](https://sandboxphysics.com/stories/molecular-line-cube/replay-alma-tw-hya-line-cube/)

## Sources and calculation scope

1. [Mangum & Shirley, How to Calculate Molecular Column Density, arXiv 1501.01703v4 (2017)](https://arxiv.org/abs/1501.01703v4)

   Fixed v4: transfer and brightness equations 13–32, partition section 7, approximations 11–14 and appendices A–C. The printed Gaussian-width power in A4/A5 is checked against the normalized profile; no blanket non-LTE solution is inherited.

2. [Bendo, Avison & Freestone, Measuring the Rotation of TW Hydrae (19 June 2019)](https://www.alma.ac.uk/nas/gbendo/Web/Sci/Teach/experiment_twhyarotation.pdf)

   Complete eight-page official teaching guide and named original image member. The local tutorial uses native header frequencies, beam area and saved processing history; historical distance/inclination are not promoted to current precision.

3. [Sandbox Physics independent molecular-line science producer and reader package](https://sandboxphysics.com/stories/molecular-line-cube/materials/molecular-line-cube-reader-science-v1.zip)

   Own synthetic input, independent frequency-space/continuous-ray references and retained resolution failures. The native reader obtains exact source files locally; no observed image, native table or app/Node Engine is bundled.
