Astro Session Analyser - Ekos Edition

Astrophotography session analyzer specialized for Ekos/KStars. This application analyzes .analyze files generated by Ekos and sends comprehensive summaries with temporal plots to Discord.

๐ŸŒŸ Features

Core Features

  • Native Ekos Analysis: Directly parses KStars/Ekos .analyze files
  • Temporal Plotting: HFR, guiding error, and temperature evolution graphs
  • Advanced Analytics: Statistical analysis with numpy/scipy (optional)
  • 3 Report Levels: minimal, standard, detailed - from quick notifications to comprehensive analysis
  • Discord Integration: Rich summaries with emojis and organized statistics
  • Dry-Run Mode: Safe testing without sending to Discord

Advanced Features

  • Multi-Filter Analysis: Performance breakdown by filter with sub-session details
  • Guiding Analytics: Comprehensive guiding performance analysis by filter
  • Quality Metrics: HFR, FWHM, star detection, and seeing conditions
  • Temperature Correlation: Statistical analysis of temperature effects on imaging quality
  • Intelligent Message Splitting: Automatic Discord message fragmentation for large sessions
  • Alert System: Automatic detection of performance issues and recommendations

๐Ÿ“Š Report Levels

๐Ÿ“ฑ MINIMAL - Quick Notifications

**๐Ÿ”ญ Session Summary (Minimal)**
๐Ÿ“ธ **31 captures completed**
โฐ Duration: 5h 55m

๐ŸŒค๏ธ **Session Conditions**
๐ŸŒก๏ธ Temperature Stability: Variable (ฮ”5.1ยฐC)
๐Ÿ”ญ Mount Tracking: Good (28 events)

๐ŸŽฏ **Autofocus Summary**
๐Ÿ”„ Sessions: 9
๐Ÿ“ˆ Focus Stability: Frequent adjustments

๐Ÿšจ **4 Critical Issues**
โ€ข 4 aborted captures detected

๐Ÿ“Š STANDARD - Daily Usage (Default)

**๐Ÿ”ญ Ekos Session Summary**
๐Ÿ“… 2024-01-15 18:12 UTC

๐ŸŒ™ **Session Overview**
๐Ÿ“ธ Total Captures: 31
โฐ Duration: 11:41 โ†’ 17:37 (5h 55m)
๐ŸŒก๏ธ Temperature: 15.8ยฐC โ†’ 20.9ยฐC (avg 17.0ยฐC)
๐ŸŽฏ Objects: 1 | ๐Ÿ” Filters: 3 (H, O, S)

๐ŸŒค๏ธ **Session Conditions**
๐ŸŒก๏ธ Temperature Stability: Variable (ฮ”5.1ยฐC)
๐Ÿ”ญ Mount Tracking: Good (28 events)

๐ŸŒŸ **Guiding Performance**
๐Ÿ“Š Measurements: 1,247
๐ŸŽฏ Avg Error: 0.92โ€ณ
๐ŸŸก Guide Quality: Good
๐Ÿ“ˆ RA: 0.78โ€ณ | DEC: 0.61โ€ณ

๐Ÿ“Š **Capture Details**

๐ŸŽฏ **NGC 7380**
๐Ÿ“Œ H Filter (11ร—600s, 1h 50m)
   ๐Ÿ”ง HFR: 3.60 โ†’ 5.62 (avg 4.64, ฯƒ 0.66)
   ๐Ÿ“ FWHM: 8.46 โ†’ 13.21 (avg 10.90, ฯƒ 1.55)
   โญ Stars: 249 โ†’ 250 (avg 250, consistency 1.00)
   ๐Ÿ“ˆ Guide: 0.89โ€ณ ๐ŸŸกGood

๐ŸŽฏ **Autofocus Summary**
๐Ÿ”„ Sessions: 9
๐ŸŒก๏ธ Average Temperature: 17.1ยฐC
๐Ÿ“ˆ Focus Stability: Frequent adjustments

โš ๏ธ **Issues & Alerts**
โŒ Aborted Captures: 4

๐Ÿ”ฌ DETAILED - Data Analysis Mode

**๐Ÿ”ญ Session Overview (1/3)**
๐Ÿ“… 2024-01-15 18:12 UTC

