transformation_module Module

Coordinate transformations.


Uses

  • module~~transformation_module~~UsesGraph module~transformation_module transformation_module iso_fortran_env iso_fortran_env module~transformation_module->iso_fortran_env module~celestial_body_module celestial_body_module module~transformation_module->module~celestial_body_module module~ephemeris_module ephemeris_module module~transformation_module->module~ephemeris_module module~iau_orientation_module iau_orientation_module module~transformation_module->module~iau_orientation_module module~kind_module kind_module module~transformation_module->module~kind_module module~numbers_module numbers_module module~transformation_module->module~numbers_module module~time_module time_module module~transformation_module->module~time_module module~vector_module vector_module module~transformation_module->module~vector_module module~celestial_body_module->module~kind_module module~celestial_body_module->module~numbers_module module~base_class_module base_class_module module~celestial_body_module->module~base_class_module module~ephemeris_module->module~celestial_body_module module~ephemeris_module->module~kind_module module~iau_orientation_module->module~kind_module module~iau_orientation_module->module~numbers_module module~conversion_module conversion_module module~iau_orientation_module->module~conversion_module module~kind_module->iso_fortran_env module~numbers_module->module~kind_module module~time_module->module~kind_module module~vector_module->module~kind_module module~vector_module->module~numbers_module module~conversion_module->module~kind_module module~conversion_module->module~numbers_module

Used by

  • module~~transformation_module~~UsedByGraph module~transformation_module transformation_module module~fortran_astrodynamics_toolkit fortran_astrodynamics_toolkit module~fortran_astrodynamics_toolkit->module~transformation_module

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: center_at_primary_body = 1
integer, public, parameter :: center_at_secondary_body = 2
integer, public, parameter :: center_at_barycenter = 3

Interfaces

public interface two_body_rotating_frame

  • private pure function two_body_rotating_frame_constructor(primary_body, secondary_body, center, et) result(f)

    Constructor for a two_body_rotating_frame

    Arguments

    Type IntentOptional Attributes Name
    type(celestial_body), intent(in) :: primary_body

    the primary body of the frame

    type(celestial_body), intent(in) :: secondary_body

    the secondary body used to construct the frame

    integer, intent(in) :: center

    the frame center (can be primary_body, secondary_body, or barycenter)

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

    epoch at which the frame is defined [sec]

    Return Value type(two_body_rotating_frame)

public interface iau_earth_rotating_frame

public interface iau_moon_rotating_frame

public interface icrf_frame

public interface ecliptic_frame


Abstract Interfaces

abstract interface

  • private subroutine c_cdot_func(me, eph, to_icrf, c, cdot, status_ok)

    Arguments

    Type IntentOptional Attributes Name
    class(reference_frame), intent(inout) :: me
    class(ephemeris_class), intent(inout) :: eph

    for ephemeris computations (assumed to have already been initialized)

    logical, intent(in) :: to_icrf
    real(kind=wp), intent(out), dimension(3,3) :: c
    real(kind=wp), intent(out), optional, dimension(3,3) :: cdot
    logical, intent(out) :: status_ok

Derived Types

type, public ::  reference_frame

a reference frame defines an orientation at a specified frame center at a specified epoch. Usually, the center is the primary_body of the frame, but can be otherwise for a two_body_rotating_frame.

Components

Type Visibility Attributes Name Initial
type(celestial_body), private :: primary_body = body_earth

the primary body of the frame

real(kind=wp), private :: et = zero

epoch at which the frame is defined [sec]

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

procedure(c_cdot_func), private, deferred :: get_c_cdot ../../

to get the rotating matrix for the frame orientation

type, public, extends(reference_frame) ::  inertial_frame_class

a non-rotating frame (a frame where the orientation axes are time invariant)

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

type, public, extends(reference_frame) ::  rotating_frame_class

a rotating frame (a frame where the orientation axes vary with time)

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

type, public, extends(rotating_frame_class) ::  iau_rotating_frame_class

frame defined by the orientation of a celestial body using the IAU models.

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

type, public, extends(rotating_frame_class) ::  two_body_rotating_frame

The two-body rotating frame is constructed from the states of two celestial bodies.

Components

Type Visibility Attributes Name Initial
type(celestial_body), public :: secondary_body = body_moon

the secondary body used to construct the frame

integer, public :: center = center_at_barycenter

the frame center (can be primary_body,secondary_body, or barycenter)

real(kind=wp), public, dimension(6) :: rv12 = zero

[r,v] of secondary body w.r.t. primary body

Constructor

private pure function two_body_rotating_frame_constructor (primary_body, secondary_body, center, et)

Constructor for a two_body_rotating_frame

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

procedure, public :: from_primary_to_center
procedure, public :: get_c_cdot => get_c_cdot_two_body_rotating

