53 lines
1.8 KiB
Python
53 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
|
"""Check which solar system bodies are missing real_radius"""
|
|
import asyncio
|
|
import sys
|
|
import os
|
|
|
|
sys.path.append(os.path.join(os.getcwd(), "backend"))
|
|
|
|
from app.database import AsyncSessionLocal
|
|
from sqlalchemy import select
|
|
from app.models.db.celestial_body import CelestialBody
|
|
|
|
async def check_missing_radii():
|
|
async with AsyncSessionLocal() as session:
|
|
# Solar System body IDs
|
|
solar_ids = ['10', '199', '299', '399', '499', '599', '699', '799', '899', '999',
|
|
'2000001', '136199', '136108', '136472']
|
|
|
|
stmt = select(CelestialBody).where(CelestialBody.id.in_(solar_ids))
|
|
result = await session.execute(stmt)
|
|
bodies = result.scalars().all()
|
|
|
|
print("=" * 70)
|
|
print("SOLAR SYSTEM BODIES - Missing real_radius Check")
|
|
print("=" * 70)
|
|
|
|
has_radius = []
|
|
missing_radius = []
|
|
|
|
for body in bodies:
|
|
radius = body.extra_data.get('real_radius') if body.extra_data else None
|
|
if radius:
|
|
has_radius.append((body.name, body.type, radius))
|
|
else:
|
|
missing_radius.append((body.name, body.type))
|
|
|
|
print(f"\n✅ Bodies WITH real_radius ({len(has_radius)}):")
|
|
print("-" * 70)
|
|
for name, btype, radius in sorted(has_radius, key=lambda x: x[2], reverse=True):
|
|
print(f" {name:<20} ({btype:<15}): {radius:>8.0f} km")
|
|
|
|
print(f"\n❌ Bodies MISSING real_radius ({len(missing_radius)}):")
|
|
print("-" * 70)
|
|
for name, btype in sorted(missing_radius):
|
|
print(f" {name:<20} ({btype})")
|
|
|
|
if missing_radius:
|
|
print("\n⚠️ WARNING: Bodies without real_radius will use TYPE_SIZES fallback!")
|
|
print(" This causes INCONSISTENT scaling!")
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(check_missing_radii())
|