๐ŸŒ™ **Session Overview**
๐Ÿ“ธ Total Captures: 31
โฐ Duration: 11:41 โ†’ 17:37 (5h 55m)
๐ŸŒก๏ธ Temperature: 15.8ยฐC โ†’ 20.9ยฐC (avg 17.0ยฐC) (Stability: 60%)
๐ŸŽฏ Objects: 1 | ๐Ÿ” Filters: 3 (H, O, S)

๐ŸŒค๏ธ **Session Conditions**
๐ŸŒก๏ธ Temperature Stability: Variable (ฮ”5.1ยฐC)
๐Ÿ”ญ Mount Tracking: Good (28 events)

๐ŸŒŸ **Guiding Performance**
๐Ÿ“Š Measurements: 1,247
๐ŸŽฏ Avg Error: 0.92โ€ณ
๐ŸŸก Guide Quality: Good
๐Ÿ“ˆ RA: 0.78โ€ณ | DEC: 0.61โ€ณ

๐Ÿ“Š **Image Quality Analysis**
๐Ÿ”ง HFR: 1.96 โ†’ 5.62 (avg 3.06)
๐Ÿ‘๏ธ Seeing Conditions: Average
๐Ÿ“ˆ HFR Stability: 0.215 (lower is better)

**๐Ÿ“Š Performance Analysis (2/3)**

๐ŸŽฏ **Filter Performance Summary**

๐Ÿ“Œ **H**: 11ร—600s (1.8h) - ๐Ÿ”ง 4.64 | ๐Ÿ“ˆ 0.89โ€ณ ๐ŸŸก
๐Ÿ“Œ **O**: 13ร—600s (2.2h) - ๐Ÿ”ง 2.83 | ๐Ÿ“ˆ 0.95โ€ณ ๐ŸŸก  
๐Ÿ“Œ **S**: 7ร—600s (1.2h) - ๐Ÿ”ง 2.41 | ๐Ÿ“ˆ 0.91โ€ณ ๐ŸŸก

**๐Ÿ”ฌ Detailed Sub-Sessions (3/3)**

๐ŸŽฏ **NGC 7380**
๐Ÿ“Œ H Filter (11ร—600s, 1h 50m)
๐Ÿ“‹ Sub-sessions: 2
     #1: 22:46โ†’23:57 (1h 10m) | 7ร—600s
          ๐Ÿ“ˆ Guide: 0.94โ€ณ ๐ŸŸกGood
          ๐Ÿ”ง HFR: 4.12 โ†’ 5.62 (avg 4.89)
          ๐Ÿ“ FWHM: 4.94 โ†’ 6.74 (avg 5.87)
         โญ Stars: 249 โ†’ 250 (avg 250, consistency 1.00)
     #2: 00:15โ†’00:55 (40m) | 4ร—600s
          ๐Ÿ“ˆ Guide: 0.81โ€ณ ๐ŸŸกGood
          ๐Ÿ”ง HFR: 3.60 โ†’ 4.98 (avg 4.22)
          ๐Ÿ“ FWHM: 4.32 โ†’ 5.98 (avg 5.06)
         โญ Stars: 249 โ†’ 250 (avg 250, consistency 1.00)

๐ŸŒก๏ธ **Temperature Analysis**
๐Ÿ“Š Thermal Stability: 60% (Range: 5.1ยฐC)
๐Ÿ“ˆ Temp-HFR Correlation: -0.234 (significant)

๐ŸŽฏ **Autofocus Analysis**
๐Ÿ”„ Sessions: 9
๐Ÿ” **By Filter:**
   โ€ข H: 3 sessions (avg temp 16.8ยฐC)
   โ€ข O: 4 sessions (avg temp 17.2ยฐC)
   โ€ข S: 2 sessions (avg temp 17.5ยฐC)
โฑ๏ธ Avg Interval: 45 minutes

๐Ÿ“‹ Requirements

  • Python 3.7+
  • KStars/Ekos configured to generate analyze files
  • Discord webhook configured
  • For DETAILED level: NumPy/SciPy for advanced analytics
  • For plotting: matplotlib (optional)

๐Ÿš€ Installation

  1. Clone the repository
git clone https://github.com/grm/astro-session-analyser
cd astro-session-analyser
  1. Install dependencies