This frame is an extension of the two-body rotating frame, where a scale factor is used to scale the position and velocity of the state based on the distance between the primary and secondary bodies.

Components

Type Visibility Attributes Name Initial
type(celestial_body), public :: secondary_body = body_moon

the secondary body used to construct the frame

integer, public :: center = center_at_barycenter

the frame center (can be primary_body,secondary_body, or barycenter)

real(kind=wp), public, dimension(6) :: rv12 = zero

[r,v] of secondary body w.r.t. primary body

real(kind=wp), public :: scale = zero

scale factor

Constructor

private pure function two_body_rotating_pulsating_frame_constructor (primary_body, secondary_body, center, scale, et)

Constructor for a two_body_rotating_pulsating_frame

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

procedure, public :: from_primary_to_center
procedure, public :: get_c_cdot => get_c_cdot_two_body_rotating_pulsating

type, public, extends(iau_rotating_frame_class) ::  iau_earth_rotating_frame

IAU Earth frame

Constructor

private pure function iau_earth_rotating_frame_constructor (b, et)

Constructor for a iau_earth_rotating_frame

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

procedure, public :: get_c_cdot => get_c_cdot_iau_earth

type, public, extends(iau_rotating_frame_class) ::  iau_moon_rotating_frame

IAU Moon frame

Constructor

private pure function iau_moon_rotating_frame_constructor (b, et)

Constructor for a iau_moon_rotating_frame

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

procedure, public :: get_c_cdot => get_c_cdot_iau_moon

type, public, extends(inertial_frame_class) ::  icrf_frame

the fundamental inertial frame for the ephemeris (i.e., J2000).

Constructor

private pure function icrf_frame_constructor (b)

Constructor for a icrf_frame

Read more…

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

procedure, public :: get_c_cdot => get_c_cdot_icrf

type, public, extends(inertial_frame_class) ::  ecliptic_frame

Mean ecliptic frame.

Constructor

private pure function ecliptic_frame_constructor (b)

Constructor for a ecliptic_frame

Read more…

Type-Bound Procedures

procedure, public, pass(from) :: transform ../../

coordinate transformation routine

procedure, public :: get_c_cdot => get_c_cdot_ecliptic

Functions

private pure function two_body_rotating_frame_constructor(primary_body, secondary_body, center, et) result(f)

Constructor for a two_body_rotating_frame

Arguments

Type IntentOptional Attributes Name
type(celestial_body), intent(in) :: primary_body

the primary body of the frame

type(celestial_body), intent(in) :: secondary_body

the secondary body used to construct the frame

integer, intent(in) :: center

the frame center (can be primary_body, secondary_body, or barycenter)

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

epoch at which the frame is defined [sec]

Return Value type(two_body_rotating_frame)

private pure function two_body_rotating_pulsating_frame_constructor(primary_body, secondary_body, center, scale, et) result(f)

Constructor for a two_body_rotating_pulsating_frame

Arguments

Type IntentOptional Attributes Name
type(celestial_body), intent(in) :: primary_body

the primary body of the frame

type(celestial_body), intent(in) :: secondary_body

the secondary body used to construct the frame

integer, intent(in) :: center

the frame center (can be primary_body, secondary_body, or barycenter)

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

scale factor

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

epoch at which the frame is defined [sec]

Return Value type(two_body_rotating_pulsating_frame)

private pure function iau_earth_rotating_frame_constructor(b, et) result(f)

Constructor for a iau_earth_rotating_frame

Arguments

Type IntentOptional Attributes Name
type(celestial_body), intent(in) :: b

the central body

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

epoch at which the frame is defined [sec]

Return Value type(iau_earth_rotating_frame)

private pure function iau_moon_rotating_frame_constructor(b, et) result(f)

Constructor for a iau_moon_rotating_frame

Arguments

Type IntentOptional Attributes Name
type(celestial_body), intent(in) :: b

the central body

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

epoch at which the frame is defined [sec]

Return Value type(iau_earth_rotating_frame)

private pure function icrf_frame_constructor(b) result(f)

Constructor for a icrf_frame

Read more…

Arguments

Type IntentOptional Attributes Name
type(celestial_body), intent(in) :: b

the central body

Return Value type(icrf_frame)

private pure function ecliptic_frame_constructor(b) result(f)

Constructor for a ecliptic_frame

Read more…

Arguments

Type IntentOptional Attributes Name
type(celestial_body), intent(in) :: b

the central body

Return Value type(ecliptic_frame)


Subroutines

private subroutine transform(from, rv, to, et, eph, rv_out, status_ok)

Transform a Cartesian state from one reference frame to another at a specified epoch. The from and to reference_frames may each be defined at a different epoch. The et ephemeris time is the time the transformation is to be done, and accounts for the motion of the two frame centers from from%et and to%et to et.

