PERSONAL DEEP-SKY CATALOG
=========================

A self-contained website for planning observing sessions and displaying your
own astrophotography. One catalog covers the Messier list (110 objects), the
New General Catalogue (NGC) and the Index Catalogue (IC), about 12,600 objects
in all. A "Deep Sky Compass" shows what is above the horizon in any direction
you face.

Default observing site: Forked River, NJ (can be changed in the page).


FOLDER LAYOUT
-------------

  deepsky-catalog-standalone/
    index.html             The site: page layout, styles and code
    catalog-data.js        Every NGC and IC object (from OpenNGC; don't edit)
    catalog-core.js        Names, cross-references and photo matching (shared)
    photo-info.js          Your photo list, dates and exposures
                           (made by build-photo-info.html)
    build-photo-info.html  Rebuilds photo-info.js from your photos
    catalog-images/        Your photos, all catalogs in one folder
    readme.txt             This file

There is no build step, no server-side code and no database. The only
external resource is Google Fonts; without an internet connection the page
falls back to system fonts and still works.


THE TWO TABS
------------

1. CATALOG
   - Pick a catalog with the buttons at the top: All, Messier, NGC or IC.
     Each button shows how many objects you have photographed.
   - An object listed in more than one catalog is one entry. The Orion
     Nebula is M42 and also NGC 1976: it appears under Messier and NGC, and
     each view shows the designation from that catalog first.
   - All, NGC and IC list the objects you have photographed. Messier lists
     all 110, with a dashed placeholder for the ones still to photograph, and
     a "Not yet photographed" switch.
   - Search box: type any designation or common name, in any case, with or
     without spaces: m42, M 42, ngc7000, NGC 7000, ic434, "orion",
     "north america". Search covers the whole catalog, photographed or not.
     Press Enter on an exact match to open it.
   - Filter by season, constellation or object type (galaxies, clusters,
     nebulae, stars, other). Sort by catalog number, newest photo,
     culmination time or brightness.
   - Set the night, latitude and longitude to see each object's culmination
     time, altitude, rise/set and whether it is in darkness or twilight.
   - Click a photo for the viewer: the full image beside the object's
     designations, type, constellation, coordinates, magnitude, size,
     distance, rise/set times, and the date and exposure of the photo.
     Prev/Next and the arrow keys step through the list. "Find in Compass"
     turns the compass to the object.
   - "Best Tonight" lists the objects that culminate between sunset and dawn
     on the chosen night, with Save As... and Print. Click a row to open it.
   - "Browse a photo folder..." previews photos from any folder on your
     computer for the visit. Nothing is copied or uploaded.

2. COMPASS
   - Pick a direction on the dial (or tap "Use phone compass" on a phone or
     tablet) to see which Messier, NGC and IC objects are up in that part of
     the sky right now or at any chosen date and time.
   - Every object you have photographed is on the compass, along with all
     Messier objects and a list of well-known NGC and IC objects.
   - The Photo column shows a thumbnail of your photo; click it, or "Open",
     to see the object in the Catalog tab.
   - Catalog checkboxes (Messier, NGC, IC), view width, lowest altitude,
     faintest magnitude, "only objects without a photo", sorting, and a red
     night-vision mode.

The observing site (latitude/longitude) is shared by both tabs. North and
east are positive; west longitudes are negative (Forked River is about
39.8, -74.2). The page remembers your last tab, catalog, sort order and
Compass settings in the browser.

Each view has its own address, so you can bookmark or link to it:
  index.html#catalog   index.html#messier   index.html#ngc   index.html#ic
  index.html#compass
and any object opens directly from its designation or name:
  index.html#M42   index.html#NGC7000   index.html#ic434   index.html#Orion-Nebula


NAMING YOUR PHOTOS
------------------

Put every photo, from any catalog, in catalog-images/. The file name says
which object the photo shows. Upper or lower
case doesn't matter, and spaces, dashes, underscores and leading zeros are
ignored.

  Catalog      Standard name     Also accepted
  -------      -------------     -------------
  Messier      M42.jpg           m42.jpg  M 42.jpg  Messier 42.jpg  M042.jpg
  NGC          NGC7000.jpg       ngc7000.jpg  NGC 7000.jpg  ngc-7000.jpg
                                 ngc0224.jpg
  IC           IC434.jpg         ic434.jpg  IC 434.jpg  ic0434.jpg
  Common name  Orion Nebula.jpg  orion-nebula.jpg  The Pleiades.jpg
                                 M42 Orion Nebula.jpg
                                 Andromeda Galaxy (M31).jpg

Common names come from the Messier list, OpenNGC and a list of well-known
objects, so "Heart Nebula.jpg", "Double Cluster.jpg", "Veil Nebula.jpg" and
"Bode's Galaxy.jpg" all work. A trailing number or word such as
"Orion Nebula 2.jpg" or "Orion Nebula final.jpg" is ignored.

If an object has two photos (M31.jpg and NGC224.jpg, say), the one named by
designation is used. JPEG, PNG and WebP are accepted. Keep photos around
1,500-2,500 px on the long side and under about 1 MB so pages load quickly.

Photos that don't match any object are listed under "How photos are named"
at the bottom of the Catalog tab, and in the photo info builder.


PHOTO-INFO.JS: THE PHOTO LIST, DATES AND EXPOSURES
--------------------------------------------------

Each photo's frame and viewer show when it was taken and its total exposure
(e.g. "23m 50s (143 x 10s)"), read from the photo's own EXIF data.
Vespera/Stellina timestamps are stored in UTC and shown in your local time.
Photos from older Vespera firmware record only the number of stacked
sub-exposures; they show "368 subs" (for example). If a photo editor has
damaged the EXIF data, the page ignores the damaged values and falls back to
what it can still read.

photo-info.js holds the same details plus the list of photo files. The page
uses it to find your photos when index.html is opened straight from disk
(browsers won't let a page list or read local files) and on web hosts that
don't show folder contents. Rebuild it whenever you add, rename or remove
photos:

  1. Open build-photo-info.html.
  2. Choose this folder. Check the list: every photo, the object it matched,
     the date and exposure, and any file that didn't match.
  3. Click "Save photo-info.js". Chrome and Edge save it straight into the
     folder; other browsers download it, and you move it next to index.html.

Without an up-to-date photo-info.js the page still works: on a web server it
reads the folder listing (or a files.txt in catalog-images/, one file name per
line); opened from disk it tries the standard names (M42.jpg, NGC7000.jpg,
IC434.jpg) one by one, which takes a little longer and can't find photos
named only by common name.


VIEWING THE SITE
----------------

On your own computer:
  Double-click index.html, or drag it into Chrome, Safari, Firefox or Edge.

Better (behaves like the live site), from Terminal in this folder:
  python3 -m http.server 8000
  then open  http://localhost:8000/

On a web host:
  Upload index.html, catalog-data.js, catalog-core.js, photo-info.js,
  build-photo-info.html and catalog-images/ to the same folder.
  No database or PHP is needed. Don't upload the .DS_Store files; they are
  Mac Finder clutter.


DATA NOTES
----------

- NGC and IC data come from OpenNGC (github.com/mattiaverga/OpenNGC,
  CC BY-SA 4.0). Messier data (seasons, distances, sizes) is curated.
- Distances are approximate: curated values for Messier objects and
  well-known nearby objects, otherwise Hubble-flow estimates
  (H0 = 70 km/s/Mpc) from radial velocity. Physical size = angular size x
  distance.
- Positions use J2000 coordinates precessed to the chosen date, without
  atmospheric refraction: accurate to about a quarter degree.
- Sun and Moon use low-precision formulas (Moon within about 1 degree).
- "Dark" means astronomical twilight has ended (Sun below -18 degrees).
- Times are shown in the time zone of the device viewing the page.
- Magnitudes are integrated; large galaxies and nebulae look fainter than
  their number suggests.
- The phone compass needs a device with a magnetometer, and on iPhone/iPad
  the site must be opened over https:// for the compass permission prompt.


EDITING
-------

index.html holds the layout, styles and the code for the two tabs.
catalog-core.js holds the naming rules, the Messier list, the list of
well-known NGC/IC objects, and the EXIF reader; index.html and
build-photo-info.html both use it. catalog-data.js is generated from OpenNGC
and shouldn't be edited by hand.

Earlier versions kept photos in two folders, messier-images/ and ngc-images/.
The page still reads those if they exist, but new photos belong in
catalog-images/.
