Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

charlottetown-sky

ASCII star map for Charlottetown PEI - recreation of a 1970s PDP-11/VAX program in Free Pascal

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

Charlottetown Sky

An ASCII star map program displaying the night sky as seen from Charlottetown, Prince Edward Island. This is a recreation of a program originally written in the 1970s on a PDP-11 or VAX minicomputer.

Origin

When I was in high school in the 1970s, a friend and I wrote a program (probably on a PDP-11, maybe a Vax 11/730) to show the stars in the nightsky at Charlottetown PEI for a given time and date. We used visible stars from a catalog, perhaps the Yale Brightstar catalog. The output device was a 132 character wide line printer. The display projection was a circle, with the zenith at the center. Star brightnesses were displayed using character size, e.g. a dot would be dim and (perhaps) an @ would be brightest. We probably wrote the program in Pascal. I believe we used "Astronomical Formulae for Calculators" by Meeus, but it could have been the explanatory supplement to the astronomical (maybe nautical) almanac. Please recreate this as closely as you can.

Sample Output

pascal
                                                     CHARLOTTETOWN SKY
                                                Lat 46.2382 N  Lon 63.1311 W

                                             October 15, 1978  22:30 Local Time
                                                 Local Sidereal Time: 23:54
                                                  230 stars above horizon

                                                   ------ ----N---- ------
                                           ,-- ----  ,      .             ---- ---
                                      -----,                                      -----
                                 -----                                                 -----
                              .--                             +                             ---
                          ----                         +         ,    +   +     +            , ----
                       ---     .          ,                                                        ---
                     ---            ,                   +                                      .     ---
                   --                           .                                                     , --
                 --                             .           .    .        .                               --
               --                                                                                           --
             --                            ,                                       ,                          --
            -                                                                                                   -
          -.  *                                                        +  ,                     .               +--
         --      ,                                                                  ,                             --
        -    .                                                                                        .             -
      --.                                                                        ,                          ,       ,--
     -            .                                           +                                                        -
    -  .                          .                                        .            .   ,           ,    .          -
   --      ,                                                                                +   .                       --
   -                       +                                               .  ,                                          -
  -                  , .                                       ,                                                 ,        -
 -,  +    ,                   @                        .              ,                               .                    -
--        ,                                                                            .                    .,           , --
-                          . ,                                            +  ,         .           @       .                -
  E      +                                       +                + .                   .    +                                  . W
-                 * .       .                                          .                                        ,               -
-+++               ..       .                ,         .                                                                        -
-.          ,                        .               +                                  ,             , .                       -
-- ,     . .                                  ,                                                                               ,--
 -                   ,                                   ,                 ,                                ,                  -
 -. ,                                     +                   +         +        .                .         *                  -
 -@                .                        ,                              ,                      .         .     ,           .-
  -       .               .                                                .                                           ,      -
         ...
                                               --- ----     +                 ---- ---
                                                       ------ ----S---- ------

                                Magnitude:  @ < 0.5   * < 1.5   + < 2.5   , < 3.5   . < 4.0
                                      Zenith at center, horizon at edge, North at top

Features

  • Location: Charlottetown, PEI (46.2382° N, 63.1311° W)
  • Output: 132-character wide display (classic line printer width)
  • Projection: Zenithal equidistant (zenith at center, horizon at edge)
  • Orientation: North at top, East on left (planisphere layout - see note below)
  • Star catalog: Yale Bright Star Catalog (9,096 stars to magnitude 6.5)
  • Display limit: Magnitude 4.0 (230 brightest stars for clean display)

Why is East on the Left?

The display uses planisphere orientation, which is the standard for star charts. Unlike terrestrial maps where East is on the right, a planisphere is designed to be held above your head while facing south. In this position, East (where the sun rises) is on your left and West is on your right. This mirrors the actual sky as you look up at it.

Building

Requires Free Pascal compiler (FPC).

bash
# macOS
brew install fpc

# Linux
apt install fpc

# Build
make

# Run tests
make test

Usage

bash
# Display current sky
./skymap

# Display sky for specific date/time (local time)
./skymap YYYY MM DD HH MM

# Example: October 15, 1978 at 10:30 PM
./skymap 1978 10 15 22 30

Project Structure

pascal
charlottetown-sky/
????????? Makefile                 # Build automation
????????? skymap.pas               # Main program
????????? astronomy.pas            # Astronomical calculations (Meeus algorithms)
????????? catalog.pas              # Star catalog loading and filtering
????????? renderer.pas             # ASCII rendering and projection
????????? convert_catalog.pas      # Yale BSC format converter
????????? data/
???   ????????? catalog.dat          # Original Yale BSC data
???   ????????? bsc5.dat             # Converted text format
???   ????????? bsc5.bin             # Binary format (faster loading)
????????? test/
???   ????????? test_astronomy.pas   # Unit tests for calculations
????????? charlottetown-sky.html   # Presentation of this project

Technology

  • Language: Free Pascal (FPC 3.2.2) - chosen for authenticity to the original 1970s Pascal
  • Algorithms: Based on Jean Meeus' "Astronomical Algorithms" (successor to "Astronomical Formulae for Calculators")
  • Star Catalog: Yale Bright Star Catalog, 5th edition

Astronomical Calculations

The program implements these key algorithms from Meeus:

  1. Julian Day Number (Chapter 7) - Convert calendar date to astronomical time
  2. Sidereal Time (Chapter 12) - Calculate Greenwich and Local Sidereal Time
  3. Coordinate Transformation (Chapter 13) - Convert equatorial (RA/Dec) to horizontal (Alt/Az)
  4. Zenithal Projection - Map altitude/azimuth to circular display

Discoveries and Refinements

During development, several refinements were made to improve the display:

  1. Magnitude limit: Reduced from 6.5 to 4.0 (513 → 230 visible stars) for cleaner constellation patterns
  2. Character mapping: Adjusted from @ # * + o : . to @ * + , . for better visual hierarchy
  3. Orientation: Fixed projection so North is at top, East on left (standard planisphere orientation)
  4. Character choice: Changed : to , for magnitude 2.5-3.5 stars (colon looked like two separate dots)

Star Magnitude Scale

Character Magnitude Examples
@ < 0.5 Sirius (-1.46), Canopus (-0.72)
* < 1.5 Vega (0.03), Capella (0.08), Arcturus (-0.05)
+ < 2.5 Polaris (1.98), Castor (1.58)
, < 3.5 Visible naked-eye stars
. < 4.0 Faint naked-eye stars

References

  • Meeus, Jean. Astronomical Algorithms. Willmann-Bell, 1991.
  • Meeus, Jean. Astronomical Formulae for Calculators. Willmann-Bell, 1979.
  • Hoffleit, D. and Jaschek, C. The Bright Star Catalogue, 5th ed. Yale University Observatory, 1991.

License

This recreation is provided for educational and nostalgic purposes.

Author

Originally written circa 1978 on a PDP-11/VAX at Charlottetown, PEI. Recreated January 2026 with assistance from Claude.