starcat Module

class starcat.Star[source]

Bases: object

A holder for star attributes.

This is the base class that defines attributes common to all or most star catalogs. Note that fields vary among star catalogs and individual stars and there is no guarantee a particular field will be filled in.

__getattr__(name: str) Any[source]
__init__() None[source]

Constructor for Star; additional attributes are available from subclasses.

__str__() str[source]

Return str(self).

static bmv_from_sclass(sclass: str) float | None[source]

Return a star’s B-V color given its spectral class.

Parameters:

sclass – The spectral class.

Returns:

The B-V color associated with the spectral class.

from_dict(d: dict[str, Any]) None[source]

Set the attributes for this star based on the dictionary.

ra_dec_with_pm(tdb: float) tuple[float, float] | tuple[None, None][source]

Return the star’s RA and DEC adjusted for proper motion.

If no proper motion is available, the original RA and DEC are returned.

Parameters:

tdb – The time since the J2000 epoch in seconds.

Returns:

A tuple containing the RA and DEC adjusted for proper motion, if possible.

static sclass_from_bv(b: float, v: float) str | None[source]

Return a star’s spectral class given photometric B and V.

Parameters:
  • b – The photometric B value.

  • v – The photometric V value.

Returns:

The spectral class, if available.

static temperature_from_sclass(sclass: str | None) float | None[source]

Return a star’s temperature (K) given its spectral class.

Parameters:

sclass – The spectral class.

Returns:

The temperature associated with the spectral class.

to_dict() dict[str, Any][source]

Return a dictionary containing all star attributes.

unique_number: int | None

Unique catalog number (may not be unique across catalogs)

ra: float | None

Right ascension at J2000 epoch (radians)

ra_sigma: float | None

Right ascension uncertainty (radians)

rac_sigma: float | None

Right ascension * cos(DEC) uncertainty (radians)

dec: float | None

Declination at J2000 epoch (radians)

dec_sigma: float | None

Declination uncertainty (radians)

vmag: float | None

Visual magnitude

vmag_sigma: float | None

Visual magnitude uncertainty

pm_ra: float | None

Proper motion in RA (radians/sec)

pm_ra_sigma: float | None

Proper motion in RA uncertainty (radians/sec)

pm_rac: float | None

Proper motion in RA * cos(DEC) (radians/sec)

pm_rac_sigma: float | None

Proper motion in RA * cos(DEC) uncertainty (radians/sec)

pm_dec: float | None

Proper motion in DEC (radians/sec)

pm_dec_sigma: float | None

Proper motion in DEC error (radians/sec)

spectral_class: str | None

Spectral class

temperature: float | None

Star temperature (usually derived from spectral class)

class starcat.StarCatalog[source]

Bases: object

__init__() None[source]
count_stars(**kwargs: Any) int[source]

Count the stars that match the given search criteria.

find_stars(ra_min: float = 0, ra_max: float = 6.283185307179586, dec_min: float = -1.5707963267948966, dec_max: float = 1.5707963267948966, vmag_min: float | None = None, vmag_max: float | None = None, full_result: bool = True, **kwargs: Any) Iterator[Star][source]

Yield the stars that match the given search criteria.

Parameters:
  • ra_min – The minimum RA.

  • ra_max – The maximum RA.

  • dec_min – The minimum DEC.

  • dec_max – The maximum DEC.

  • vmag_min – The minimum visual magnitude.

  • vmag_max – The maximum visual magnitude.

  • full_result – If True, fill in all available fields of the resulting Star. If False, some fields will not be filled in to save time. This is most useful when counting stars.

Yields:

The Star objects that meet the given constraints.

class starcat.SpiceStar[source]

Bases: Star

A holder for star attributes.

This class includes attributes unique to stars in SPICE catalogs.

A SpiceStar only supports these attributes: unique_number, ra, ra_sigma, dec, dec_sigma, vmag, spectral_class, temperature

__init__() None[source]

Constructor for Star; additional attributes are available from subclasses.

class starcat.SpiceStarCatalog(name: str, dir: str | Path | FCPath | None = None)[source]

Bases: StarCatalog

__init__(name: str, dir: str | Path | FCPath | None = None) None[source]

