Skip to content

nirzons/HorizonStudio

Repository files navigation

Horizon Studio (for N.I.N.A.)

Horizon Studio is a professional-grade tool for creating, editing, and calibrating local horizon profiles in Nighttime Imaging 'N' Astronomy (N.I.N.A.).

Instead of guessing where trees, rooftops, or distant mountains intersect the night sky, Horizon Studio allows you to trace your actual, physical horizon using a live video feed, generating a native .hrz file that prevents your telescope from slewing into obstructions.


✨ Implemented Features

🎥 Live Eyepiece & HUD Overlay

  • Circular Eyepiece View: Rotates and crops the live camera feed into a clean circular telescope eyepiece view, hiding tilted black borders during mount tracking.
  • AR HUD Overlay: Superimposes a transparent Sky Dome Radar grid, card directions, the mapped horizon line, and mount position directly over the live camera feed.
  • Click-to-Slew: Double-click near the horizon overlay line on the video feed to automatically slew your mount to that position.
  • Active Point HUD: A high-contrast, translucent panel in the top-left corner dynamically overlays the name and coordinates (Alt/Az) of your currently selected pin or landmark, keeping important telemetry always in view.

📷 Main Camera Integration

  • Live Main Camera Feed: Use your primary imaging camera as the video source instead of (or alongside) a webcam, with full N.I.N.A. equipment integration via IImagingMediator.
  • Auto-Exposure ADU Scaling: Automatically adjusts exposure time to keep the image within an optimal ADU range, ensuring clear visibility in varying sky conditions.
    • ⚠️ Note: If mapping during the day, ensure an appropriate filter (like H-alpha) or short base exposure is active to prevent sensor saturation.
  • Real-Time Star Detection HUD: A translucent eyepiece overlay displays live telemetry — star count, median HFR, and ADU level — so you can verify optical alignment at a glance.
  • Camera Safety: Implements hardware capture-block serialization and physical exposure aborts to prevent driver lockouts when stopping or switching feeds.

🔄 Webcam Co-Alignment & Rotation

  • Co-Alignment Assistant: Center a landmark in your main imaging telescope, click the same target in the webcam feed, and the plugin locks the optical offset.
  • Equatorial Counter-Rotation: Automatically rotates the camera feed in real-time based on your mount's position, keeping your physical horizon level. Handles meridian flips automatically.

🗺️ Interactive Sky Dome Radar

  • Shaded Obstruction Zone: Displays a smooth, shaded representation of your blocked low-altitude sky.
  • Radar Slewing: Click anywhere on the radar view to slew the mount to that sky position. Clicking near a saved node snaps selection to it.
  • Active Point HUD: Displays the name and exact Alt/Az coordinates of your active selection in the top-left corner.

🕹️ Verification & Traversal

  • Traversal Controls: Step through both your saved horizon nodes and terrestrial landmarks clockwise (Slew CW ▶) or counter-clockwise (◀ Slew CCW) by physical azimuth proximity, automatically updating the active selection.
  • Safety Safeguards: Disables jogging and traversal controls during active slews, and prompts for confirmation before performing any large azimuth moves (> 45°).

🛠️ Horizon Pin Management

  • Dynamic Pin Dropping: Drop nodes at your mount's position to build the horizon profile in real-time. Pins are automatically kept sorted by Azimuth.
  • Point Editing & Deletion: Select any node to view its coordinates, slew to it, or delete it from the profile.

🔷 Multiple Terrestrial Landmarks

  • Terrestrial Landmarks Management: Add and manage a collection of permanent landmarks (such as antennas, roof pinnacles, or mountain peaks) that are visible from your observing site.
  • Dual Radar Visualization: Landmarks are plotted as fuchsia diamonds (🔷) on both the Live View HUD and Sky Dome radars, displaying their custom names with active selection highlights.
  • One-Click Traversal & Slew: Select any landmark from the list or by clicking its diamond on the radars to slew directly to it, delete it, or rename it.
  • Non-Obstruction Annotation: Landmarks are stored as comment headers at the top of the .hrz file, maintaining 100% compatibility with native N.I.N.A. horizon files.

🌌 SkySafari & Cartes du Ciel Compatibility

  • SkySafari Horizon Image (.png) Export: When clicking the standard Save Horizon Profile button, you can choose to save the profile as a SkySafari Horizon Image (.png). This automatically generates a fully compliant 2048x1024 32-bit transparent equirectangular PNG, with your custom obstructions rendered as a 70% semi-transparent astronomical dark blue and bounded by a sharp solid red line.
    • See our SkySafari Setup Guide for step-by-step instructions on transferring and activating the custom horizon on your Android/iOS device.
  • Cartes du Ciel (CdC) Compatibility: The standard .hrz horizon file generated by Horizon Studio is also fully compatible with Cartes du Ciel. You can load your .hrz profile directly into Cartes du Ciel (Settings > Chart, coordinates > Horizon) to visualize your local obstruction profile on your star charts.

