Skip to main content

scoords

The scoords library defines an astropy custom coordinate frame. This allows to specify coordinates relative to the local spacecraft coordinates and transform them to any other system using astropy's machinery.

SkyCoord objects are instantiated by passing a location with specified units and a coordinate frame. Use SpacecraftFrame to specify a coordinate in the reference system attached to the spacecraft:

import astropy.units as u
from astropy.coordinates import SkyCoord
from scoords import SpacecraftFrame

c = SkyCoord(lon = 45*u.deg, lat = 10*u.deg, frame = SpacecraftFrame())

This allows you to know the reference frame of the coordinate, e.g.

c.frame
<SpacecraftFrame Coordinate (attitude=None, obstime=None, location=None): (lon, lat) in deg
    (45., 10.)>

However, in order to transform it into other coordinate system you need to specify the orientation of the spacecraft with respect to an inertial reference frame --i.e. the attitude

from scoords import Attitude

attitude = Attitude.from_rotvec(45*u.deg*[0,0,1], frame = 'icrs')

c = SkyCoord(lon = 0*u.deg, lat = 0*u.deg, frame = SpacecraftFrame(attitude = attitude))

There are class methods to specify the orientation in any of the following formats:

  • A rotation matrx
  • A vector co-directional to the axis of rotation
  • A quaternion
  • A scipy's Rotation object
  • The direction the spacecraft coordinates axes point to

Once the attitude is specified, we can transform from/to any other frame supported by astropy

c.transform_to('icrs')
<SkyCoord (ICRS): (ra, dec) in deg
    (45., 0.)>
c.transform_to('galactic')
<SkyCoord (Galactic): (l, b) in deg
    (176.96129126, -48.90264434)>

Although it does not play a role in this particular coordinates transformation, the observation time and location can also be specified in case it is needed by any other algorithm:

from astropy.time import Time
from astropy.coordinates import EarthLocation

frame = SpacecraftFrame(attitude = attitude,
                        obstime = Time('2026-01-01T00:00:00'),
                        location = EarthLocation(lon = 10*u.deg, lat = 46*u.deg, height = 400*u.km))

c = SkyCoord(lon = 45*u.deg, lat = 10*u.deg, frame = frame)
c.frame.obstime
<Time object: scale='utc' format='isot' value=2026-01-01T00:00:00.000>
c.frame.location.geodetic
GeodeticLocation(lon=<Longitude 10. deg>, lat=<Latitude 46. deg>, height=<Quantity 400. km>)

Metadata

Release files for scoords 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scoords 0.0.3
File Size Uploaded
scoords-0.0.3.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scoords 0.0.3
File Interpreter ABI Platform
scoords-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / scoords-0.0.3.tar.gz

Download URL scoords-0.0.3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
02e2af135e22fe00829a1ba8a21f663b9491e5654c4b7e15dd78d72ad9638f27
BLAKE2b-256 checksum
How to use checksums
650636715317321651fa2a3bb618281888b721058df7cccd24a75d41adcc9cc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / scoords-0.0.3-py3-none-any.whl

Download URL scoords-0.0.3-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed6be76363b6d2c7fd3854b8c9f56c2c126f34b19723f6b35be127333b78c303
BLAKE2b-256 checksum
How to use checksums
4da8a8fd512e44f4c6f2574395a189f9aaf1b1d0fb1c7036a29e79f184858e9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page