Create a SpiceStarCatalog.

Parameters:
  • name – The name of the SPICE catalog without the extension, such as hipparcos, ppm, or tycho2.

  • dir – The path to the star catalog directory (may be a URL). Within this directory should be the kernels for the requested name (name.dbd and name.xdb).

class starcat.UCAC4Star[source]

Bases: Star

A holder for star attributes.

This class includes attributes unique to the UCAC4 catalog.

UCAC4_DOUBLE_STAR_FLAG_BLENDED = 3
UCAC4_DOUBLE_STAR_FLAG_COMP1 = 1
UCAC4_DOUBLE_STAR_FLAG_COMP2 = 2
UCAC4_DOUBLE_STAR_FLAG_SINGLE = 0
UCAC4_DOUBLE_STAR_FLAG_STRINGS = ['SINGLE', 'COMP1', 'COMP2', 'BLENDED']
UCAC4_DOUBLE_STAR_TYPE_1PEAK = 1
UCAC4_DOUBLE_STAR_TYPE_1PEAK_FIT = 4
UCAC4_DOUBLE_STAR_TYPE_2PEAK = 2
UCAC4_DOUBLE_STAR_TYPE_2PEAK_FIT = 5
UCAC4_DOUBLE_STAR_TYPE_NONE = 0
UCAC4_DOUBLE_STAR_TYPE_SECONDARY_PEAK = 3
UCAC4_DOUBLE_STAR_TYPE_SECONDARY_PEAK_FIT = 6
UCAC4_DOUBLE_STAR_TYPE_STRINGS = ['NONE', '1PEAK', '2PEAK', 'SECONDARY_PEAK', '1PEAK_FIT', '2PEAK_FIT', 'SECONDARY_PEAK_FIT']
UCAC4_OBJ_TYPE_CLEAN = 0
UCAC4_OBJ_TYPE_EXT_HPM = 4
UCAC4_OBJ_TYPE_HPM = 3
UCAC4_OBJ_TYPE_HPM_DISCREPANT = 9
UCAC4_OBJ_TYPE_HPM_NOT_MATCHED = 8
UCAC4_OBJ_TYPE_NEAR_OVEREXPOSED = 1
UCAC4_OBJ_TYPE_POOR_PM = 5
UCAC4_OBJ_TYPE_STREAK = 2
UCAC4_OBJ_TYPE_STRINGS = ['CLEAN', 'NEAR_OVEREXPOSED', 'STREAK', 'HPM', 'EXT_HPM', 'POOR_PM', 'SUBST_ASTROMETRY', 'SUPPL', 'HPM_NOT_MATCHED', 'HPM_DISCREPANT']
UCAC4_OBJ_TYPE_SUBST_ASTROMETRY = 6
UCAC4_OBJ_TYPE_SUPPL = 7
__init__() None[source]

Constructor for Star; additional attributes are available from subclasses.

__str__() str[source]

Return str(self).

vmag_model: float | None

Fit model magnitude

obj_type: int | None

The object type used to identify possible problems with a star or the source of data: 0 = good, clean star (from MPOS), no known problem; 1 = largest flag of any image = near overexposed star (from MPOS); 2 = largest flag of any image = possible streak object (from MPOS); 3 = high proper motion (HPM) star, match with external PM file (MPOS); 4 = actually use external HPM data instead of UCAC4 observ.data (accuracy of positions varies between catalogs); 5 = poor proper motion solution, report only CCD epoch position; 6 = substitute poor astrometric results by FK6/Hip/Tycho-2 data; 7 = added supplement star (no CCD data) from FK6/Hip/Tycho-2 data, and 2 stars added from high proper motion surveys; 8 = high proper motion solution in UCAC4, star not matched with PPMXL; 9 = high proper motion solution in UCAC4, discrepant PM to PPMXL (see discussion of flags 8,9 in redcution section 2e above)

double_star_flag: bool | None

Double star flag overall classification: 0 = single star; 1 = component #1 of “good” double star; 2 = component #2 of “good” double star; 3 = blended image

double_star_type: int | None

