<p>That depends on how accurate you want your answer.</p>
<p>The reason is that the angle <span class="math-container">$\theta$</span> spanned by a length <span class="math-container">$L = 1\,\mathrm{Mpc}$</span> depends on the distance <span class="math-container">$d$</span> of that length — in comoving coordinates, <span class="math-container">$\theta$</span> keeps decreasing with <span class="math-container">$d$</span>, just like a normal item, say a bicycle, looks smaller the farther away it is (curiously, in <em>physical</em> coordinates, this is not the case. Due to the finite speed of light and the expansion of the Universe, galaxies only look smaller out a certain distance, after which they start to look larger).</p>
<p>An <span class="math-container">$(L = 1\,\mathrm{Mpc})^2$</span> square spans <span class="math-container">$\theta_2 = 39''$</span> at a redshift of <span class="math-container">$z=2$</span>, and <span class="math-container">$\theta_3 = 32''$</span> at <span class="math-container">$z=3$</span>. The comoving distances are <span class="math-container">$d_2 = 5.3\,\mathrm{Gpc}$</span> and <span class="math-container">$d_3 = 6.5\,\mathrm{Gpc}$</span>, respectively.</p>
<p>So yes, <em>roughly</em> you can say that the comoving volume of an <span class="math-container">$A = 1\,\mathrm{Mpc}^2$</span> square between <span class="math-container">$z=2$</span> and <span class="math-container">$z=3$</span> is <span class="math-container">$V = A(d_3-d_2)$</span>. But read on.</p>
<h3>The calculation</h3>
<p>You mention a survey, so I assume you're not actually given an area, but a field of view (FOV). The problem is the same, just the other way; your FOV doesn't cover the same area at different redshifts.</p>
<p>So, here's the rigorous way to calculate it:</p>
<p>Let's say your FOV spans a solid angle <span class="math-container">$\Omega=\theta_\mathrm{RA}\times\theta_\mathrm{dec}$</span>, which measured in radians comprises a fraction <span class="math-container">$\Omega/4\pi$</span> of the whole sphere. The total, comoving volume to a comoving distance <span class="math-container">$d$</span> is just <span class="math-container">$V = 4\pi d^3/3$</span>, so the volume of the shell between <span class="math-container">$z=2$</span> and <span class="math-container">$z=3$</span> is
<span class="math-container">$$
V_\mathrm{2\rightarrow3} = V_3 - V_2 = \frac{4\pi}{3} \big(d_3^3 - d_2^3\big).
$$</span></p>
<p>The comoving volume spanned by your FOV is thus
<span class="math-container">$$
V = \frac{\Omega}{4\pi} V_\mathrm{2\rightarrow3},
$$</span>
or
<span class="math-container">$$
V = \frac{\Omega}{3} \big(d_3^3 - d_2^3\big).
$$</span></p>
<p><a href="https://i.sstatic.net/8vfQW.png" rel="noreferrer"><img src="https://i.sstatic.net/8vfQW.png" alt="comvol" /></a></p>
<h3>The error</h3>
<p>The difference between the two approaches increases with the difference between the two redshifts. With a FOV of, say, <span class="math-container">$\Omega = (\theta=32'')^2 = 1024\,\mathrm{arcsec}^2=2.4\times10^{-8}\,\mathrm{sr}$</span>, if you say that it spans an area of <span class="math-container">$A = 1\,\mathrm{Mpc}^2$</span> (which is only correct at <span class="math-container">$z=3$</span>), you'll get
<span class="math-container">$$
V_\mathrm{approx.} = 1\,\mathrm{Mpc}^2 \times (6508 - 5312)\,\mathrm{Mpc} = 1198\,\mathrm{Mpc}^3,
$$</span>
whereas with the correct formula you get
<span class="math-container">$$
V_\mathrm{true} = \frac{2.4\times10^{-8}}{3} \left( 6508^3 - 5312^3\right)\,\mathrm{Mpc}^3 = 1011\,\mathrm{Mpc}^3,
$$</span>
that is, 16% percent lower.</p>
<p>If, on the other hand, your FOV is <span class="math-container">$\Omega = (\mathbf{39}'')^2$</span>, and if you say that it spans an area of <span class="math-container">$A = 1\,\mathrm{Mpc}^2$</span> (which is only correct at <span class="math-container">$z=\mathbf{2}$</span>), then the true volume would be 1500 Mpc, i.e. 25% larger than your ~1200 Mpc.</p>
<p>Since the correct calculation isn't much harder than the approximation, I suggest you stick to the correct one.</p>
<h3>The Python way</h3>
<p>With the <code>astropy</code> module, just type</p>
<pre><code>from astropy.cosmology import Planck15
from astropy import units as u
theta_RA  = 32 * u.arcsec
theta_dec = 32 * u.arcsec
Omega     = (theta_RA * theta_dec).to(u.steradian).value # get rid of unit
d2        = Planck15.comoving_distance(2)
d3        = Planck15.comoving_distance(3)
V         = Omega/3 * (d3**3 - d2**3)
print(V)

1011.0148201494444 Mpc3
</code></pre>
<p>or</p>
<pre><code>V23  = Planck15.comoving_volume(3) - Planck15.comoving_volume(2)
V    = Omega/(4*pi) * V23
</code></pre>
<p>which gives the same result.</p>

