sora.observer
The Observer Class
- class sora.Observer(**kwargs)[source]
Defines the observer object.
- name
Name for the Observer. Observer is uniquely defined (name must be different for each observer).
- Type
str
- code
The IAU code for SORA to search for its coordinates in MPC database.
- Type
str
- site
User provides an EarthLocation object.
- Type
astropy.coordinates.EarthLocation
- lon
The Longitude of the site in degrees. Positive to East. Range (0 to 360) or (-180 to +180). User can provide in degrees (float) or hexadecimal (string).
- Type
str, float
- lat
The Latitude of the site in degrees. Positive North. Range (+90 to -90). User can provide in degrees (float) or hexadecimal (string).
- Type
str, float
- height
The height of the site in meters above see level.
- Type
int, float
- ephem
The ephemeris used to locate the observer on space. It can be “horizons” to use horizons or a list of kernels
- Type
str, list
Examples
User can provide one of the following to define an observer:
If user will use the MPC name for the site:
>>> Observer(code)
If user wants to use a different name from the MPC database:
>>> Observer(name, code)
If user wants to use an EarthLocation value:
>>> from astropy.coordinates import EarthLocation >>> EarthLocation(lon, lat, height) >>> Observer(name, site)
If user wants to give site coordinates directly:
>>> Observer(name, lon, lat, height)
- altaz(time, coord)[source]
Calculates the Altitude and Azimuth at a reference time for a coordinate.
- Parameters
time (str, astropy.time.Time) – Reference time to calculate the sidereal time. It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.
coord (str, astropy.coordinates.SkyCoord) – Coordinate of the target ICRS.
- Returns
altitude (float) – Object altitude in degrees.
azimuth (float) – Object azimuth in degrees.
- get_ksi_eta(time, star)[source]
Calculates relative position to star in the orthographic projection.
- Parameters
time (str, astropy.time.Time) – Reference time to calculate the position. It can be a string in the format
'yyyy-mm-dd hh:mm:ss.s'
or an astropy Time object.star (str, astropy.coordinates.SkyCoord) – The coordinate of the star in the same reference frame as the ephemeris. It can be a string in the format
'hh mm ss.s +dd mm ss.ss'
or an astropy SkyCoord object.
- Returns
ksi, eta – On-sky orthographic projection of the observer relative to a star.
ksi
is in the North-South direction (North positive).eta
is in the East-West direction (East positive).- Return type
float
- get_vector(time, origin='barycenter')[source]
Return the vector Origin -> Observer in the ICRS
- Parameters
time (str, astropy.time.Time) – Reference time to calculate the object position. It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.
origin (str) – Origin of vector. It can be ‘barycenter’ or ‘geocenter’.
- Returns
coord – Astropy SkyCoord object with the vector origin -> observer at the given time.
- Return type
astropy.coordinates.SkyCoord
- sidereal_time(time, mode='local')[source]
Calculates the Apparent Sidereal Time at a reference time.
- Parameters
time (str, astropy.time.Time) – Reference time to calculate sidereal time.It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.
mode (str) – Local or greenwich time. If mode set
'local'
calculates the sidereal time for the coordinates of this object. If mode set'greenwich'
calculates the Greenwich Apparent Sidereal Time.
- Returns
An Astropy Longitude object with the Sidereal Time.
- Return type
sidereal_time
The Spacecraft Class
- class sora.Spacecraft(name, spkid, ephem='horizons')[source]
Defines a spacecraft observer object.
- name
Name for the Observer. Observer is uniquely defined (name must be different for each observer).
- Type
str
- spkid
spkid of the targeting object.
- Type
str, required
- ephem
The ephemeris used to locate the observer on space. It can be “horizons” to use horizons or a list of kernels
- Type
str, list
- get_vector(time, origin='barycenter')[source]
Return the vector Origin -> Observer in the ICRS
- Parameters
time (str, astropy.time.Time) – Reference time to calculate the object position. It can be a string in the ISO format (yyyy-mm-dd hh:mm:ss.s) or an astropy Time object.
origin (str) – Origin of vector. It can be ‘barycenter’ or ‘geocenter’.
- Returns
coord – Astropy SkyCoord object with the vector origin -> observer at the given time.
- Return type
astropy.coordinates.SkyCoord