# Basic installation (minimal & standard levels)
pipenv install

# For detailed level with advanced analytics
pipenv install numpy scipy

# For temporal plots (optional)
pipenv install matplotlib
  1. Configure the application
# Copy example configuration
cp config_example.yml config.yml

# Edit config.yml with your settings

โš™๏ธ Configuration

Basic Configuration

Edit the config.yml file:

# Discord webhook URL (required)
webhook: "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN"

# Time window in hours to analyze sessions
hours: 24

# Path to Ekos analyze files (optional)
# Default: ~/.local/share/kstars/analyze
analyze_dir: "/home/username/.local/share/kstars/analyze"

# Report level: minimal, standard, detailed
discord_report_level: "standard"

# Enable temporal plotting (optional)
plotting:
  enabled: true

# Log level (optional)
log_level: "INFO"

Advanced Options (Optional)

# Advanced analytics (auto-enabled for detailed level)
advanced_analytics:
  enabled: false  # Set to true to force enable for standard level

# Alert thresholds (optional customization)
alert_thresholds:
  hfr_drift_warning: 0.5        # pixels
  temperature_swing_warning: 5.0 # ยฐC
  success_rate_warning: 0.8     # 80%

# Notification preferences
notifications:
  performance_alerts: true
  min_captures_for_report: 1

๐Ÿ”ง Usage

Development and Testing

# Safe testing with dry-run (RECOMMENDED)
pipenv run python nightly_summary.py -c config.yml --dry-run

# Verbose mode for debugging
pipenv run python nightly_summary.py -c config.yml --dry-run --verbose

Production Use

# Send summary to Discord
pipenv run python nightly_summary.py -c config.yml

# With verbose output
pipenv run python nightly_summary.py -c config.yml --verbose

Automation

Add to your crontab for daily summary at 8 AM:

0 8 * * * cd /path/to/astro-session-analyser && pipenv run python nightly_summary.py -c config.yml

๐Ÿ“Š Example Output

Discord Message with Temporal Plot

Here's an example of what gets sent to Discord, including both the comprehensive text summary and temporal visualization:

Example Session Plot

Example Discord Message:

๐Ÿ”ญ Ekos Session Summary
๐Ÿ“… 2025-09-04 07:49 UTC

๐ŸŒ™ Session Overview
๐Ÿ“ธ Total Captures: 7
โฐ Duration: 07:00 โ†’ 08:38 (1h 38m)
๐ŸŽฏ Objects: 1 | ๐Ÿ” Filters: 3 (H, O, S)

๐ŸŒŸ Guiding Performance
๐Ÿ“Š Measurements: 22
๐ŸŽฏ Avg Error: 1.21โ€ณ
๐ŸŸก Guide Quality: Good
๐Ÿ“ˆ RA: 0.95โ€ณ | DEC: 0.74โ€ณ

๐Ÿ“Š Capture Details

๐ŸŽฏ NGC 7380
๐Ÿ“Œ H Filter (4ร—600s, 58m)
   ๐Ÿ”ง HFR: 2.75 โ†’ 4.10 (avg 3.42, ฯƒ 0.67)
   ๐Ÿ“ FWHM: 6.46 โ†’ 9.63 (avg 8.05, ฯƒ 1.59)
   โญ Stars: 244 โ†’ 250 (avg 247, consistency 0.99)
   ๐Ÿ“ˆ Guide: 1.19โ€ณ ๐ŸŸกGood

๐Ÿ“Œ O Filter (2ร—600s, 20m)
   ๐Ÿ”ง HFR: 2.25 โ†’ 2.25 (avg 2.25, ฯƒ 0.00)
   ๐Ÿ“ FWHM: 5.29 โ†’ 5.29 (avg 5.29, ฯƒ 0.00)
   โญ Stars: 247 โ†’ 248 (avg 248, consistency 1.00)
   ๐Ÿ“ˆ Guide: 1.24โ€ณ ๐ŸŸกGood

๐ŸŽฏ Autofocus Summary
๐Ÿ”„ Sessions: 3
๐Ÿ“ˆ Focus Stability: Good

โš ๏ธ Issues & Alerts
โŒ Aborted Captures: 4

