Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions astro_data/corrections/collinder.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ why = "collinder2.txt gives NGC 457 the one name 'Owl or E.T. Cluster', which is
sources = ["https://en.wikipedia.org/wiki/NGC_457"]
names.remove = ["Owl or E.T. Cluster"]

["IC 2602"]
why = "collinder2.txt's 'Theta Carinae Cluster, Southern Pleiades' is two names in one string; the sky object already carries 'Southern Pleiades'."
sources = ["https://en.wikipedia.org/wiki/IC_2602"]
names.remove = ["Theta Carinae Cluster, Southern Pleiades"]

["Col 208"]
why = "collinder.txt names Collinder 208 'IC 2488' and gives IC 2488's magnitude (7.4) and size (18'), but a Dec of -57 40, 43' south of IC 2488 (SIMBAD 09 27 25.7 -57 00 14), so the match guard rejects the join: a Dec slip in Collinder."
sources = ["https://simbad.cds.unistra.fr/simbad/sim-id?Ident=IC%202488"]
Expand Down
20 changes: 0 additions & 20 deletions astro_data/corrections/sac_multistars.toml
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,6 @@ why = "SAC names xi Peg 'Menkib', which is xi Per's name (IAU WGSN). xi Peg's ow
sources = ["https://www.pas.rochester.edu/~emamajek/WGSN/IAU-CSN.txt"]
names.remove = ["Menkib"]

["SaM 1633"]
why = "SAC lists Fomalhaut as a double, so the D* rule types it D*. Its 14 mag companion at 30\" is See's lambda 478, which Burnham showed is a field star, and WDS has dropped it (Mamajek et al. 2013)."
sources = [
"WDS, wds_precise.txt as shipped in PiFinder astro_data/WDS (GSU/USNO, 2025-09): 22577-2937 KAL 1, SHY 106, MAM 1 only",
"https://arxiv.org/pdf/1310.0764 (Mamajek et al. 2013, Fomalhaut C, section on See 1898)",
"https://en.wikipedia.org/wiki/Fomalhaut",
]
obj_type = "*"
was.obj_type = "D*"