Double star type: 0 = no double star, not sufficient #pixels or elongation to even call double star fit subroutine; 1 = elongated image but no more than 1 peak detected; 2 = 2 separate peaks detected -> try double star fit; 3 = secondary peak found on each side of primary; 4 = case 1 after successful double fit (small separ. blended image); 5 = case 2 after successful double fit (most likely real double); 6 = case 3 after successful double fit (brighter secondary picked)

galaxy_match: float | None

LEDA galaxy match flag: This flag is either 0 (no match) or contains the log10 of the apparent total diameter for I-band (object size) information (unit = 0.1 arcmin) copied from the LEDA catalog (galaxies). A size value of less than 1 has been rounded up to 1.

extended_source: bool | None

2MASS extended source flag: This flag is either 0 (no match) or contains the length of the semi-major axis of the fiducial ellipse at the K-band (object size) information copied from the 2MASS extended source catalog.

num_img_total: int | None

Total # of CCD images of this star

num_img_used: int | None

# of CCD images used for this star. A zero for the number of used images indicates that all images have some “problem” (such as overexposure). In that case an unweighted mean over all available images (na) is taken to derive the mean position, while normally a weighted mean was calculated based on the “good” images, excluding possible problem images (nu <= na).

num_cat_pm: int | None

# catalogs (epochs) used for proper motions

ra_mean_epoch: float | None

Central epoch for mean RA, minus 1900

dec_mean_epoch: int | None

Central epoch for mean Dec, minus 1900

cat_match: list[int] | None

A list of ints indicating which catalogs this star has matched against. There are 10 entries: Yale SPM, FK6-Hipparcos-Tycho, AC2000, AGK2 Bonn, AKG2 Hamburg, Zone Astrog., Black Birch, Lick Astrog., NPM Lick, and SPM YSJ1. See the comments in this file for more details.

apass_mag_b: float | None

B magnitude from APASS

apass_mag_v: float | None

V magnitude from APASS

apass_mag_g: float | None

G magnitude from APASS

apass_mag_r: float | None

R magnitude from APASS

apass_mag_i: float | None

I magnitude from APASS

apass_mag_b_sigma: float | None

Uncertainty of B magnitude from APASS

apass_mag_v_sigma: float | None

Uncertainty of V magnitude from APASS

apass_mag_g_sigma: float | None

Uncertainty of G magnitude from APASS

apass_mag_r_sigma: float | None

Uncertainty of R magnitude from APASS

apass_mag_i_sigma: float | None

Uncertainty of I magnitude from APASS

johnson_mag_b: float | None

The Johnson B magnitude derived from APASS measurements.

johnson_mag_v: float | None

The Johnson V magnitude derived from APASS measurements.

id_str: str | None

A unique name indicating the position in the UCAC4 catalog

id_str_ucac2: str | None

A unique name indicating the position in the UCAC2 catalog

class starcat.UCAC4StarCatalog(dir: str | Path | FCPath | None = None)[source]

Bases: StarCatalog

A UCAC4 star catalog.

This class adds the following options to find_stars:

require_clean (bool, default True): Return only "clean" stars. Skip stars
    that are streaks or have high proper motion that is not matched
    or discrepant.
allow_double (bool, default True): If True, include double stars.
allow_galaxy (bool, default False): If True, include galaxies.
require_pm (bool, default True): If True, only return stars with measured proper
    motion.
return_everything (bool, default False): If True, override the above options to
    return all stars and galaxies.
optimize_ra (bool, default True): Optimize searching of RA through zone files.
    Only useful for internal development.
__init__(dir: str | Path | FCPath | None = None) None[source]

Create a UCAC4StarCatalog.

Parameters:

dir – The path to the star catalog directory (may be a URL). Within this directory should be the directory u4b.

class starcat.YBSCStar[source]

Bases: Star

A holder for star attributes.

This class includes attributes unique to the YBSC catalog.

