Skip to content
Draft
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
8 changes: 7 additions & 1 deletion astrodb_utils/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def ingest_source(
dec_col_name: str = "dec_deg",
epoch_col_name: str = "epoch_year",
use_simbad: bool = True,
ignore_neighbors: bool = False,
):
"""
Parameters
Expand Down Expand Up @@ -306,6 +307,9 @@ def ingest_source(
use_simbad: bool
True (default): Use Simbad to resolve the source name if it is not found in the database
False: Do not use Simbad to resolve the source name.
ignore_neighbors: bool
False (default): Don't ignore neighbors and ingest close sources as the same source.
True: Ignore neighbors in order to ingest resolved children or close companions.

Returns
-------
Expand All @@ -315,6 +319,8 @@ def ingest_source(
"""

logger.debug(f"Trying to ingest source: {source}")
if ignore_neighbors:
use_simbad= False

# change unicode dashes characters to `-`
source = strip_unicode_dashes(source)
Expand Down Expand Up @@ -360,7 +366,7 @@ def ingest_source(
msg2 = f" Already in database as {name_matches[0]}. \n "

# Multiple source matches in the database, unable to ingest source
elif len(name_matches) > 1:
elif not ignore_neighbors and len(name_matches) > 1:
msg2 = f" More than one match for {source}\n {name_matches}\n"

exit_function(msg1 + msg2, raise_error)
Expand Down