Code Documentation

Module with astronomical geometrical functions.

generate_random_direction()

Generate random unit vector for sky direction.

Return type:

ndarray

angular_distance(axis, vectors)

Angular distance between vectors and axis

Parameters:
  • axis (NDArray) – the vector from which the distance is being calculated

  • vectors (NDArray) – the vectors being calculated):

Returns:

angular distance between vectors and axis

Return type:

float

mag_to_radius(magnitude, max_magnitude, min_magnitude)

Returns radius of the point corresponds to given star magnitude.

Parameters:
  • magnitude (float or NDArray) – star magnitude(s)

  • max_magnitude (float) – maximum magnitude

  • min_magnitude (float) – minimum magnitude

Returns:

star image radius

Return type:

float or NDArray

get_horizontal_coords(longitude, latitude, local_time, data)

Get horizontal coordinates from catalog data.

Parameters:
  • longitude (float) – place longitude

  • latitude (float) – place latitude

  • local_time (datetime) – local time

  • data (NDArray) – data to make conversion into horizontal coordinates

Returns:

a pair of mask and horizontal coordinates with zenith distances, azimuths

Return type:

tuple

make_stereo_projection(view_data)

Returns point stereographic projections array.

Parameters:

view_data (NDArray) – observed object parameters in horizontal coordinates

Returns:

image point parameters

Return type:

NDArray

make_pinhole_projection(center_direction, tilt_dec, focal_length, image_width, image_height, data)

Returns point pinhole projections array.

Parameters:
  • center_direction (NDArray) – ECI unit vector of view direction

  • tilt_dec (float) – frame tilt angle in degrees

  • focal_length (float) – focal length in pixels

  • image_width (float) – frame width in pixels

  • image_height (float) – frame height in pixels

  • data (NDArray) – data to project

Returns:

a pair of mask and coordinates in reference plane system

Return type:

tuple

create_camera_frame_system(center_direction, tilt_dec)

Create camera coordinate system from shot conditions.

Parameters:
  • center_direction (NDArray) – ECI unit vector of camera view direction

  • tilt_dec (float) – tilt angle of frame with respect to zenith direction

Returns:

camera frame system matrix

Return type:

NDArray

generate_small_circle(spheric_normal_deg, alpha_deg, num_points)

Generate a small circle on unit sphere in ECI coordinates.

Parameters:
  • spheric_normal_deg (NDArray) – spherical coordinates on the normal to hte place of circle, angles in degrees

  • alpha_deg (float) – angle between any radis vector of the point on small circle and normal

  • num_points (int) – number of points to generate

Returns:

array of points in cartesian ECI coordinates

Return type:

NDArray

make_points_stereo_projection(points)

Returns star point projections array.

Parameters:

points (NDArray) – points to project, must contain azimuth and zenith args

Returns:

projection point polar coordinates

Return type:

NDArray

make_equatorial_grid_pinhole(center_direction, tilt_dec, focal_length, image_width, image_height, grid_step_dec, grid_step_ra)

Creates an equatorial grid for pinhole image/

Parameters:
  • center_direction (NDArray) – ECI unit vector of camera view direction

  • tilt_dec (float) – tilt angle in degrees

  • focal_length (float) – focal length in pixels

  • image_width (float) – image width in pixels

  • image_height (float) – image height in pixels

  • grid_step_dec (float) – declination grid step in degrees

  • grid_step_ra (float) – right ascension grid step in degrees

Returns:

grid as LineCollection object

Return type:

LineCollection

clean_far_points(circle, fov_rad, center_direction, gap_threshold)

Removes points further than FOV from center direction out of circle

Parameters:
  • circle (NDArray) – circle initial points to clean

  • fov_rad (float) – camera field of view

  • center_direction (NDArray) – ECI unit vector of camera view direction

  • gap_threshold (float) – threshold to consider distance a large gap between points

Returns:

cleaned points

Return type:

NDArray