moon_frame_module Module

Module for interpolation of body-fixed Moon frames.


Uses

  • module~~moon_frame_module~~UsesGraph module~moon_frame_module moon_frame_module bspline_module bspline_module module~moon_frame_module->bspline_module csv_module csv_module module~moon_frame_module->csv_module iso_fortran_env iso_fortran_env module~moon_frame_module->iso_fortran_env

Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: wp = real64

Real working precision if not specified [8 bytes]

integer, public, parameter :: moon_frame_wp = wp

working precision for moon frame


Derived Types

type, public ::  moon_frame_interpolater

Main class to read a pre-computed CSV file with roll, pitch, and yaw angles and interpolate the angles to get the rotation matrix for a given ephemeris time.

Components

Type Visibility Attributes Name Initial
type(bspline_1d), private :: roll_spline
type(bspline_1d), private :: pitch_spline
type(bspline_1d), private :: yaw_x_spline

x-component of yaw angle unit vector: x=cos(yaw)

type(bspline_1d), private :: yaw_y_spline

y-component of yaw angle unit vector: y=sin(yaw)

Type-Bound Procedures

procedure, public :: initialize => initialize_moon_frame_interpolater
procedure, public :: destroy => destroy_moon_frame_interpolater
procedure, public :: j2000_to_frame
procedure, public :: frame_to_j2000

Functions

private function j2000_to_frame(me, et) result(rot)

rotation matrix from J2000 to the frame

Arguments

Type IntentOptional Attributes Name
class(moon_frame_interpolater), intent(inout) :: me
real(kind=wp), intent(in) :: et

Return Value real(kind=wp), (3,3)

private function frame_to_j2000(me, et) result(rot)

rotation matrix from the frame to j2000

Arguments

Type IntentOptional Attributes Name
class(moon_frame_interpolater), intent(inout) :: me
real(kind=wp), intent(in) :: et

Return Value real(kind=wp), (3,3)


Subroutines

private subroutine initialize_moon_frame_interpolater(me, filename, k, extrapolate, et0, etf)

initialize the moon frame interpolater with the given csv file.

Arguments

Type IntentOptional Attributes Name
class(moon_frame_interpolater), intent(inout) :: me
character(len=*), intent(in) :: filename

csv file with roll, pitch, and yaw angles vs ephemeris time. (see generate_csv_file)

integer, intent(in), optional :: k

spline order (kx in bspline_module). If not given, use the default quartic order.

logical, intent(in), optional :: extrapolate

if true, extrapolate the spline outside the range of the data. Default is false.

real(kind=wp), intent(in), optional :: et0

start ephemeris time [if not present, the initial time in the file is used]

real(kind=wp), intent(in), optional :: etf

end ephemeris time [if not present, the final time in the file is used]

private pure subroutine rpy_to_rot(roll, pitch, yaw, r)

roll, patch, yaw to rotation matrix

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: roll

rad

real(kind=wp), intent(in) :: pitch

rad

real(kind=wp), intent(in) :: yaw

rad

real(kind=wp), intent(out) :: r(3,3)

private subroutine destroy_moon_frame_interpolater(me)

Arguments

Type IntentOptional Attributes Name
class(moon_frame_interpolater), intent(inout) :: me