The temporal plot shows:

  • ๐Ÿ”ง HFR Evolution: Focus quality changes over time with autofocus events marked
  • ๐Ÿ“ˆ Guiding Performance: Mount tracking stability with quality zones
  • ๐ŸŒก๏ธ Temperature Evolution: Environmental conditions during the session

๐Ÿ” Troubleshooting

No Data Found

  • Verify that KStars/Ekos generates .analyze files in ~/.local/share/kstars/analyze/
  • Check the analyze_dir path in configuration
  • Use --verbose to see detailed logs

Discord Webhook Error

  • Verify the webhook URL in config.yml
  • Test with --dry-run first to see formatted output

Advanced Analytics Issues

  • For DETAILED level, install: pipenv install numpy scipy
  • The system gracefully falls back to basic mode if dependencies are missing
  • Check console output for "advanced analytics" vs "basic analytics"

Plotting Issues

  • Install matplotlib: pipenv install matplotlib
  • Check plotting.enabled: true in configuration
  • Plots are saved to plots/ directory and attached to Discord messages

Parsing Issues

  • Check KStars/Ekos version (tested with 3.7.7+)
  • Enable verbose mode: --verbose
  • Use dry-run for safe testing: --dry-run

๐ŸŽฏ Use Cases

Quick Monitoring โ†’ MINIMAL Level

  • Essential notifications for automation
  • Critical alerts only
  • Perfect for mobile notifications and monitoring systems

Daily Usage โ†’ STANDARD Level (Default)

  • Comprehensive session summaries
  • All essential astrophotography metrics
  • Balanced information without complexity

Data Analysis โ†’ DETAILED Level

  • In-depth statistical analysis with sub-sessions
  • Quality and performance optimization insights
  • Scientific metrics with correlation analysis
  • Advanced troubleshooting information

๐Ÿ”ฌ Advanced Analytics (DETAILED Level)

Automatic Features

When you select discord_report_level: "detailed", the system automatically enables:

  • Sub-Session Analysis: Detailed breakdown of each imaging run by filter
  • Statistical Correlations: Temperature-HFR analysis with significance testing
  • Quality Scoring: Objective analysis of session quality and conditions
  • Performance Metrics: Success rates and filter-specific efficiency analysis
  • Trend Analysis: HFR stability and degradation detection
  • Intelligent Alerts: Automatic detection of issues with actionable recommendations

Dependencies

The detailed level requires scientific Python libraries:

pipenv install numpy scipy

๐Ÿงช Development

Safe Testing

Always use dry-run mode during development:

# Test without sending to Discord
pipenv run python nightly_summary.py -c config.yml --dry-run --verbose

Architecture

  • nightly_summary.py: CLI interface and orchestration
  • ekos_analyzer.py: Ekos .analyze file parser and data extraction
  • ekos_discord_formatter.py: Unified Discord message formatter for all levels
  • session_plotter.py: Temporal plot generation with matplotlib
  • advanced_metrics.py: Statistical calculations and quality analysis
  • utils.py: Configuration, logging, and Discord utilities

๐Ÿค Contributing

Contributions are welcome! The project uses:

  • Python 3.7+ with Pipenv for dependency management
  • NumPy/SciPy for advanced analytics (optional)
  • matplotlib for temporal plotting (optional)
  • Clear separation between basic and advanced features with graceful degradation

๐Ÿ“„ License

This project is under MIT license. See LICENSE file for details.

๐Ÿ™ Acknowledgments

  • KStars/Ekos team for excellent astrophotography software
  • Discord community for feedback and suggestions
  • NumPy/SciPy communities for statistical computing tools

๐Ÿš€ Latest Updates

  • Enhanced Multi-Filter Analysis: Comprehensive sub-session breakdown by filter
  • Improved Guiding Analytics: Real-time guiding performance analysis with quality assessment
  • Intelligent Message Splitting: Automatic Discord message fragmentation for large sessions
  • Temporal Plotting System: HFR, guiding, and temperature evolution graphs
  • Advanced Statistical Analysis: Temperature correlations and quality metrics
  • Better Error Handling: Graceful degradation and clear error messages
  • Unified Configuration: Single config file supporting all features and levels

Perfect for astrophotographers from beginners to data enthusiasts! ๐Ÿ”ญโœจ