sora.star

The Star Class

class sora.Star(catalogue='gaiaedr3', **kwargs)[source]

Defines a star.

Parameters
  • catalogue (str) – The catalogue to download data. It can be 'gaiadr2' or 'gaiaedr3'.

  • code (str) – Gaia Source code for searching in VizieR.

  • coord (str, astropy.coordinates.SkyCoord) – If code is not given, coord nust have the coordinates RA and DEC of the star to search in VizieR: 'hh mm ss.ss +dd mm ss.ss'.

  • ra (int, float) – Right Ascension, in deg.

  • dec (int, float) – Declination, in deg.

  • parallax (int, float. default=0) – Parallax, in mas.

  • pmra (int, float, default=0) – Proper Motion in RA*, in mas/year.

  • pmdec (int, float, default=0) – Proper Motion in DEC, in mas/year.

  • rad_vel (int, float, default=0) – Radial Velocity, in km/s.

  • epoch (str, astropy.time.Time, default=’J2000’) – Epoch of the coordinates.

  • nomad (bool) – If True, it tries to download the magnitudes from NOMAD catalogue.

  • bjones (bool, default=True) – If True, it uses de star distance from Bailer-Jones et al. (2018).

  • verbose (bool, default=True) – If True, it prints the downloaded information

  • local (bool, default=False) – If True, it uses the given coordinate in ‘coord’ as final coordinate.

Note

The user can give either ‘coord’ or ‘ra’ and ‘dec’, but not both.

To download the coordinates from Gaia, “local” must be set as False and the (“code”) or (“coord”) or (“ra” and “dec”) must be given.

All values downloaded from Gaia will replace the ones given by the user.

add_offset(da_cosdec, ddec)[source]

Adds an offset to the star position.

Parameters
  • da_cosdec (int, float) – Offset in Delta_alpha_cos_delta, in mas.

  • ddec (int, float) – Offset in Delta_delta, in mas.

apparent_diameter(distance, mode='auto', band='V', star_type='sg', verbose=True)[source]

Calculates the apparent diameter of the star at a given distance.

Parameters
  • distance (int, float) – Object geocentric distance, in AU.

  • mode (str, default=’auto’) –

    The mode to calculate the apparent diameter.

    • 'user': calculates using user given diameter.

    • 'gaia': calculates using diameter obtained from Gaia.

    • 'kervella': calculates using Kervella equations.

    • 'van_belle': calculates using van Belle equations.

    • 'auto': tries all the above methods until it is able to calculate diameter.

    The order of try is the same as shown above (user, Gaia, Kervella, Van Belle).

  • band (str) – The band filter to calculate the diameter. If mode is kervella or van_belle, the filter must be given, 'B' or 'V'. If mode auto, 'V' is selected.

  • star_type (str) –

    Type of star to calculate the diameter. If mode is van_belle, the star type must be given. If mode is auto, star_type='sg'.

    Accepted types:

    • 'sg' for ‘Super Giant’.

    • 'ms' for ‘Main Sequence’.

    • 'vs' for ‘Variable Star’.

  • verbose (bool) – If True, it prints the mode used by auto.

barycentric(time)[source]

Calculates the position of the star using proper motion.

Parameters

time (str, astropy.time.Time) – Reference time to apply proper motion. It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.

error_at(time)[source]

Estimates the star position error at a given time.

Parameters

time (str, astropy.time.Time) – Reference time to project star error. It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.

Returns

errors – In RA* and DEC.

Return type

list

geocentric(time)[source]

Calculates the position of the star, propagating the position using parallax and proper motion

Parameters

time (str, astropy.time.Time) – Reference time to apply proper motion and calculate parallax. It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.

get_position(time, observer='geocenter')[source]

Calculates the position of the star for given observer, propagating the position using parallax and proper motion

Parameters
  • time (float, astropy.time.Time) – Reference time to apply proper motion and calculate parallax. It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.

  • observer (str, sora.observer.Observer, sora.observer.Spacecraft) – Observer of the star t calculate position. It can be ‘geocenter’ for a geocentric coordinate, ‘barycenter’ for a barycenter coordinate, or a sora observer object.

Returns

coord – Astropy SkyCoord object with the star coordinates at the given time.

Return type

astropy.coordinates.SkyCoord

kervella()[source]

Determines the diameter of a star in mas using equations from Kervella et. al (2004).

See: A&A Vol. 426, No. 1:.

set_diameter(diameter)[source]

Sets an user diameter for the star, in mas.

Parameters

diameter (int, float) – Sets the user diameter of the star, in mas.

set_magnitude(**kwargs)[source]

Sets the magnitudes of a star.

Parameters

band=value (str) – The star magnitude for given band. The band name can be any string the user wants.

Examples

To set the stars magnitude in the band G:

>>> set_magnitude(G=10)

To set the star’s magnitude in the band K:

>>> set_magnitude(K=15)

To set the star’s magnitude in a customized band:

>>> set_magnitude(newband=6)
van_belle()[source]

Determines the diameter of a star in mas using equations from van Belle (1999).

See: Publi. Astron. Soc. Pacific 111, 1515-1523:.

Complementary functions

sora.star.utils.kervella(magB=None, magV=None, magK=None)[source]

Determines the diameter of a star in mas using equations from Kervella et. al (2004).

See: A&A Vol. 426, No. 1:.

Parameters
  • magB (float, default=None) – The magnitude B of the star.

  • magV (float, default=None) – The magnitude V of the star.

  • magK (float, default=None) – The magnitudes K of the star.

Note

If any of those values is ‘None’, ‘nan’ or higher than 49, it is not considered.

sora.star.utils.van_belle(magB=None, magV=None, magK=None)[source]

Determines the diameter of a star in mas using equations from van Belle (1999).

See: Publi. Astron. Soc. Pacific 111, 1515-1523:.

Parameters
  • magB (float, default=None) – The magnitude B of the star.

  • magV (float, default=None) – The magnitude V of the star.

  • magK (float, default=None) – The magnitude K of the star.

Note

If any of those values is ‘None’, ‘nan’ or higher than 49, it is not considered.