🛠️ Requirements

  • N.I.N.A. (Version 3.0 or higher)
  • An equatorial mount connected via ASCOM/Alpaca
  • A wide-angled DirectShow USB Webcam (Highly Recommended for macro spatial awareness and fast mapping) OR your main imaging camera (via N.I.N.A. integration)
    • 📱 Smartphone as a Webcam: You can use your smartphone (iOS or Android) as a high-quality wireless camera feed! We highly recommend using Iriun Webcam (iriun.com) over WiFi or USB. We advise to lock the video stream orientation on your phone when using this setup to keep the stream aligned with the telescope's physical orientation.

🚀 Step-by-Step User Guide

1. Creating a New Horizon Profile

  1. Connect your Mount and Camera in N.I.N.A., then open the Horizon Studio tab.
  2. Align your camera crosshairs with your main telescope using the co-alignment helper.
  3. Use the jogging controls to move the mount to the peak of a local obstacle (e.g. a tree top or roof line).
  4. Click Drop Pin to save that horizon point.
  5. Move the mount to the next obstacle along the horizon and click Drop Pin again. Repeat until you have mapped your sky.
  6. Click Save Horizon Profile to save your .hrz file.

💡 Pro-Tip: The fastest way to build a profile is to map 3–4 macro "anchor points" around your sky first (e.g., major roof peaks or cardinal direction markers). Once those are dropped, click along the generated radar line to automatically slew nearby, and use the jogging controls to fine-tune the subtle dips and peaks.


2. Loading & Editing Profiles

  • Load Profile: Click Load Horizon Profile to load a previously saved .hrz file.
  • Add/Modify Pins: Slew to any area and click Drop Pin to add new nodes.
  • Delete Pins: Click a node on the radar to select it, then click Delete Node to remove it.
  • Verify Coords: Click ◀ Slew CCW or Slew CW ▶ to step through both your mapped nodes and landmarks by physical azimuth proximity, verifying that the telescope points clear of physical obstructions.

3. Warp & Align Profiles (3D Tilt Correction)

The most common workflow is to build your horizon profile during the daytime — when you can clearly see trees, rooftops, and other obstructions — before your mount is polar-aligned. Once you perform polar alignment, the mount will inevitably shift, and your saved profile will no longer match the sky. 3D Tilt Correction allows you to warp and re-align the entire profile using a single reference point. It is also useful if the webcam co-alignment was skipped or done poorly, introducing a systematic offset into the profile, or if you have physically repositioned your mount since the profile was originally built. In either case, 3D Tilt Correction serves as a quick preliminary correction before fine-tuning individual nodes.

Horizon Studio supports two synchronization methods: Horizon Sync and Landmark Sync.

Method A: Horizon Sync (Using a Horizon Pin)

Use this if you want to align your profile using a physical feature that is already part of your horizon line (e.g., a specific chimney or post).

  1. Select the pin on the radar that represents your physical landmark.
  2. Click Slew in the active details card to move your telescope to it.
  3. Click Prepare Sync.
    • The panel will enter Sync Mode, showing a pulsing purple highlight ring around the target node on the radar.
    • Jogging controls remain active, but pin drops and verification slews are locked for safety.
  4. Look at your camera feed. Manually jog the mount until the physical landmark is centered under the crosshairs.
  5. Once you jog the mount past the safety threshold ($0.05^\circ$), the Confirm Sync button becomes active.
  6. Click Confirm Sync and approve the warping pop-up. The entire horizon line shifts and warps to match your mount's new alignment.

Method B: Landmark Sync (Using Terrestrial Landmarks)

Use this if you want to align your profile using one or more highly striking reference landmarks (like an antenna tip or tower peak) that sit above or below your actual horizon. Horizon Studio allows you to create and manage multiple landmarks. To prevent N.I.N.A. from treating them as obstructions, their coordinates are safely embedded as hidden metadata comment headers directly inside the .hrz file.

  1. Adding Landmarks:

    • Slew your telescope and center a striking landmark under your camera crosshairs.
    • On the 🔷 SYNC LANDMARKS card, click ➕ Add. A new landmark will be created at your mount's current coordinates.
    • Repeat this for any other landmarks visible from your site.
    • (Optional) Click ✏️ Rename to give your landmarks custom names (e.g., "Antena", "Tree").
    • Click Save Horizon Profile to store all landmarks directly in the file.
  2. Calibrating in a Future Session:

    • Click Load Horizon Profile and load your .hrz file. All fuchsia diamonds (🔷) will immediately populate on both radars.
    • Select a landmark from the list or click its diamond on the radar. The active sync area will display the landmark's name and coordinates.
    • Click Slew to point your telescope at the landmark's saved position.
    • Click Prepare Sync.
    • Look at your camera feed and manually jog the mount to center the physical landmark under the crosshairs.
    • Once you jog the mount past the safety threshold ($0.05^\circ$), click Confirm Sync. The entire horizon profile (and all other landmarks in the collection) will shift and warp to match your new alignment!
    • Save your horizon profile to update the coordinates for all landmarks.

📝 License

This project is licensed under the MIT License.

About

A N.I.N.A. plugin and interactive studio to create, edit, and modify custom local horizon files.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages