astrotool.coordinates module

Coordinate transformations and related functions for AstroTool.

astrotool.coordinates.ecl2eq(lon, lat, eps)[source]

Convert (geocentric) spherical ecliptical coordinates to spherical equatorial coordinates.

Parameters
  • lon (double) – Ecliptical longitude (rad).

  • lat (double) – Ecliptical latitude (rad).

  • eps (double) – Obliquity of the ecliptic (rad).

Returns

tuple containing (ra, dec):

  • ra (double): Right ascension (rad).

  • dec (double): Declination (rad).

Return type

tuple (double,double)

References

astrotool.coordinates.eq2ecl(ra, dec, eps)[source]

Convert equatorial coordinates to ecliptical.

Parameters
  • ra (double) – Right ascension (rad).

  • dec (double) – Declination (rad).

  • eps (double) – Obliquity of the ecliptic (rad).

Returns

tuple containing (lon, lat):

  • lon (double): Ecliptical longitude (rad).

  • lat (double): Ecliptical latitude (rad).

Return type

tuple (double,double)

astrotool.coordinates.geoc2topoc_ecl(lon_gc, lat_gc, dist_gc, rad_gc, eps, lst, lat_obs, ele_obs=0, debug=False)[source]

Convert spherical ecliptical coordinates from the geocentric to the topocentric system.

Parameters
  • lon_gc (double) – Geocentric ecliptic longitude (rad).

  • lat_gc (double) – Geocentric ecliptic latitude (rad).

  • dist_gc (double) – Geocentric distance (AU).

  • rad_gc (double) – Geocentric semi-diameter (rad).

  • eps (double) – Obliquity of the ecliptic (rad).

  • lst (double) – Local sidereal time (rad).

  • lat_obs (double) – Geographical latitude of the observer (rad).

  • ele_obs (double) – Altitude/elevation of the observer above sea level (metres, optional, default value = 0).

  • debug (bool) – Print debug output (True/False, optional, default value = True).

Returns

tuple containing (lon_tc, lat_tc, rad_tc):

  • lon_tc (double): Topocentric ecliptic longitude (rad).

  • lat_tc (double): Topocentric ecliptic latitude (rad).

  • rad_tc (double): Topocentric semi-diameter (rad).

Return type

tuple (double,double,double)

astrotool.coordinates.obliquity(jd)[source]

Compute the obliquity of the ecliptic in radians from the JD(E).

Parameters

jd (double) – Julian day (days).

Returns

eps: Obliquity of the ecliptic (rad).

Return type

double

References

  • Seidelman 1992, Eq. 3.222-1.

astrotool.coordinates.par2horiz(ha, dec, phi)[source]

Convert parallactic coordinates to horizontal.

Parameters
  • ha (double) – Hour angle (rad).

  • dec (double) – Declination (rad).

  • phi (double) – Geographical latitude (rad, N>0).

Returns

tuple containing (az, alt):

  • az (double): Azimuth (rad, S=0).

  • alt (double): Altitude (rad).

Return type

tuple (double,double)

astrotool.coordinates.precess_from_2000(jd, ra, dec)[source]

Compute precession in equatorial coordinates from J2000 to that of the specified JD.

J2000 is the equinox of many catalogues, including the Hipparcos one.

Parameters
  • jd (double) – Julian day (days).

  • ra (double) – Right ascension (rad).

  • dec (double) – Declination (rad).

Returns

tuple containing (ra_new, dec_new):

  • ra_new (double): Right ascension for the target equinox (rad).

  • dec_new (double): Declination for the target equinox (rad).

Return type

tuple (double,double)

astrotool.coordinates.proper_motion(jd_start, jd_target, ra, dec, pma, pmd)[source]

Compute the proper motion from jd_start to jd_target for the given positions and proper motions.

Parameters
  • jd_start (double) – Julian day of the initial epoch (days).

  • jd_target (double) – Julian day of the target epoch (days).

  • ra (double) – Right ascension (numpy array, rad).

  • dec (double) – Declination (numpy array, rad).

  • pma (double) – Proper motion in right ascension (numpy array, rad/yr).

  • pmd (double) – Proper motion in declination (numpy array, rad/yr).

Returns

tuple containing (ra_target, dec_target):

  • ra_target (double): Right ascension for the target epoch (rad).

  • dec_target (double): Declination for the target epoch (rad).

Return type

tuple (double,double)