Splined lunar principal-axis (MOON_PA) frame: the rotation from J2000 to the
frame, interpolated from a table of the frame's roll, pitch and yaw angles vs.
ephemeris time (e.g., data/moon_pa_2000_2100.csv, generated with SPICE).
This is the same interpolation as the moonframe library's
moon_frame_interpolater (quartic B-splines of the roll, the pitch, and the
cosine and sine of the yaw angle, with the same knots), and gives identical
results, but with the same pattern as splined_ephemeris_module: the spline
coefficients are global variables, computed once and then only read, so all
the segments (and threads) share one copy. Each moon_pa_frame object only
holds its own small evaluation workspace (the interval indices and a work
array, which db1val modifies), so each segment (thread) has its own.
(With a copy of the coefficients in every segment, the memory grew with the
square of the number of revolutions.)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | kx | = | bspline_order_quartic |
spline order (as in |
| integer, | private, | parameter | :: | iknot | = | 0 |
knots chosen by |
| integer, | private, | parameter | :: | n_splines | = | 4 |
roll, pitch, cos(yaw), sin(yaw) |
| integer, | private | :: | nx | = | 0 |
number of points |
|
| real(kind=wp), | private, | dimension(:,:), allocatable | :: | tx |
|
||
| real(kind=wp), | private, | dimension(:,:), allocatable | :: | bcoef |
|
The interface to the splined MOON_PA frame: only the evaluation workspace (the splines themselves are global). Make a copy for each thread.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | dimension(n_splines) | :: | inbvx | = | 1 |
|
| real(kind=wp), | private, | dimension(3*kx) | :: | w0 | = | 0.0_wp |
|
| procedure, public :: initialize => initialize_moon_pa_frame | |
| procedure, public :: j2000_to_frame | |
| procedure, public :: frame_to_j2000 | |
| procedure, public :: destroy => destroy_moon_pa_frame |
The rotation matrix from J2000 to the MOON_PA frame at et.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(moon_pa_frame), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | et |
ephemeris time [sec] |
The rotation matrix from the MOON_PA frame to J2000 at et.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(moon_pa_frame), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | et |
ephemeris time [sec] |
Read the table and compute the (global) splines, for the time span [et0, etf]:
the rows from the last one at or before et0 to the first one at or after
etf (as in moonframe). Then the object's workspace is reset; copies of
the object (allocate(..., source=...)) can be used by other threads.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(moon_pa_frame), | intent(inout) | :: | me | |||
| character(len=*), | intent(in) | :: | filename |
csv file with the ephemeris time, roll, pitch and yaw (rad) |
||
| real(kind=wp), | intent(in) | :: | et0 |
start ephemeris time of the span to spline [sec] |
||
| real(kind=wp), | intent(in) | :: | etf |
end ephemeris time of the span to spline [sec] |
Roll, pitch and yaw (rad) to the rotation matrix (as in moonframe).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | roll | |||
| real(kind=wp), | intent(in) | :: | pitch | |||
| real(kind=wp), | intent(in) | :: | yaw | |||
| real(kind=wp), | intent(out), | dimension(3,3) | :: | r |
Reset the object's workspace (the global splines are kept).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(moon_pa_frame), | intent(inout) | :: | me |