Skip to content
ruirigelPublic

About

Accdc - Astronomy CCD Calculator - Astronomical Field of View (FOV) & Image Scale Calculator for Astrophotography

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Accdc - Astronomy CCD Calculator

Accdc Logo

Astronomical Field of View (FOV) & Image Scale Calculator for Astrophotography

Python Version PySide6 GUI Astropy License


πŸ”­ Overview

πŸ“œ The Journey Behind Accdc Accdc (Astronomy CCD Calculator) has been an evolving project built out of passion for astronomy and technical precision.

I started building this app in 2009 and over the years, the application has gone through multiple iterations across different environments and languages. It initially gained widespread adoption across the astronomy community in its Java-based releases (notably v4.8) distributed as a portable, cross-platform tool on major software portals like SourceForge and Softpedia. Even back then, it pioneered integrating optical calculations with real sky survey downloads directly from the NASA SkyView (DSS) engine.

πŸš€ A Renewed Vision: The Modern Python & Qt6 Era After a period of evolution and refining requirements, Accdc has been completely rebuilt from the ground up to push accuracy, speed, and user experience even further.

Accdc is an open-source desktop application built with Python 3 and PySide6 (Qt6) designed for amateur astronomers and astrophotographers. It helps you accurately simulate, plan, and visualize how deep-sky objects (nebulae, galaxies, star clusters) fit into your telescope and camera sensor frame.

Beyond optical formulas, Accdc queries astronomical databases (SIMBAD / NED via Astroquery) and local high-precision catalog databases (.dat), automatically fetching real sky survey imagery (STScI Digitized Sky Survey - DSS). It projects an interactive sensor field-of-view (FOV) rectangle over the sky background, complete with real-time rotation, pan/drag offsets, optical flips, smooth zooming, hardware management, and ASCOM telescope control.

This new architecture represents a full commitment to delivering a modern, robust, and extensible tool built for the modern astrophotographer.

πŸ“Έ Interface & App Features

πŸŽ›οΈ 1. Panel (Main Workspace & FOV Visualizer)

Main control area for setting optical parameters (focal length, aperture, CCD pixel size), querying target coordinates, rendering real-time DSS background imagery, dynamic sensor FOV overlays, image rotations, and ASCOM slew execution.

Panel Tab
πŸ“š 2. Catalogs (Local Astronomical Datasets)

Quick selector for deep-sky targets from local astronomical catalog files (Messier, NGC, IC, Barnard, Caldwell, SAO, Lynds, etc.) with exact coordinate resolution.

Catalogs Tab
πŸ“œ 3. Historic (Search Log & Query Recall)

Log of all previous target queries. Double-clicking any historical record automatically reloads all optical and target parameters directly into the main Panel.

Historic Tab
🌐 4. Network (Real-Time Community Sharing)

Live feed connected to Firebase Realtime Database showing target queries shared by other astrophotographers globally. Includes right-click features to export community hardware setups into your own local database.

Network Tab
πŸ”­ 5. Instruments (Equipment Profiles Management)

Custom inventory manager to add, edit, reorder, and persist your telescopes (aperture, focal length) and CCD/CMOS cameras (pixel sizes, matrix resolution).

Instruments Tab
πŸŒ™ 6. Night Planner (Nightly Visibility Planner)

Automated visibility planner that queries all local astronomical catalogues and returns every deep-sky object currently above your configurable minimum altitude. Each result shows real-time moon angular separation, meridian transit time, and transit altitude β€” allowing you to quickly identify the best targets for the current night from your exact location.

Instruments Tab
βš™οΈ 7. Settings (User Profile, Location & ASCOM Alpaca Configuration)

Configuration panel for observatory latitude/longitude (used by the Night Planner), network participation, username, country selection, ASCOM / Alpaca and INDI telescope server connection details (IP address and port). ASCOM and INDI connections are mutually exclusive and enforce each other automatically.

Settings Tab