CC BY-SA 4.0
2021-06-16T14:09:42.300Z
+1 for great explanation and showing the coding option!
Daddy Kropotkin
CC BY-SA 4.0
2021-06-16T15:42:05.783Z
Thanks for the detailed explanation!
Framazu
CC BY-SA 4.0
2021-06-16T19:33:34.647Z
@Framazu You're welcome :)
pela
CC BY-SA 4.0
2021-06-16T13:25:10.703Z
2021-06-16T15:11:03.130Z
2021-06-16T15:11:03.130Z
pela
<p>Suppose I have data from an astronomical survey at redshifts in the range <span class="math-container">$z = [2,3]$</span>. Suppose that, on average in this range, the data covers an area on the sky of <span class="math-container">$A=1$</span> <span class="math-container">$\mathrm{Mpc}^2$</span>. How would I calculate the comoving volume covered by the survey? Is it as simple as calculating the comoving distance from <span class="math-container">$z=2$</span> to <span class="math-container">$z=3$</span> and multiplying by the average area? That is: <span class="math-container">$V_C = A(D_C(3)-D_C(2))$</span>?</p>

<observational-astronomy><cosmology><distances><redshift>
Comoving Volume Calculation
Framazu
# Comoving Volume Calculation

(Asked by: username_0 on 2021-06-16)

Suppose I have data from an astronomical survey at redshifts in the range $z = [2,3]$. Suppose that, on average in this range, the data covers an area on the sky of $A=1$ $\mathrm{Mpc}^2$. How would I calculate the comoving volume covered by the survey? Is it as simple as calculating the comoving distance from $z=2$ to $z=3$ and multiplying by the average area? That is: $V\_C = A(D\_C(3)-D\_C(2))$?

**Tags:** observational-astronomy, cosmology, distances, redshift


---

## 1 answers

### Answer by username_1 on 2021-06-16. Score: 8 | Accepted answer

That depends on how accurate you want your answer.

The reason is that the angle $\theta$ spanned by a length $L = 1\,\mathrm{Mpc}$ depends on the distance $d$ of that length — in comoving coordinates, $\theta$ keeps decreasing with $d$, just like a normal item, say a bicycle, looks smaller the farther away it is (curiously, in *physical* coordinates, this is not the case. Due to the finite speed of light and the expansion of the Universe, galaxies only look smaller out a certain distance, after which they start to look larger).

An $(L = 1\,\mathrm{Mpc})^2$ square spans $\theta\_2 = 39''$ at a redshift of $z=2$, and $\theta\_3 = 32''$ at $z=3$. The comoving distances are $d\_2 = 5.3\,\mathrm{Gpc}$ and $d\_3 = 6.5\,\mathrm{Gpc}$, respectively.

So yes, *roughly* you can say that the comoving volume of an $A = 1\,\mathrm{Mpc}^2$ square between $z=2$ and $z=3$ is $V = A(d\_3-d\_2)$. But read on.

### The calculation

You mention a survey, so I assume you're not actually given an area, but a field of view (FOV). The problem is the same, just the other way; your FOV doesn't cover the same area at different redshifts.

So, here's the rigorous way to calculate it:

Let's say your FOV spans a solid angle $\Omega=\theta\_\mathrm{RA}\times\theta\_\mathrm{dec}$, which measured in radians comprises a fraction $\Omega/4\pi$ of the whole sphere. The total, comoving volume to a comoving distance $d$ is just $V = 4\pi d^3/3$, so the volume of the shell between $z=2$ and $z=3$ is
$$
V\_\mathrm{2\rightarrow3} = V\_3 - V\_2 = \frac{4\pi}{3} \big(d\_3^3 - d\_2^3\big).
$$

The comoving volume spanned by your FOV is thus
$$
V = \frac{\Omega}{4\pi} V\_\mathrm{2\rightarrow3},
$$
or
$$
V = \frac{\Omega}{3} \big(d\_3^3 - d\_2^3\big).
$$

[![comvol](https://i.sstatic.net/8vfQW.png)](https://i.sstatic.net/8vfQW.png)

### The error

The difference between the two approaches increases with the difference between the two redshifts. With a FOV of, say, $\Omega = (\theta=32'')^2 = 1024\,\mathrm{arcsec}^2=2.4\times10^{-8}\,\mathrm{sr}$, if you say that it spans an area of $A = 1\,\mathrm{Mpc}^2$ (which is only correct at $z=3$), you'll get
$$
V\_\mathrm{approx.} = 1\,\mathrm{Mpc}^2 \times (6508 - 5312)\,\mathrm{Mpc} = 1198\,\mathrm{Mpc}^3,
$$
whereas with the correct formula you get
$$
V\_\mathrm{true} = \frac{2.4\times10^{-8}}{3} \left( 6508^3 - 5312^3\right)\,\mathrm{Mpc}^3 = 1011\,\mathrm{Mpc}^3,
$$
that is, 16% percent lower.

If, on the other hand, your FOV is $\Omega = (\mathbf{39}'')^2$, and if you say that it spans an area of $A = 1\,\mathrm{Mpc}^2$ (which is only correct at $z=\mathbf{2}$), then the true volume would be 1500 Mpc, i.e. 25% larger than your ~1200 Mpc.

Since the correct calculation isn't much harder than the approximation, I suggest you stick to the correct one.

### The Python way

With the `astropy` module, just type

```
from astropy.cosmology import Planck15
from astropy import units as u
theta_RA  = 32 * u.arcsec
theta_dec = 32 * u.arcsec
Omega     = (theta_RA * theta_dec).to(u.steradian).value # get rid of unit
d2        = Planck15.comoving_distance(2)
d3        = Planck15.comoving_distance(3)
V         = Omega/3 * (d3**3 - d2**3)
print(V)

1011.0148201494444 Mpc3

```

or

```
V23  = Planck15.comoving_volume(3) - Planck15.comoving_volume(2)
V    = Omega/(4*pi) * V23

```

which gives the same result.

> **Comments:**
> **username_2**: +1 for great explanation and showing the coding option!  
> **username_0**: Thanks for the detailed explanation!  
> **username_1**: @username_0 You're welcome :)  

---