["SaM 1745"]
why = "SAC lists zeta Scl as a double, so the D* rule types it D*. Its only pair, B 631, is flagged X (dubious) in WDS."
sources = [
Expand All @@ -346,16 +336,6 @@ sources = [
obj_type = "*"
was.obj_type = "D*"

["SaM 1241"]
why = "SAC lists Vega AB, so the D* rule types Vega D*. Its WDS companions are all field stars: H 5 39 AB 9.5 at 85\" (U, non-physical), STFB 9 AC 11.0 at 79\" and AE 9.5 at 83\" (S), and faint MET 11 stars, so to an observer it is a single star (the audit: * equally acceptable; planned in #683)."
sources = [
"WDS, wds_precise.txt as shipped in PiFinder astro_data/WDS (GSU/USNO, 2025-09)",
"Hipparcos I/239 hip_main.dat (PiFinder astro_data), CCDM fields H55-H62",
"Bright Star Catalogue V/50 via VizieR",
]
obj_type = "*"
was.obj_type = "D*"

["SaM 693"]
why = "SAC's STF 2576 row (8.0/8.0 at 19 46.0 +33 36) lies about 5' from its star, outside the cross-match's 3' radius, and no WDS row names it. STF 2576 AB is HD 186858 = HIP 97222 (V 7.66, K5V+K5V), WDS 19464+3344 FG at 19 45 33.5 +33 36 07."
sources = [
Expand Down
9 changes: 9 additions & 0 deletions astro_data/corrections/steinicke.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,15 @@ sources = [
]
same_as = "NGC 6679"

["NGC 771"]
why = "Steinicke lists NGC 771 as a star, apart from the star it is. Corwin: NGC 771 = 50 Cassiopeiae is a star, a normal A1 V star with no nebulosity on the POSS1 (JH suspected it once). 50 Cas is HIP 9598, IAU name Gang, the Named Stars listing Nam 9598."
sources = [
"http://haroldcorwin.net/ngcic/ngconly.txt",
"http://haroldcorwin.net/ngcic/ngcnotes.all",
"https://simbad.cds.unistra.fr/simbad/sim-id?Ident=NGC%20771",
]
same_as = "Nam 9598"

["NGC 6885"]
why = "NGC 6885 = NGC 6882 (Corwin, OpenNGC, Steinicke): one open cluster around 20 Vul. Steinicke's shared position is 5' north-west of Corwin's and OpenNGC's centre, 20 12 00 +26 30.2."
sources = [
Expand Down
Binary file modified astro_data/pifinder_objects.db
Binary file not shown.
65 changes: 40 additions & 25 deletions docs/ax/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,13 @@ without committing the data (9.7), copy the result out and restore the
tracked file with `git checkout -- astro_data/pifinder_objects.db`
before the next build.

> **Status (2026-11-08).** Parts of this section describe the import as
> the catalog-audit fixes leave it, not as `main` has it today. The
> supplementary sources (9.4) — Hipparcos, WGSN, Bica and RC3 — are in
> `catalog_imports/supplementary_sources.py`.
> The designation allowlist, the match guard (9.3) and precedence (9.1)
> are in `catalog_imports/catalog_import_utils.py`, the star cross-match
> (9.3) in `catalog_imports/star_identity.py`. The correction pass
> (9.5) is in `catalog_imports/corrections.py`, and
> `astro_data/corrections/` holds no corrections yet.
> The decision record is [ADR 0046](../adr/0046-catalog-corrections-cited-checked-applied-last.md).
The committed database is a build of the import this section describes.
The designation allowlist, the match guard (9.3) and precedence (9.1)
are in `catalog_imports/catalog_import_utils.py`, the star cross-match
(9.3) in `catalog_imports/star_identity.py`, the supplementary sources
(9.4) in `catalog_imports/supplementary_sources.py`, and the correction
pass (9.5) in `catalog_imports/corrections.py`. The decision record is
[ADR 0046](../adr/0046-catalog-corrections-cited-checked-applied-last.md).

### 9.1 Pipeline

Expand Down Expand Up @@ -586,6 +583,24 @@ Arp 79's NGC 5490C, a galaxy of its own 4.8′ from NGC 5490, does not. A
source can mean either by the letter, so every other loader keeps the
strict default, where "NGC 4676A" is a plain name.

**A loader writes its source's designations out before they are akas.**
The allowlist reads "NGC 581", not the "581 (M103)" of `collinder.txt`,
which would stay a plain name and leave Col 14 a second sky object beside
M 103. So the Collinder loader reads its two name columns
(`collinder_names`):

- `collinder.txt`'s "NGC/Other Cat." holds a designation, often with a
second one in parentheses: "581 (M103)" is "NGC 581" and "M 103",
"IC4725 (M25)" is "IC 4725" and "M 25", "Tr.9" is "Trumpler 9". A part of
an NGC object ("2384a") is the name "NGC 2384a", which joins nothing.
- A cross-reference that the source marks wrong ("(incorrectly) 3247")
gives no aka, so it can never join. Nor does a placeholder ("nl"), the
Flamsteed numbers of a cluster's stars ("4-5 Vul."), or text in
parentheses that is not one designation ("(Mel 72 per A/H)").
- `collinder2.txt`'s "Other names" is a comma-separated list, and each
item is a name: Col 399 is "Al Sufi's Cluster", "Brocchi's Cluster" and
"Coathanger".

**Stars are identified by Hipparcos number.** The star-identity stage
cross-matches every sky object that carries a listing of a star catalog
(Str, SaM, SaR, TLK, RDS, WDS) to `hip_main.dat`, and merges the sky
Expand Down Expand Up @@ -724,20 +739,20 @@ RASC's doubles (RDS), or a WDS pair that is a double star lists it;
otherwise `*`. Each loader types its own listings by the rule — SaM and
RDS `D*`; Str, SaR and TLK `*`; a WDS listing `D*` when one of its pairs
is a double star — and a merged star is `D*` if any of its sky objects
was. A WDS pair is a double star if WDS flags it neither optical
(S, U, Y, L) nor dubious (X), it includes the primary (its components
are blank or start with A), and its companion is one an observer would
look for: between 0.5″ and 60″ from the primary and within 5 mag of it
(Rich's choice, 2026-10; the limits are named constants in
`wds_loader.py`). Closer pairs are interferometric, split by no observer
(Capella, Algol, Dschubba). WDS lists every pair
ever measured, and many it has never flagged are faint field stars:
without those limits nearly every bright star would be a double
(Alphard's 9.7 mag companion at 284″, Vega's 12 mag survey stars).
Hipparcos's CCDM letter is blank for wide pairs and for pairs it could
not resolve (Sirius, Polaris, Antares), so neither decides by itself.
SAC lists Vega and Fomalhaut, so the rule makes them `D*`; their
companions are field stars, and corrections make them `*`.
was. A WDS pair is a double star unless WDS notes it as dubious (X) or
gives no magnitude for its companion: optical pairs (S, U, Y, L) count,
and so do pairs without the primary (BC), and pairs however close, wide
or unequal. WDS lists a pair because someone measured it as one, so the
type says what the object is; whether an observer can see the companion
is for the filters (a double filters by its brighter star, 2.2) and for
the separation and both magnitudes the entry shows. This follows
mrosseel's review of #697 (2026-11). The earlier rule kept only
unflagged pairs with the primary, 0.5″ to 60″ apart and within 5 mag,
and typed 40,788 of WDS's 131,303 listings `*`; the rule now types
10,597 `*`, nearly all because their only pairs are flagged X. Vega
(optical companions) and Fomalhaut (SHY 106, its wide companion TW PsA)
are `D*` by WDS, as SAC lists them. ζ Scl, which SAC lists but whose only
WDS pair (B 631) is flagged X, has a correction that makes it `*`.

A **not-found** NGC/IC number (Steinicke's status 10, about 300 of
them) keeps its listing, its nominal position and type `?`, and its
Expand Down Expand Up @@ -939,7 +954,7 @@ of strings is ordered by Python's per-process hash seed and is not.

### 9.7 Committing the database

The committed `pifinder_objects.db` is about 23 MB compressed, and a
The committed `pifinder_objects.db` is about 24 MB compressed, and a
fielded unit's update downloads every version of it that was committed
since its last one. Commit a rebuilt database only in a pull request
that means to change the data, and batch import changes so one rebuild
Expand Down
2 changes: 1 addition & 1 deletion docs/ax/catalog/CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ An NGC or IC number with nothing at Dreyer's position (Steinicke's status 10). I
_Avoid_: nonexistent object (OpenNGC's `NonEx`; some are later identified), missing object, phantom.

**Double star** (`D*`):
A star with a companion worth looking for: one an observer's double-star list (SAC, RASC) lists, or a WDS pair that is neither optical nor dubious, includes the star as its primary, and has its companion between 0.5″ and 60″ from it and within 5 mag of it (Rich's choice: WDS's unflagged pairs include many faint field stars, and interferometric pairs no observer can split). What the device's "double star" type filter finds. A star that WDS lists only with optical companions (Vega) is a single star (`*`).
A star that a double-star list names as a pair: an observer's double-star list (SAC, RASC) lists it, or WDS lists it in a pair that WDS does not note as dubious (X) and that has a companion magnitude. Optical pairs count, as do pairs without the star as primary and pairs however close, wide or unequal: the type says what the object is, and whether the companion is visible is for the filters and for the separation and magnitudes the entry shows (mrosseel's review of #697). What the device's "double star" type filter finds. A star that WDS lists only in dubious pairs (ζ Scl) is a single star (`*`).
_Avoid_: binary (that's physical, and some listed pairs aren't proven binaries), multiple star.

**Common name**:
Expand Down
122 changes: 108 additions & 14 deletions python/PiFinder/catalog_imports/specialized_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import csv
import json
import logging
import re
import sqlite3
from pathlib import Path
from typing import List, Optional
from tqdm import tqdm
from collections import namedtuple, defaultdict

Expand Down Expand Up @@ -97,6 +99,110 @@ def load_egc():
conn.commit()


# collinder.txt abbreviates the catalogs that it cites, and collinder2.txt
# writes them in full. Keyed on the lowercase prefix; a bare number is NGC.
_COLLINDER_CATALOGS = {
"": "NGC",
"ic": "IC",
"m": "M",
"tr": "Trumpler",
"trumpler": "Trumpler",
"mel": "Melotte",
"melotte": "Melotte",
"harv": "Harvard",
"harvard": "Harvard",
}

# A designation in collinder.txt's "NGC/Other Cat." column: "581", "IC1848",
# "M45", "Tr.9", "Mel 15", "Harvard 8", and a part of an NGC object, "2384a".
_COLLINDER_DESIGNATION_RE = re.compile(r"([A-Za-z]*)\.?\s*(\d+)([a-z]?)")

# "581 (M103)", "(Harvard 8)": a value, then a second one in parentheses.
_COLLINDER_PARENTHESES_RE = re.compile(r"([^()]*)\(([^()]*)\)")

# "4-5 Vul.", "9-12 Gem": the Flamsteed numbers of a cluster's bright stars.
_COLLINDER_STAR_GROUP_RE = re.compile(r"\d+-\d+ [A-Z][a-z]{2}\.?")

# "nl": not listed.
_COLLINDER_PLACEHOLDERS = frozenset({"", "nl", "-"})

# The mark on a cross-reference of Collinder's that is wrong.
_COLLINDER_WRONG = "(incorrectly)"


def collinder_designation(text: str) -> Optional[str]:
"""A designation of collinder.txt written out, or None if text is not one.

"581" -> "NGC 581", "IC1848" -> "IC 1848", "Tr.9" -> "Trumpler 9",
"2384a" -> "NGC 2384a". A catalog that the file does not abbreviate
("Markarian 18") is not read here: it stays a name as written.
"""
match = _COLLINDER_DESIGNATION_RE.fullmatch(text.strip())
if match is None:
return None
prefix, number, part = match.groups()
catalog = _COLLINDER_CATALOGS.get(prefix.lower())
if catalog is None:
return None
return f"{catalog} {int(number)}{part}"


def collinder_other_catalogs(raw: str) -> List[str]:
"""The names that collinder.txt's "NGC/Other Cat." column gives a cluster.

The column holds a designation ("581", "IC1848", "Tr.9"), often with a
second one in parentheses ("581 (M103)"), or a name ("Orion Cluster").
Each designation is written out, so one of a PiFinder catalog joins its
sky object. These are not names, and give nothing:

- a placeholder ("nl");
- a cross-reference marked wrong ("(incorrectly) 3247"): the cluster is
not NGC 3247, so it must not join it;
- the Flamsteed numbers of a cluster's stars ("4-5 Vul.");
- text in parentheses that is not one designation ("(PMC)",
"(Mel 72 per A/H)"): a note.
"""
text = " ".join(raw.split())
if text.lower() in _COLLINDER_PLACEHOLDERS or text.startswith(_COLLINDER_WRONG):
return []
value, note = text, ""
match = _COLLINDER_PARENTHESES_RE.fullmatch(text)
if match is not None:
value, note = (part.strip() for part in match.groups())
names = []
if value and not _COLLINDER_STAR_GROUP_RE.fullmatch(value):
designation = collinder_designation(value)
if designation is None:
# A name. A final "Cl." can only be "Cluster" ("Antares Cl.").
designation = re.sub(r"\bCl\.$", "Cluster", value)
names.append(designation)
noted = collinder_designation(note) if note else None
if noted is not None:
names.append(noted)
return names


def collinder_other_names(raw: str) -> List[str]:
"""The names that collinder2.txt's "Other names" column gives a cluster.

The column is a comma-separated list ("Beehive Cluster, Praesepe"). A
footnote mark ("[note 1]") is not a name.
"""
names = (name.strip() for name in raw.split(","))
return [name for name in names if name and not name.startswith("[note")]


def collinder_names(other_catalogs: str, other_names: str) -> List[str]:
"""A Collinder listing's names from both files, in order, each one once."""
names: List[str] = []
for name in collinder_other_catalogs(other_catalogs) + collinder_other_names(
other_names
):
if name not in names:
names.append(name)
return names


def load_collinder():
logging.info("Loading Collinder")
catalog = "Col"
Expand All @@ -122,8 +228,6 @@ def load_collinder():
dfs = line.split("\t")
sequence = dfs[0].split(" ")[0]
other_names = dfs[1]
if other_names.isnumeric():
other_names = "NGC " + other_names

ra = dfs[3]
ra_h = int(ra[0:2])
Expand All @@ -142,7 +246,7 @@ def load_collinder():

collinder = Collinder(
sequence=sequence,
other_names=other_names.strip(),
other_names=other_names,
ra_deg=ra_deg,
dec_deg=dec_deg,
size=size,
Expand All @@ -169,18 +273,8 @@ def load_collinder():
mag = MagnitudeObject([])
else:
mag = MagnitudeObject([float(mag)])
other_names = dfs[2].strip()
c_tuple = c_dict[sequence]

# Collect all valid names more efficiently
aka_names = []
if c_tuple.other_names and not c_tuple.other_names.startswith(
("[note", "Tr.", "Harv.", "Mel.")
):
aka_names.append(c_tuple.other_names)

if other_names and not other_names.startswith("[note"):
aka_names.append(other_names)
aka_names = collinder_names(c_tuple.other_names, dfs[2])

new_object = NewCatalogObject(
object_type=obj_type,
Expand Down
43 changes: 15 additions & 28 deletions python/PiFinder/catalog_imports/wds_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,38 +126,25 @@ def wds_magnitudes(mag1: float, mag2: float) -> MagnitudeObject:
return MagnitudeObject(mags)


# The D* rule's WDS clause (docs/ax/catalog.md §9.3): WDS lists every pair
# ever measured, so a pair makes a double star only if WDS flags it neither
# optical (S, U, Y, L) nor dubious (X), it includes the primary, and its
# companion is one an observer would look for: within this separation and
# magnitude difference of the primary, and wide enough to split (Capella's
# and Algol's interferometric pairs are not). Vega's companions fail,
# Propus's BU 1008 (6.2 at 1.9") passes. The limits are Rich's choice
# (2026-10), his to tune.
OPTICAL_OR_DUBIOUS = frozenset("SUYLX")
DOUBLE_MIN_SEPARATION_ARCSEC = 0.5
DOUBLE_MAX_SEPARATION_ARCSEC = 60.0
DOUBLE_MAX_DELTA_MAG = 5.0
# The D* rule's WDS clause (docs/ax/catalog.md §9.3): a WDS listing is a
# double star if any of its pairs is one. WDS lists a pair because someone
# measured it as a pair, so every pair is a double, optical (S, U, Y, L) or
# not, with the primary or without (BC), however close, wide or unequal.
# The type says what the object is; whether an observer can see the
# companion is for the filters (a double filters by its brighter star) and
# for the separation and both magnitudes on the entry. Only a pair WDS
# notes as dubious (X), and a pair without a companion's magnitude, are not
# doubles. This follows mrosseel's review of #697 (2026-11); before it, the
# rule kept only unflagged pairs with the primary, 0.5-60" apart and within
# 5 mag, and typed 40,788 of WDS's 131,303 listings single.
DUBIOUS = "X"


def is_double_star_pair(value) -> bool:
"""Whether one WDS pair makes its primary a double star (D*)."""
if set(value["Notes"]) & OPTICAL_OR_DUBIOUS:
"""Whether one WDS pair makes its listing a double star (D*)."""
if DUBIOUS in value["Notes"]:
return False
components = value["Components"].strip()
if components and not components.startswith("A"):
return False
sep = value["Sep"].item()
if np.isnan(sep) or not (
DOUBLE_MIN_SEPARATION_ARCSEC <= sep <= DOUBLE_MAX_SEPARATION_ARCSEC
):
return False
mag1, mag2 = value["Mag_First"].item(), value["Mag_Second"].item()
if np.isnan(mag2):
return False
# WDS gives magnitudes to 0.01, so compare the difference at that
# precision: 18.6 - 13.6 is 5.000000000000002 in floating point.
return bool(np.isnan(mag1) or round(mag2 - mag1, 2) <= DOUBLE_MAX_DELTA_MAG)
return not np.isnan(value["Mag_Second"].item())


def wds_dm_number(raw: str) -> Optional[Tuple[str, int, int]]:
Expand Down
Loading
Loading