Night sky area
- Start with your location (latitude/longitude)
- Get current time (convert to local sidereal time/LST)
- The LST tells you what Right Ascension (RA) is directly overhead
- Objects with RA = LST are on your meridian (highest in sky)
- Visible RA range is roughly LST ± 6 hours
FOV Sky area from object
-
Get orbital parameters:
- Position vector (X, Y, Z in space)
- Velocity vector (direction of movement)
- Current time
-
Convert to viewing coordinates:
- Calculate spacecraft's local vertical
- Use orientation to determine which way instruments/windows point
- Convert to equatorial coordinates (RA/Dec)
-
Calculate field of view:
- Define cone angle from viewing direction
- Map this to RA/Dec coordinates
step2:
1. From orbital position, define local reference frame:
- Z-axis: local vertical (from Earth center to spacecraft)
- Y-axis: perpendicular to orbital plane
- X-axis: completes right-handed system
-
Spacecraft orientation relative to this frame:
- Usually given in quaternions or Euler angles
- Convert to rotation matrix R
-
Viewing direction in spacecraft frame:
- If looking through window, use window normal vector
- Apply rotation matrix: v_local = R * v_spacecraft
-
Convert to equatorial coordinates:
- Use spacecraft position to get Earth-centered inertial (ECI) frame
- Transform local viewing vector to ECI
- Convert to RA/Dec using:
RA = atan2(y_eci, x_eci)
Dec = asin(z_eci/sqrt(x_eci² + y_eci² + z_eci²))
step3:
1. Define FOV parameters:
- Central viewing direction (from step 2)
- FOV angle (α) for window/instrument
-
Create FOV cone:
- All points making angle α with viewing direction
- In equatorial coordinates, this makes a circle on celestial sphere
-
Map FOV boundaries:
- For circular FOV:
- Generate points around cone at angle α
- Convert each to RA/Dec
- For rectangular FOV:
- Define corners using horizontal/vertical angles
- Convert corners to RA/Dec
- FOV is area inside these points
sample code:
def get_viewing_area(
position_eci, # spacecraft position vector
orientation_quat, # spacecraft orientation quaternion
window_normal, # viewing direction in spacecraft frame
fov_angle # field of view in degrees
):
# Convert orientation to rotation matrix
R = quat_to_matrix(orientation_quat)
# Get viewing direction in ECI
view_local = R @ window_normal
view_eci = local_to_eci(view_local, position_eci)
# Get central RA/Dec
ra, dec = vector_to_radec(view_eci)
# Generate FOV boundary points
fov_points = []
for theta in range(0, 360, 10): # every 10 degrees
# Generate point on FOV cone
point = rotate_vector(view_eci, fov_angle, theta)
ra_p, dec_p = vector_to_radec(point)
fov_points.append((ra_p, dec_p))
return ra, dec, fov_points
Find stars in the night sky area
- Find LST at your position
- this gives the meridian (highest position in the sky)
- with longitude, you can get z position in equitorial coordinates
- that's the night sky direction outward onto space.
- if you want to change view direction from there, you have to rotate it.
- that's the sky direction you are looking at in equitorial coordinates.
- define area from the direction.
- find stars with the area from star catalogue.