# Transformations between Celestial coordinate systems¶

Perform various Celestial coordinate transformations

This module performs transformations between different Celestial coordinate systems.

Legacy transformations (all those not marked astropy): Formulae from: Duffett-Smith1990 ‘Astronomy with your personal computer’ ISBN 0-521-38995-X

New transformations have been added with _astropy added to function name They are very exact, in the order of arcsec. Ethan van Woerkom is the author of the new transformations; contact him for further information.

sapphire.transformations.celestial.zenithazimuth_to_equatorial(latitude, longitude, timestamp, zenith, azimuth)

Convert Zenith Azimuth to Equatorial coordinates (J2000.0)

Parameters:
• latitude,longitude – Position of the observer on Earth in degrees. North and east positive.

• timestamp – GPS timestamp of the observation in seconds.

• zenith – zenith is the angle relative to the Zenith in radians.

• azimuth – azimuth angle of the observation in radians.

Returns:

Right ascension (ra) and Declination (dec) in radians.

From Duffett-Smith1990, 1500 EQHOR and 1600 HRANG

sapphire.transformations.celestial.zenithazimuth_to_horizontal(zenith, azimuth)

Convert from Zenith Azimuth to Horizontal coordinates

Parameters:
• zenith – Zenith in radians

• azimuth – Azimuth in radians

Return altitude, alt_azimuth:

Zenith Azimuth is the coordinate system used by HiSPARC. Zenith is the angle between the zenith and the direction. Azimuth is the angle in the horizontal plane, from East to North (ENWS).

Horizontal is the coordinate system as described in Duffett-Smith1990 p38. Altitude is the angle above the horizon and Azimuth the angle in the horizontal plane, from North to East (NESW).

sapphire.transformations.celestial.horizontal_to_zenithazimuth(altitude, alt_azimuth)

Inverse of zenithazimuth_to_horizontal is the same transformation

sapphire.transformations.celestial.horizontal_to_equatorial(latitude, lst, altitude, alt_azimuth)

Convert Horizontal to Equatorial coordinates (J2000.0)

Parameters:
• latitude – Position of the observer on Earth in degrees. North positive.

• lst – Local Siderial Time observer at the time of observation in decimal hours.

• altitude – altitude is the angle above the horizon in radians.

• alt_azimuth – Azimuth angle in horizontal plane in radians.

Returns:

Right ascension (ra) and Declination (dec) in radians.

Warning: Inexact transformation; astropy functions preferred.

From Duffett-Smith1990, 1500 EQHOR and 1600 HRANG

Convert Horizontal to Hour Angle and Declination

Parameters:
• latitude – Position of the observer on Earth in degrees. North positive.

• altitude – altitude is the angle above the horizon in radians.

• alt_azimuth – Azimuth angle in horizontal plane in radians.

Returns:

Hour angle (ha) and Declination (dec) in radians.

Warning: Inexact transformation; astropy functions preferred.

From Duffett-Smith1990, 1500 EQHOR and 1600 HRANG

sapphire.transformations.celestial.ha_to_ra(ha, lst)

Convert Hour angle to right ascension

Parameters:
• ha – Hour angle in radians.

• lst – Local Siderial Time observer at the time of observation in decimal hours.

Returns:

sapphire.transformations.celestial.equatorial_to_zenithazimuth(latitude, longitude, timestamp, right_ascension, declination)

Convert Equatorial (J2000.0) to Zenith Azimuth coordinates

Parameters:
• latitude,longitude – Position of the observer on Earth in degrees. North and east positive.

• timestamp – GPS timestamp of the observation in seconds.

• right_ascension – right_ascension of the observation in radians.

• declination – declination of the observation in radians.

Returns:

This function was renamed from equatorial_to_horizontal to equatorial_to_zenithazimuth in order to make it operate as the name does.

From Duffett-Smith1990, 1500 EQHOR and 1600 HRANG

sapphire.transformations.celestial.zenithazimuth_to_equatorial_astropy(latitude, longitude, utc_timestamp, zenaz_coordinates)
Converts iterables of tuples of zenithazimuth

to equatorial coordinates

Parameters:
• latitude – Latitude in decimal degrees

• longitude – Longitude in decimal degrees

• utc_timestamp – Unix UTC timestamp integer

• zenaz_coordinates – np.array of tuples (zen, az) in radians

Returns:

np.array of tuples (ra, dec) in radians

For increased speed using array input is recommended.

sapphire.transformations.celestial.equatorial_to_zenithazimuth_astropy(latitude, longitude, utc_timestamp, equatorial_coordinates)
Converts iterables of tuples of equatorial

to zenithazimuth coordinates

Parameters:
• latitude – Latitude in decimal degrees

• longitude – Longitude in decimal degrees

• utc_timestamp – Unix UTC timestamp integer

• equatorial_coordinates – np.array of tuples (ra, dec) in radians

Returns:

np.array of tuples (zen, az) in radians

For increased speed using array input is recommended.

sapphire.transformations.celestial.equatorial_to_horizontal_astropy(latitude, longitude, utc_timestamp, equatorial_coordinates)
Converts iterables of tuples of equatorial coordinates

to horizontal coordinates

Parameters:
• latitude – Latitude in decimal degrees

• longitude – Longitude in decimal degrees

• utc_timestamp – Unix UTC timestamp integer

• equatorial_coordinates – np.array of tuples (ra, dec) in radians

Returns:

np.array of tuples (az, alt) in radians

For increased speed using array input is recommended.

sapphire.transformations.celestial.horizontal_to_equatorial_astropy(latitude, longitude, utc_timestamp, horizontal_coordinates)
Converts iterables of tuples of

horizontal coordinates to equatorial coordinates

Parameters:
• latitude – Latitude in decimal degrees

• longitude – Longitude in decimal degrees

• utc_timestamp – Unix UTC timestamp integer

• horizontal_coordinates – np.array of tuples (az, alt) in radians

Returns:

np.array of tuples (ra, dec) in radians