-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ingestion.py
More file actions
64 lines (48 loc) · 1.63 KB
/
test_ingestion.py
File metadata and controls
64 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python3
"""
Development script to test image ingestion manually
"""
import asyncio
import sys
from pathlib import Path
# Add parent directory to path
sys.path.insert(0, str(Path(__file__).parent))
from app.ingestion.fetch_images import ImageIngestionManager
async def main():
print("=" * 60)
print("Space Entropy Generator - Image Ingestion Test")
print("=" * 60)
print()
manager = ImageIngestionManager()
print(f"📁 Storage path: {manager.storage_path}")
print(f"📊 Max stored images: {manager.max_stored_images}")
print(f"🔧 Number of sources: {len(manager.sources)}")
print()
print("🚀 Fetching images from NASA SDO...")
print()
try:
images = await manager.fetch_images()
print()
print(f"✅ Successfully fetched {len(images)} image(s)")
print()
if images:
print("Image Details:")
print("-" * 60)
for i, img in enumerate(images, 1):
print(f"{i}. {Path(img['path']).name}")
print(f" Source: {img['source']}")
print(f" Size: {img['size']:,} bytes")
print(f" Timestamp: {img['timestamp']}")
print()
# Show stored images
stored = manager.get_stored_images()
print(f"📦 Total stored images: {len(stored)}")
except Exception as e:
print(f"❌ Error: {e}")
import traceback
traceback.print_exc()
return 1
return 0
if __name__ == "__main__":
exit_code = asyncio.run(main())
sys.exit(exit_code)