Arguments

Type IntentOptional Attributes Name
class(reference_frame), intent(inout) :: from
real(kind=wp), intent(in), dimension(6) :: rv
class(reference_frame), intent(inout) :: to
real(kind=wp), intent(in) :: et

the time of the transformation [sec]

class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

real(kind=wp), intent(out), dimension(6) :: rv_out
logical, intent(out) :: status_ok

private subroutine rvcto_rvcfrom_icrf(from, to, eph, et, rc21, vc21, status_ok)

Returns the state of the from frame center w.r.t. the to frame center, at the specified ephemeris time et.

Arguments

Type IntentOptional Attributes Name
class(reference_frame), intent(in) :: from
class(reference_frame), intent(in) :: to
class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

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

ephemeris time [sec]

real(kind=wp), intent(out), dimension(3) :: rc21

position of from frame center w.r.t. to frame center

real(kind=wp), intent(out), dimension(3) :: vc21

velocity of from frame center w.r.t. to frame center

logical, intent(out) :: status_ok

true if there were no errors

private subroutine from_primary_to_center(me, eph, et, rc, status_ok)

returns the state of the frame center w.r.t. the frame primary body.

Arguments

Type IntentOptional Attributes Name
class(two_body_rotating_frame), intent(in) :: me
class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

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

ephemeris time [sec]

real(kind=wp), intent(out), dimension(6) :: rc

state of frame center w.r.t. primary body [inertial]

logical, intent(out) :: status_ok

true if no errors.

private subroutine get_c_cdot_two_body_rotating(me, eph, to_icrf, c, cdot, status_ok)

rotation matrix for ROTATING <-> ICRF

Arguments

Type IntentOptional Attributes Name
class(two_body_rotating_frame), intent(inout) :: me
class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

logical, intent(in) :: to_icrf
real(kind=wp), intent(out), dimension(3,3) :: c
real(kind=wp), intent(out), optional, dimension(3,3) :: cdot
logical, intent(out) :: status_ok

private subroutine get_c_cdot_two_body_rotating_pulsating(me, eph, to_icrf, c, cdot, status_ok)

rotation matrix for ROTATING_PULSATING <-> ICRF

Arguments

Type IntentOptional Attributes Name
class(two_body_rotating_pulsating_frame), intent(inout) :: me
class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

logical, intent(in) :: to_icrf
real(kind=wp), intent(out), dimension(3,3) :: c
real(kind=wp), intent(out), optional, dimension(3,3) :: cdot
logical, intent(out) :: status_ok

private subroutine get_c_cdot_icrf(me, eph, to_icrf, c, cdot, status_ok)

rotation matrix for ICRF <-> ICRF

Arguments

Type IntentOptional Attributes Name
class(icrf_frame), intent(inout) :: me
class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

logical, intent(in) :: to_icrf
real(kind=wp), intent(out), dimension(3,3) :: c
real(kind=wp), intent(out), optional, dimension(3,3) :: cdot
logical, intent(out) :: status_ok

private subroutine get_c_cdot_ecliptic(me, eph, to_icrf, c, cdot, status_ok)

rotation matrix for ICRF <-> Mean Ecliptic

Arguments

Type IntentOptional Attributes Name
class(ecliptic_frame), intent(inout) :: me
class(ephemeris_class), intent(inout) :: eph
logical, intent(in) :: to_icrf
real(kind=wp), intent(out), dimension(3,3) :: c
real(kind=wp), intent(out), optional, dimension(3,3) :: cdot
logical, intent(out) :: status_ok

private subroutine get_c_cdot_iau_earth(me, eph, to_icrf, c, cdot, status_ok)

rotation matrix for IAU_EARTH <-> ICRF

Arguments

Type IntentOptional Attributes Name
class(iau_earth_rotating_frame), intent(inout) :: me
class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

logical, intent(in) :: to_icrf
real(kind=wp), intent(out), dimension(3,3) :: c
real(kind=wp), intent(out), optional, dimension(3,3) :: cdot
logical, intent(out) :: status_ok

private subroutine get_c_cdot_iau_moon(me, eph, to_icrf, c, cdot, status_ok)

rotation matrix for IAU_MOON <-> ICRF

Arguments

Type IntentOptional Attributes Name
class(iau_moon_rotating_frame), intent(inout) :: me
class(ephemeris_class), intent(inout) :: eph

for ephemeris computations (assumed to have already been initialized)

logical, intent(in) :: to_icrf
real(kind=wp), intent(out), dimension(3,3) :: c
real(kind=wp), intent(out), optional, dimension(3,3) :: cdot
logical, intent(out) :: status_ok

public subroutine transformation_module_test()

Transformation units test

Arguments

None