Allsky Camera

repository·master·Indexed 23 days ago

https://github.com/allskyteam/allsky

A software suite for Raspberry Pi-like hardware designed to capture, process, and display all-sky astronomical images. It automates the pipeline from image capture to the generation of keograms, startrails, and timelapses.

Tokens
7.3K
Snippets
20
Records
37
Agent score
82%

What's inside allsky

  1. Understand post-capture processing and modules

    master

    Allsky performs several automated tasks after an image is captured:

    Image Processing

    Captured images can be automatically resized, cropped, and stretched. The system can also automatically remove bad images that are too light or too dark.

    Modules

    Allsky uses a "module" system to run tasks after each picture is taken.

    • Purpose: Modules can modify the image (e.g., adding an overlay) or perform analysis (e.g., counting stars).
    • Pipeline: You can define which modules run and their execution order.
    • Data Passing: Modules can pass data to one another. For example, a Start Count Module can pass a star count to an Overlay Module to be rendered onto the image.

    Overlays

    The Overlay Editor allows for drag-and-drop placement of text and images. Each field supports custom formatting including font, color, size, position, and rotation.

  2. Understand Keograms, Startrails, and Timelapses

    master

    Allsky generates several types of time-based visual media:

    Keograms

    A Keogram provides a quick view of the day's activity by extracting a 1-pixel wide central vertical column from every image and stitching them together from left to right. This creates a timeline of activity from dawn to the end of nighttime.

    Startrails

    Startrails are created by stacking all images captured during a single night on top of each other to visualize star movement.

    Timelapses

    • Standard Timelapse: Generated at the end of the night using all images captured in the last 24 hours.
    • Mini Timelapse: Generated every few images to show recent sky activity.
  3. Configure Dark Frame Subtraction

    master
    Dark frame subtraction is used to remove "hot" (white) pixels from images. This is achieved by taking images with a cover over the camera lens and subtracting those dark frames from the actual sky captures.
  4. Morris.js Chart Types and Features

    master

    Morris.js supports several types of visualizations with various configuration options:

    Supported Chart Types

    • Line Charts: Standard time-series line graphs.
    • Bar Charts: Vertical or stacked bar representations.
    • Area Charts: Line charts with filled areas underneath.
    • Donut Charts: Circular charts with a hole in the center.

    Key Configuration Options & Features

    • Data Management: Use setData to update chart data dynamically (supported in Donut charts and for redrawing graphs).
    • Axes & Labels:
      • xLabelAngle: Set the angle for X-axis labels (e.g., for diagonal labels).
      • xLabelFormat: Customize X-axis label formatting.
      • yLabelFormat: Customize Y-axis label formatting.
      • disableAxes: Individually disable X or Y axes.
      • ymin / ymax: Set minimum and maximum values for the Y-axis.
    • Visual Styling:
      • smooth: Enable or disable smooth lines.
      • lineColors: Specify colors for lines.
      • labelColor: Set color for donut labels.
      • gridTextFamily / gridTextWeight: Customize grid text appearance.
    • Interactivity:
      • hideHover: Optionally hide the hover box on mouseout.
      • parseTime: If set to false, X values are treated as an equally-spaced series rather than parsed as dates.
  5. Quickstart: Use Highlight.js on a web page

    master

    To use Highlight.js with automatic language detection, include the CSS styles, the library script, and call hljs.initHighlightingOnLoad(). The library will automatically find and highlight code inside <pre><code> tags.

    To explicitly specify a language when auto-detection fails, use the class attribute on the <code> tag with the prefix language- or lang- (e.g., class="html").

    To disable highlighting for a specific block, use the nohighlight class.

    <link rel="stylesheet" href="/path/to/styles/default.css">
    <script src="/path/to/highlight.pack.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>
    
    <!-- Explicit language -->
    <pre><code class="html">...</code></pre>
    
    <!-- Disable highlighting -->
    <pre><code class="nohighlight">...</code></pre>
  6. Run highlighting in a Web Worker

    master

    To prevent the browser UI from freezing when processing large code blocks, you can run the highlighting logic inside a Web Worker.

    Main Script:

    1. Listen for the load event.
    2. Create a new Worker.
    3. Pass the code text to the worker via postMessage.
    4. Update the element's innerHTML when the worker returns the result.

    worker.js:

    1. Use importScripts to load the highlight.pack.js library.
    2. Use self.hljs.highlightAuto(data) to process the code.
    3. Send the result back using postMessage.
    // Main script
    addEventListener('load', () => {
      const code = document.querySelector('#code');
      const worker = new Worker('worker.js');
      worker.onmessage = (event) => { code.innerHTML = event.data; }
      worker.postMessage(code.textContent);
    });
    // worker.js
    onmessage = (event) => {
      importScripts('<path>/highlight.pack.js');
      const result = self.hljs.highlightAuto(event.data);
      postMessage(result.value);
    };
  7. Use Spectrum with a CDN

    master

    To use Spectrum without a local installation, include the minified JavaScript and CSS files from JSDelivr in your HTML:

    <script src="https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.css">
  8. Custom Initialization of Highlight.js

    master

    If you need more control than the automatic initHighlightingOnLoad, you can manually trigger highlighting using hljs.highlightBlock(block) for specific elements. This is useful for targeting specific tags or controlling exactly when highlighting occurs (e.g., after DOMContentLoaded).

    If your code container does not preserve line breaks (like a div instead of a pre), you must configure Highlight.js to use <br> tags for line breaks using hljs.configure({useBR: true}).

    // Manual initialization on DOMContentLoaded
    document.addEventListener('DOMContentLoaded', (event) => {
      document.querySelectorAll('pre code').forEach((block) => {
        hljs.highlightBlock(block);
      });
    });
    
    // Using non-pre containers with <br> support
    hljs.configure({useBR: true});
    
    document.querySelectorAll('div.code').forEach((block) => {
      hljs.highlightBlock(block);
    });
  9. Build Spectrum Locally

    master

    To develop or build Spectrum from source, you must have grunt-cli installed globally. After cloning the repository, follow these steps:

    1. Install dependencies: npm install
    2. Run tests and linting: grunt
    3. Build a minified version: grunt build
    npm install -g grunt-cli
    npm install
    
    # runs jshint and the unit test suite
    grunt
    
    # runs jshint, the unit test suite, and builds a minified version of the file.
    grunt build
  10. Disable highlighting or use plaintext styling

    master

    To prevent Highlight.js from processing specific code blocks, use the following classes on the <code> tag:

    • plaintext: Styles the text like code but applies no syntax highlighting.
    • nohighlight: Disables highlighting for the tag completely.
    <pre><code class="plaintext">...</code></pre>
    <pre><code class="nohighlight">...</code></pre>
  11. Configure Allsky Website and Remote Servers

    master

    Allsky provides multiple ways to host and view your captured data:

    Local Allsky Website

    The website is installed locally on the Raspberry Pi but must be enabled via the WebUI to function.

    Remote Server Uploads

    You can configure Allsky to upload images, keograms, startrails, and timelapses to a remote server that is not running an Allsky Website. This is ideal for integrating recent Allsky images into a personal website.

    For detailed installation and configuration steps, refer to the specific guides for Allsky Website and Remote Server.

  12. Use Highlight.js in Node.js

    master

    Highlight.js can be used on the server to pre-process code before sending it to the client. When using the Node.js API, always access the .value property of the returned object to retrieve the formatted HTML string.

    You can either import the full library (which includes all languages) or import the core library and register specific languages manually to reduce bundle size.