✨ Features

  • Real-Time Optical Calculations:
    • Image Scale in arcseconds per pixel.
    • Field of View in arcminutes and degrees.
    • Telescope focal ratio.
  • Interactive FOV Sky Visualizer:
    • Automatic download and caching of DSS sky survey images for any celestial target.
    • Interactive sensor rectangle overlay rendered accurately to scale.
    • Sensor camera rotation angle adjustment (0Β° to 360Β°).
    • Horizontal & Vertical flips (Flip H / Flip V) to match optical trains (refractors, diagonals, Newtonians).
    • Drag-and-drop panning and mouse-wheel zoom on the sky canvas.
  • Equipment Management:
    • Save and organize telescope profiles (aperture, focal length).
    • Save and organize CCD / CMOS camera profiles (resolution width/height, pixel size in $\mu\text{m}$).
  • Target Search & Coordinate Resolution:
    • Fast search by catalog identifier or common name (e.g., M31, NGC 7000, Horsehead Nebula).
    • Automatic resolution of Right Ascension (RA) and Declination (Dec).
  • Target History & Network Sync:
    • Local history log of recently queried celestial targets.
    • Network tab providing community sync of observations and target queries using Firebase Realtime Database.
  • Night Planner:
    • Automatic scan of all local catalogues (Messier, NGC, IC, Barnard, Caldwell, etc.) against the observer's configured location.
    • Filters objects above a configurable minimum altitude at the current time.
    • Displays moon angular separation, meridian transit time, and transit altitude for every listed object.
    • Refreshes automatically whenever the observer location is saved in Settings.
  • Observatory Location:
    • Latitude and Longitude input fields in Settings, persisted to data/settings.json.
    • Used by the Night Planner for precise Alt/Az visibility calculations via Astropy.
  • ASCOM / INDI Mutual Exclusion:
    • Enabling ASCOM automatically disables INDI and vice versa, preventing conflicting telescope connections.

πŸ› οΈ Tech Stack

  • Core Language: Python 3.10+
  • GUI Framework: PySide6 (Qt 6)
  • Astronomy Libraries: Astropy & Astroquery
  • Image Processing: Pillow (PIL)
  • Cloud Synchronization: Firebase Realtime Database REST API

πŸš€ Installation & Running from Source

1. Clone the Repository

git clone https://github.com/ruirigel/accdc.git
cd accdc

2. Create and Activate a Virtual Environment

# Windows (PowerShell)
python -m venv .venv
.\.venv\Scripts\Activate.ps1

# Linux / macOS
python3 -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install --upgrade pip
pip install -r requirements.txt

4. Run the Application

python -m ui.main_window

πŸ“¦ Building Standalone Executables Across Platforms

Accdc can be compiled into a standalone, single-file executable using PyInstaller.

Note

Important: PyInstaller creates binaries native to the operating system it runs on (it is not a cross-compiler). To build a Windows .exe, compile on Windows. To build a Linux binary, compile on Linux. To build a macOS .app, compile on macOS.

To automate multi-platform builds without needing separate machines, see the GitHub Actions CI/CD section below.


1. Windows Build (.exe)

On Windows, run PyInstaller using the provided .spec file:

# Activate your virtual environment first
.\.venv\Scripts\activate

# Build using the spec configuration
pyinstaller main_window.spec

The output standalone executable main_window.exe will be located in the dist/ folder, complete with the embedded application icon (assets/logo.ico).


2. Linux Build (binary / AppImage)

Prerequisites (Debian / Ubuntu / Mint):

Install the required system libraries for Qt6 and OpenGL:

sudo apt update
sudo apt install -y build-essential libgl1-mesa-dev libglib2.0-0 libxcb-xinerama0 libxcb-cursor0

Build Command:

# Activate your virtual environment
source .venv/bin/activate

# Build executable
pyinstaller --clean -y \
  --name "accdc" \
  --windowed \
  --collect-all core \
  --collect-all ui \
  ui/main_window.py

The resulting binary accdc will be generated in dist/.

(Optional) You can wrap the resulting binary into a portable .AppImage using appimagetool.


3. macOS Build (.app / .dmg)

Prerequisites:

Convert the icon to Apple ICNS format (assets/logo.icns), or omit the icon parameter:

