"""
astrojax is a simple, minimal satellite orbit and attitude dynamics library implemented in JAX.
"""

from .attitude_dynamics import (
    AttitudeDynamicsConfig,
    SpacecraftInertia,
    create_attitude_dynamics,
    euler_equation,
    normalize_attitude_state,
    quaternion_derivative,
    torque_gravity_gradient,
)
from .attitude_representations import (
    EulerAngle,
    EulerAngleOrder,
    EulerAxis,
    Quaternion,
    RotationMatrix,
    Rx,
    Ry,
    Rz,
)
from .config import get_dtype, set_dtype
from .constants import (
    AS2RAD,
    AU,
    C_LIGHT,
    DEG2RAD,
    ECC_EARTH,
    GM_EARTH,
    GM_MOON,
    GM_SUN,
    J2_EARTH,
    JD_MJD_OFFSET,
    MJD2000,
    OMEGA_EARTH,
    P_SUN,
    R_EARTH,
    R_SUN,
    RAD2AS,
    RAD2DEG,
    WGS84_a,
    WGS84_f,
)
from .coordinates import (
    position_ecef_to_geocentric,
    position_ecef_to_geodetic,
    position_enz_to_azel,
    position_geocentric_to_ecef,
    position_geodetic_to_ecef,
    relative_position_ecef_to_enz,
    relative_position_enz_to_ecef,
    rotation_ellipsoid_to_enz,
    rotation_enz_to_ellipsoid,
    state_eci_to_koe,
    state_koe_to_eci,
)
from .epoch import Epoch
from .estimation import (
    FilterResult,
    FilterState,
    UKFConfig,
    ekf_predict,
    ekf_update,
    ukf_predict,
    ukf_update,
)
from .frames import (
    earth_rotation,
    rotation_ecef_to_eci,
    rotation_eci_to_ecef,
    state_ecef_to_eci,
    state_eci_to_ecef,
)
from .integrators import (
    AdaptiveConfig,
    StepResult,
    dp54_step,
    rk4_step,
    rkf45_step,
    rkn1210_step,
)
from .orbit_dynamics import (
    ForceModelConfig,
    GravityModel,
    SpacecraftParams,
    accel_drag,
    accel_gravity,
    accel_gravity_spherical_harmonics,
    accel_point_mass,
    accel_srp,
    accel_third_body_moon,
    accel_third_body_sun,
    create_orbit_dynamics,
    density_harris_priester,
    eclipse_conical,
    eclipse_cylindrical,
    moon_position,
    sun_position,
)
from .orbit_measurements import (
    gnss_measurement_noise,
    gnss_position_measurement,
    gnss_position_velocity_measurement,
    gnss_position_velocity_noise,
)
from .orbits import (
    anomaly_eccentric_to_mean,
    anomaly_eccentric_to_true,
    anomaly_mean_to_eccentric,
    anomaly_mean_to_true,
    anomaly_true_to_eccentric,
    anomaly_true_to_mean,
    apoapsis_distance,
    apogee_altitude,
    apogee_velocity,
    geo_sma,
    mean_motion,
    orbital_period,
    orbital_period_from_state,
    periapsis_distance,
    perigee_altitude,
    perigee_velocity,
    semimajor_axis,
    semimajor_axis_from_orbital_period,
    state_koe_mean_to_osc,
    state_koe_osc_to_mean,
    sun_synchronous_inclination,
)
from .relative_motion import (
    hcw_derivative,
    rotation_eci_to_rtn,
    rotation_rtn_to_eci,
    state_eci_to_roe,
    state_eci_to_rtn,
    state_oe_to_roe,
    state_roe_to_eci,
    state_roe_to_oe,
    state_rtn_to_eci,
)

__all__ = [
    # Constants
    "DEG2RAD",
    "RAD2DEG",
    "AS2RAD",
    "RAD2AS",
    "JD_MJD_OFFSET",
    "MJD2000",
    "C_LIGHT",
    "AU",
    "R_EARTH",
    "WGS84_a",
    "WGS84_f",
    "GM_EARTH",
    "ECC_EARTH",
    "J2_EARTH",
    "OMEGA_EARTH",
    "GM_SUN",
    "R_SUN",
    "P_SUN",
    "GM_MOON",
    # Attitude Representations
    "Rx",
    "Ry",
    "Rz",
    "Quaternion",
    "RotationMatrix",
    "EulerAngle",
    "EulerAngleOrder",
    "EulerAxis",
    # Config
    "set_dtype",
    "get_dtype",
    # Epoch
    "Epoch",
    # Frames
    "earth_rotation",
    "rotation_eci_to_ecef",
    "rotation_ecef_to_eci",
    "state_eci_to_ecef",
    "state_ecef_to_eci",
    # Relative Motion
    "rotation_rtn_to_eci",
    "rotation_eci_to_rtn",
    "state_eci_to_rtn",
    "state_rtn_to_eci",
    "state_oe_to_roe",
    "state_roe_to_oe",
    "state_eci_to_roe",
    "state_roe_to_eci",
    "hcw_derivative",
    # Coordinates
    "position_geocentric_to_ecef",
    "position_ecef_to_geocentric",
    "position_geodetic_to_ecef",
    "position_ecef_to_geodetic",
    "state_koe_to_eci",
    "state_eci_to_koe",
    "rotation_ellipsoid_to_enz",
    "rotation_enz_to_ellipsoid",
    "relative_position_ecef_to_enz",
    "relative_position_enz_to_ecef",
    "position_enz_to_azel",
    # Orbits
    "orbital_period",
    "orbital_period_from_state",
    "semimajor_axis_from_orbital_period",
    "semimajor_axis",
    "mean_motion",
    "perigee_velocity",
    "apogee_velocity",
    "periapsis_distance",
    "apoapsis_distance",
    "perigee_altitude",
    "apogee_altitude",
    "sun_synchronous_inclination",
    "geo_sma",
    "anomaly_eccentric_to_mean",
    "anomaly_mean_to_eccentric",
    "anomaly_true_to_eccentric",
    "anomaly_eccentric_to_true",
    "anomaly_true_to_mean",
    "anomaly_mean_to_true",
    "state_koe_osc_to_mean",
    "state_koe_mean_to_osc",
    # Attitude Dynamics
    "AttitudeDynamicsConfig",
    "SpacecraftInertia",
    "quaternion_derivative",
    "euler_equation",
    "torque_gravity_gradient",
    "create_attitude_dynamics",
    "normalize_attitude_state",
    # Orbit Dynamics
    "sun_position",
    "moon_position",
    "accel_point_mass",
    "accel_gravity",
    "GravityModel",
    "accel_gravity_spherical_harmonics",
    "accel_third_body_sun",
    "accel_third_body_moon",
    "density_harris_priester",
    "accel_drag",
    "accel_srp",
    "eclipse_conical",
    "eclipse_cylindrical",
    "ForceModelConfig",
    "SpacecraftParams",
    "create_orbit_dynamics",
    # Estimation
    "FilterState",
    "UKFConfig",
    "FilterResult",
    "ekf_predict",
    "ekf_update",
    "ukf_predict",
    "ukf_update",
    # Orbit Measurements
    "gnss_position_measurement",
    "gnss_measurement_noise",
    "gnss_position_velocity_measurement",
    "gnss_position_velocity_noise",
    # Integrators
    "StepResult",
    "AdaptiveConfig",
    "rk4_step",
    "rkf45_step",
    "dp54_step",
    "rkn1210_step",
]
