Calculando escalas cósmicas con Python y Siri AI

Un colega astrónomo del Observatorio Europeo Austral (European Southern Observatory, ESO), Juan Carlos Muñoz (@astro_jcm@mastodon.online), posteó:

Juan Carlos Muñoz

If the Sun was the size of a lentil, the nearest star would be 140 km away. Voyager 1 is now 90 m from the Sun 😬

Douglas Adams said it best: "Space is big. You just won't believe how vastly, hugely, mind-bogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space."

2026-11-18, 14:56 249 compartidos 359 favoritos

Aunque me daba la sensación de que la escala era correcta, quise comprobarlo, y seleccionando el primer párrafo le pedí a Siri AI…

Can you verify this? Give me some Python code I could verify it.

O lo que es lo mismo, ¿Puedes verificarlo? Dame algo de código Python que lo pueda verificar.

Y me proporcionó un código de Python relativamente decente:

#!/usr/bin/env python3
# Constants
SUN_DIAMETER_KM = 1391400.0
PROXIMA_CENTAURI_KM = 40170000000000.0 # ~4.246 light-years
VOYAGER_1_KM = 25900000000.0 # ~173 AU (as of late 2026)
# Scale definition
lentil_diameter_mm = 5.0
lentil_diameter_km = lentil_diameter_mm / 1000000.0 # Convert mm to km
# Calculate scale factor
scale_factor = lentil_diameter_km / SUN_DIAMETER_KM
# Calculate scaled distances
scaled_proxima_km = PROXIMA_CENTAURI_KM * scale_factor
scaled_voyager_km = VOYAGER_1_KM * scale_factor
scaled_voyager_m = scaled_voyager_km * 1000.0
print(f"Scaled distance to Proxima Centauri: {scaled_proxima_km:.2f} km")
print(f"Scaled distance to Voyager 1: {scaled_voyager_m:.2f} m")

El resultado de ejecutar ese código es:

Scaled distance to Proxima Centauri: 144.35 km
Scaled distance to Voyager 1: 93.07 m

Así que desde luego parece que Juan Carlos había hecho bien sus cálculos 😉

Sin embargo, hay muchas asunciones embebidas en ese código, muchas constantes, y se hace difícil hacer comparaciones si cambian las unidades. Así que le pedí…

Please use Astropy units and constants to make this code more self-explanatory.

Astropy es un paquete de Python para astronomía con gran cantidad de funciones, pero una de las más importantes para mi es su biblioteca de constantes, y de manejo de unidades. Así que la petición era que rehiciera el código utilizando Astropy, y valores astronómicos como el radio del Sol, y este fue el resultado (con algún problema de formateo en la salida de Siri AI que obviaremos):

#!/usr/bin/env python3
"""
Verify the 'Lentil-Sized Sun' Scale of the Universe.
If the Sun were the size of a lentil (5mm), this script calculates:
# The distance to the nearest star (Proxima Centauri).
# The distance to Voyager 1.
"""
import astropy.constants as const
import astropy.units as u
def verify_scale():
# 1. Define the scale: a lentil (5 mm) representing the Sun
lentil_diameter = 5.0 * u.mm
sun_diameter = const.R_sun.to(u.mm) * 2 # const.R_sun is the radius of the Sun, not the diameter
scale_factor = lentil_diameter / sun_diameter
# 2. Define actual distances
# Proxima Centauri is approx 4.246 light-years away
proxima_centauri_distance = 4.246 * u.lightyear
# Voyager 1 is approx 173 AU from the Sun (as of late 2026)
voyager_1_distance = 173.0 * u.AU
# 3. Calculate scaled distances
scaled_proxima = (proxima_centauri_distance * scale_factor).to(u.km)
scaled_voyager = (voyager_1_distance * scale_factor).to(u.m)
# 4. Output results
print("— Scale Verification —")
print(f"Scale Factor: 1 to {1/scale_factor:,.0f}")
print(f"Scaled distance to Proxima Centauri: {scaled_proxima:.2f} (Claim: ~140 km)")
print(f"Scaled distance to Voyager 1: {scaled_voyager:.2f} (Claim: ~90 m)")
if __name__ == "main":
verify_scale()

Y este es el resultado de su ejecución:

--- Scale Verification ---
Scale Factor: 1 to 278,280,000,000
Scaled distance to Proxima Centauri: 144.35 km (Claim: ~140 km)
Scaled distance to Voyager 1: 93.00 m (Claim: ~90 m)

La razón por la que estamos hablando hoy de la Voyager 1 es porque justo está a un día luz, así que le pedí a Siri AI…

Set the distance to Voyager as one light-day.

Y el código final quedó como:

#!/usr/bin/env python3
"""
Verify the 'Lentil-Sized Sun' Scale of the Universe.
If the Sun were the size of a lentil (5mm), this script calculates:
# The distance to the nearest star (Proxima Centauri).
# The distance to Voyager 1.
"""
import astropy.constants as const
import astropy.units as u
def verify_scale():
# 1. Define the scale: a lentil (5 mm) representing the Sun
lentil_diameter = 5.0 * u.mm
sun_diameter = const.R_sun.to(u.mm) * 2 # const.R_sun is the radius of the Sun, not the diameter
scale_factor = lentil_diameter / sun_diameter
# 2. Define actual distances
# Proxima Centauri is approx 4.246 light-years away
proxima_centauri_distance = 4.246 * u.lightyear
# Voyager 1 is exactly one light day from the Sun (as of November 2026)
voyager_1_distance = u.lightyear / 365.25 # one lightyear divided by days in a year
# 3. Calculate scaled distances
scaled_proxima = (proxima_centauri_distance * scale_factor).to(u.km)
scaled_voyager = (voyager_1_distance * scale_factor).to(u.m)
# 4. Output results
print("— Scale Verification —")
print(f"Scale Factor: 1 to {1/scale_factor:,.0f}")
print(f"Scaled distance to Proxima Centauri: {scaled_proxima:.2f} (Claim: ~140 km)")
print(f"Scaled distance to Voyager 1: {scaled_voyager:.2f} (Claim: ~90 m)")
if __name__ == "main":
verify_scale()

que resulta en…

--- Scale Verification ---
Scale Factor: 1 to 278,280,000,000
Scaled distance to Proxima Centauri: 144.35 km (Claim: ~140 km)
Scaled distance to Voyager 1: 93.08 m (Claim: ~90 m)

Una última nota: personalmente, you habría calculado la conversión a partir de un año luz (u.lightyear):

voyager_1_distance = u.lightyear / (u.year.to(u.day))

O bien a partir de un segundo luz (u.lightsecond):

voyager_1_distance = u.lightsecond * (u.day.to(u.s))

para así evitar tener que escribir a mano la constante 365.25.

¡Feliz día luz, Voyager 1!

Reacciones en fediverso

Comentarios

Deja un comentario

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.