# Activate virtual environment
source .venv/bin/activate

# Build application bundle
pyinstaller --clean -y \
  --name "Accdc" \
  --windowed \
  --collect-all core \
  --collect-all ui \
  --icon="assets/logo.ico" \
  ui/main_window.py

This generates a native macOS application bundle dist/Accdc.app.

(Optional) To create a .dmg installer disk image, install create-dmg:

brew install create-dmg
create-dmg --volname "Accdc Installer" "dist/Accdc.dmg" "dist/Accdc.app"

πŸ€– Automated Cross-Platform Builds (GitHub Actions)

The easiest way to generate binaries for Windows, Linux, and macOS simultaneously is using a GitHub Actions workflow.

Create a file named .github/workflows/build.yml in your repository:

name: Build Cross-Platform Binaries

on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:

jobs:
  build:
    strategy:
      matrix:
        include:
          - os: windows-latest
            artifact_name: accdc-windows.exe
            build_cmd: pyinstaller main_window.spec
            binary_path: dist/main_window.exe

          - os: ubuntu-latest
            artifact_name: accdc-linux
            build_cmd: pyinstaller --clean -y --name accdc --windowed --collect-all core --collect-all ui ui/main_window.py
            binary_path: dist/accdc

          - os: macos-latest
            artifact_name: accdc-macos.zip
            build_cmd: |
              pyinstaller --clean -y --name Accdc --windowed --collect-all core --collect-all ui ui/main_window.py
              ditto -c -k --keepParent dist/Accdc.app dist/accdc-macos.zip
            binary_path: dist/accdc-macos.zip

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install System Dependencies (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libgl1-mesa-glx libxcb-xinerama0 libxcb-cursor0

      - name: Install Python Dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
          pip install pyinstaller

      - name: Build Executable
        run: ${{ matrix.build_cmd }}

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.artifact_name }}
          path: ${{ matrix.binary_path }}

Whenever you push a tag (e.g. v20261105) or trigger the workflow manually from GitHub's Actions tab, GitHub will spin up Windows, Linux, and macOS virtual machines, build the binaries, and make them available for download automatically!


πŸ“‚ Project Structure

accdc/
β”œβ”€β”€ assets/             # Application icons and branding assets
β”œβ”€β”€ core/               # Business logic, optical formulas & network queries
β”‚   β”œβ”€β”€ ascom.py        # ASCOM / Alpaca connection and telescope control
β”‚   β”œβ”€β”€ calculator.py   # Optical math (scale, FOV, focal ratio)
β”‚   β”œβ”€β”€ firebase_sync.py# Firebase network logging and status verification
β”‚   β”œβ”€β”€ observer.py     # Alt/Az visibility calculator (Astropy-based)
β”‚   β”œβ”€β”€ query.py        # Astronomical coordinates query, DSS image fetching & catalogue visibility scan
β”‚   β”œβ”€β”€ storage.py      # Persistence for instruments, settings, favourites and logs
β”‚   └── version.py      # Application version definition
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ favorites.json  # User-saved favourite deep-sky objects
β”‚   β”œβ”€β”€ instruments.json# Default instrument database (telescopes & sensors)
β”‚   └── *.dat           # Local catalogue files (Messier, NGC, IC, BSL, Caldwell, etc.)
β”œβ”€β”€ ui/
β”‚   └── main_window.py  # PySide6 GUI interface implementation
β”œβ”€β”€ .gitignore          # Git exclusion rules
β”œβ”€β”€ create_release.py   # Automated release versioning helper
β”œβ”€β”€ main_window.spec    # PyInstaller Windows build specification
β”œβ”€β”€ requirements.txt    # Production dependencies
└── README.md           # Project documentation

πŸ“„ License

This project is open-source software licensed under the MIT License.


πŸ‘€ Author

Developed by Rui Branco (@ruirigel). Contributions, bug reports, and suggestions are welcome via GitHub Issues!

About

Accdc - Astronomy CCD Calculator - Astronomical Field of View (FOV) & Image Scale Calculator for Astrophotography

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages