moon_frame_interpolater Derived Type

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.


Inherits

type~~moon_frame_interpolater~~InheritsGraph type~moon_frame_interpolater moon_frame_interpolater bspline_1d bspline_1d type~moon_frame_interpolater->bspline_1d roll_spline, pitch_spline, yaw_x_spline, yaw_y_spline

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

  • 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]

procedure, public :: destroy => destroy_moon_frame_interpolater

procedure, public :: j2000_to_frame

  • 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)

procedure, public :: frame_to_j2000

  • 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)

Source Code

    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.
        private
        type(bspline_1d) :: roll_spline
        type(bspline_1d) :: pitch_spline
        type(bspline_1d) :: yaw_x_spline  !! x-component of yaw angle unit vector: x=cos(yaw)
        type(bspline_1d) :: yaw_y_spline  !! y-component of yaw angle unit vector: y=sin(yaw)
    contains
        private
        procedure,public :: initialize => initialize_moon_frame_interpolater
        procedure,public :: destroy    => destroy_moon_frame_interpolater
        procedure,public :: j2000_to_frame
        procedure,public :: frame_to_j2000
    end type moon_frame_interpolater