<p>You're correct, except that you should multiply, not divide, by 3600 (you're converting from degrees to arcsec, not the other way round). You get <span class="math-container">$5.7\times10^{-5}{''}$</span>, but the correct result is 3600<sup>2</sup> times higher, i.e. <span class="math-container">$738.6''\!\!\!$</span>.</p>
<p>But why not just let <code>astropy</code> do the job:</p>
<pre><code>z     = 0.3
x     = 3.29 * u.Mpc
theta = x * cosmo.arcsec_per_kpc_proper(z)

print(theta.to(u.arcsec))
---&gt; &lt;Quantity 738.61092463 arcsec&gt;
</code></pre>

CC BY-SA 4.0
2020-09-15T09:39:16.377Z
Thanks for your prompt reply!
GHC
CC BY-SA 4.0
2020-09-15T13:28:52.510Z
@GHC Welcome to Stack Exchange, and excellent first question! it's totally up to you, but in Stack Exchange "thanks" can also be expressed by up voting (there are arrows displayed next to each question and each answer post). I've up voted your question and this answer (they were both zero). Also, at some point if you feel this has answered your question completely you can click the "accept" check mark. Again, it's 100% your choice.
uhoh
CC BY-SA 4.0
2020-09-15T09:34:03.927Z
2020-09-15T09:34:03.927Z
pela
<p>I have only recently started to study astronomy. I would like to ask if I want to get the angle of Mpc under different redshifts, but the result I calculated seems a bit strange. Did I make a mistake while converting?</p>
<pre><code>from astropy.cosmology import FlatLambdaCDM
import numpy as np
from astropy import units as u
import math 
cosmo = FlatLambdaCDM(H0=70, Om0=0.3)

d_A = cosmo.angular_diameter_distance(z=0.3)
print(d_A) #  Mpc

x = 3.29*u.Mpc

theta = (x/d_A *(180/math.pi) *(1/3600))
theta = theta*u.arcsec

print(theta)
</code></pre>

<angular-diameter>
Physical size in different redshift
GHC
# Physical size in different redshift

(Asked by: username_0 on 2020-09-15)

I have only recently started to study astronomy. I would like to ask if I want to get the angle of Mpc under different redshifts, but the result I calculated seems a bit strange. Did I make a mistake while converting?

```
from astropy.cosmology import FlatLambdaCDM
import numpy as np
from astropy import units as u
import math 
cosmo = FlatLambdaCDM(H0=70, Om0=0.3)

d_A = cosmo.angular_diameter_distance(z=0.3)
print(d_A) #  Mpc

x = 3.29*u.Mpc

theta = (x/d_A *(180/math.pi) *(1/3600))
theta = theta*u.arcsec

print(theta)

```

**Tags:** angular-diameter


---

## 1 answers

### Answer by username_1 on 2020-09-15. Score: 2 | Accepted answer

You're correct, except that you should multiply, not divide, by 3600 (you're converting from degrees to arcsec, not the other way round). You get $5.7\times10^{-5}{''}$, but the correct result is 36002 times higher, i.e. $738.6''\!\!\!$.

But why not just let `astropy` do the job:

```
z     = 0.3
x     = 3.29 * u.Mpc
theta = x * cosmo.arcsec_per_kpc_proper(z)

print(theta.to(u.arcsec))
---> <Quantity 738.61092463 arcsec>

```

> **Comments:**
> **username_0**: Thanks for your prompt reply!  
> **username_2**: @username_0 Welcome to Stack Exchange, and excellent first question! it's totally up to you, but in Stack Exchange "thanks" can also be expressed by up voting (there are arrows displayed next to each question and each answer post). I've up voted your question and this answer (they were both zero). Also, at some point if you feel this has answered your question completely you can click the "accept" check mark. Again, it's 100% your choice.  

---