YBSC_IR_ENGLES = 1
YBSC_IR_NASA = 0
YBSC_IR_STRINGS = ['NASA', 'ENGLES', 'UNCERTAIN']
YBSC_IR_UNCERTAIN = 2
YBSC_MULTIPLE_ASTROMETRIC = 'A'
YBSC_MULTIPLE_DUPLICITY_OCCULTATION = 'D'
YBSC_MULTIPLE_DUPLICITY_SPECKLE = 'S'
YBSC_MULTIPLE_INNES = 'I'
YBSC_MULTIPLE_NONE = ' '
YBSC_MULTIPLE_ROSSITER = 'R'
YBSC_MULTIPLE_WORLEY = 'W'
YBSC_VMAG_UNCERTAINTY_HR = 'H'
YBSC_VMAG_UNCERTAINTY_HR_REDUCED = 'R'
YBSC_VMAG_UNCERTAINTY_V = ' '
__init__() None[source]

Constructor for Star; additional attributes are available from subclasses.

__str__() str[source]

Return str(self).

name: str | None

Bayer and/or Flamsteed name

durchmusterung_id: str | None

Durchmusterung identification

draper_number: int | None

Henry Draper Catalog number (out of 225300)

sao_number: int | None

SAO Catalog number (out of 258997)

fk5_number: int | None

FK5 star number

ir_source: bool | None

True if infrared source

ir_source_ref: int | None

Infrared source: NASA, ENGLES, or UNCERTAIN

multiple_star_code: str | None

Double or multiple star code: ‘A’ = Astrometric binary; ‘D’ = Duplicity discovered by occultation; ‘I’ = Innes, Southern Double Star Catalogue (1927); ‘R’ = Rossiter, Michigan Publ. 9, 1955; ‘S’ = Duplicity discovered by speckle interferometry; ‘W’ = Worley (1978) update of the IDS

aitken_designation: str | None

Aitken’s Double Star Catalog (ADS) designation

ads_components: str | None

ADS number components

variable_star_id: str | None

Variable star identification

galactic_longitude: float | None

Galactic longitude (radians)

galactic_latitude: float | None

Galactic latitude (radians)

vmag_code: str | None

Visual magnitude code: ‘ ‘ = V on UBV Johnson system; ‘R’ = HR magnitudes reduced to the UBV system; ‘H’ = original HR magnitude

vmag_uncertainty_flag: str | None

Uncertainty flag on visual magnitude

b_v: float | None

B-V color in the UBV system

b_v_uncertainty_flag: str | None

Uncertainty flag on B-V color

u_b: float | None

U-B color in the UBV system

u_b_uncertainty_flag: str | None

Uncertainty flag on U-B color

r_i: float | None

R-I color in the system indicated by r_i_code

r_i_code: str | None

Code for R-I system: ‘C’ = Cousin; ‘E’ = ‘Eggen’; ‘:’ = Unknown; ‘?’ = Unknown; ‘D’ = Unknown

spectral_class_code: str | None

Spectral class code: ‘e’, ‘v’, or ‘t’

parallax_type: str | None

Parallax type: ‘D’ = Dyanmical, otherwise Trigonometric

parallax: float | None

Parallax (arcsec); see parallax_type for measurement type

radial_velocity: float | None

Radial velocity (km/s)

radial_velocity_comments: str | None

Radial velocity comments (multiple possible): ‘V’ = Variable radial velocity; ‘V?’ = Suspected variable radial velocity; ‘SB’, ‘SB1’, ‘SB2’, ‘SB3’ = Spectroscopic binaries, single/double/triple-lined spectra; ‘O’ = Orbital data available

rotational_velocity_limit: str | None

Rotational velocity limit: ‘<’, ‘=’, or ‘>’

rotational_velocity: float | None

Rotational velocity [v sin i] (km/s)

rotational_velocity_uncertainty_flag: str | None

Rotational velocity uncertainty and variability flag: ‘ ‘, ‘:’, or ‘v’

double_mag_diff: float | None

Magnitude difference of double, or brightest multiple

double_mag_sep: float | None

Separation of components in double_mag if occultation binary (radians)

double_mag_components: str | None

Indentification of components in double_mag

multiple_num_components: int | None

Number of components assigned to a multiple

class starcat.YBSCStarCatalog(dir: str | Path | FCPath | None = None)[source]

Bases: StarCatalog

__init__(dir: str | Path | FCPath | None = None) None[source]

Create a YBSCStarCatalog.

Parameters:

dir – The path to the star catalog directory (may be a URL). Within this directory should be the file catalog.