starfield 0.12.2

Astronomical data reduction toolkit with star catalogs, coordinate systems, and star finding algorithms (inspired by skyfield)
Documentation
use nalgebra::Matrix3;
use once_cell::sync::Lazy;
use std::collections::HashMap;

/// Inertial reference frame rotation matrices
///
/// NOTE: This data is derived from skyfield, which in turn is derived from the SPICE library.
/// The SPICE library is derived from the JPL DE405 ephemeris and is in the public domain.
/// Machine generated - see build_spice.py in skyfield and this library if you wanna get gritty
/// https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/chgirf.html
pub static INERTIAL_FRAMES: Lazy<HashMap<&'static str, Matrix3<f64>>> = Lazy::new(|| {
    let mut frames = HashMap::new();

    frames.insert(
        "J2000",
        Matrix3::new(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0),
    );

    frames.insert(
        "B1950",
        Matrix3::new(
            0.999_925_707_952_362_9,
            0.011_178_938_126_427_69,
            0.004_859_003_841_454_429,
            -0.011178938137770135,
            0.9999375133499887,
            -2.715_792_625_851_078e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "FK4",
        Matrix3::new(
            0.999_925_679_495_687_7,
            0.011181483239171792,
            0.004_859_003_772_314_386,
            -0.01118148322046629,
            0.999_937_484_893_313_5,
            -2.717_029_374_400_203e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-118",
        Matrix3::new(
            0.999_925_679_140_615_8,
            0.011181514992482714,
            0.004_859_003_771_451_582,
            -0.011_181_514_973_402_33,
            0.999_937_484_538_241_6,
            -2.717_044_804_310_561_6e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-96",
        Matrix3::new(
            0.999_925_685_691_664,
            0.011180929131774816,
            0.004859003787369841,
            -0.011180929119611181,
            0.999_937_491_089_289_8,
            -2.716_760_116_574_720_7e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-102",
        Matrix3::new(
            0.999_925_700_586_770_7,
            0.011179596947047826,
            0.004859003823560055,
            -0.011179596950612145,
            0.999_937_505_984_396_5,
            -2.716_112_767_048_625e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-108",
        Matrix3::new(
            0.999_925_682_070_605_8,
            0.011181252967069354,
            0.004_859_003_778_571_208,
            -0.011181252951082478,
            0.999_937_487_468_231_6,
            -2.716_917_478_103_625_3e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-111",
        Matrix3::new(
            0.999_925_676_080_451_2,
            0.011181788652696216,
            0.004_859_003_764_015_464,
            -0.011181788630384961,
            0.999_937_481_478_077,
            -2.717_177_784_224_914_6e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-114",
        Matrix3::new(
            0.999_925_677_983_237_3,
            0.011181618493732738,
            0.004859003768639205,
            -0.011181618473430402,
            0.999_937_483_380_863_1,
            -2.717_095_098_751_177_7e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-122",
        Matrix3::new(
            0.999_925_679_137_905_4,
            0.011_181_515_234_874_4,
            0.004_859_003_771_444_996,
            -0.011181515215791154,
            0.999_937_484_535_531_2,
            -2.717_044_922_096_137e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-125",
        Matrix3::new(
            0.999_925_676_763_506_1,
            0.011181727569991416,
            0.004_859_003_765_675_285,
            -0.011181727548401311,
            0.999_937_482_161_131_8,
            -2.717_148_102_259_992_7e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "DE-130",
        Matrix3::new(
            0.999_925_679_511_950_4,
            0.011181481784821675,
            0.004_859_003_772_353_903,
            -0.011181481766133343,
            0.999_937_484_909_576_2,
            -2.717_028_667_686_751e-5,
            -0.004_859_003_815_359_271,
            -2.716_259_471_424_704_8e-5,
            0.9999881946023742,
        ),
    );

    frames.insert(
        "GALACTIC",
        Matrix3::new(
            -0.054_875_539_395_742_52,
            -0.873_437_104_727_596_1,
            -0.48383499177002515,
            0.494_109_453_627_743_9,
            -0.44482959429757496,
            0.746_982_248_699_891_8,
            -0.867_666_135_683_373_8,
            -0.19807638961301985,
            0.455_983_794_521_419_9,
        ),
    );

    frames.insert(
        "DE-200",
        Matrix3::new(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0),
    );

    frames.insert(
        "DE-202",
        Matrix3::new(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0),
    );

    frames.insert(
        "MARSIAU",
        Matrix3::new(
            0.673_257_747_460_025,
            0.739_407_874_914_146,
            -3.6947768825436786e-17,
            -0.589_630_837_826_253_3,
            0.536_880_310_821_634,
            0.603_402_856_254_738_3,
            0.44616082366044196,
            -0.40624564781301037,
            0.797_436_513_500_368_6,
        ),
    );

    frames.insert(
        "ECLIPJ2000",
        Matrix3::new(
            1.0,
            0.0,
            0.0,
            0.0,
            0.917_482_062_069_181_8,
            0.397_777_155_931_913_7,
            0.0,
            -0.397_777_155_931_913_7,
            0.917_482_062_069_181_8,
        ),
    );

    frames.insert(
        "ECLIPB1950",
        Matrix3::new(
            0.999_925_707_952_362_9,
            0.011_178_938_126_427_69,
            0.004_859_003_841_454_429,
            -0.012189277138214926,
            0.917_368_817_878_982_8,
            0.397_851_572_205_220_1,
            -9.940_500_920_352_022e-6,
            -0.3978812427417045,
            0.917_436_927_845_998_2,
        ),
    );

    frames.insert(
        "DE-140",
        Matrix3::new(
            0.999_925_676_538_466_8,
            0.011181770119802481,
            0.004_858_952_158_380_056,
            -0.011181770179728694,
            0.999_937_481_684_870_1,
            -2.715_451_958_574_730_6e-5,
            -0.004_858_952_020_473_538,
            -2.717_918_498_144_707e-5,
            0.999_988_194_853_596_6,
        ),
    );

    frames.insert(
        "DE-142",
        Matrix3::new(
            0.999_925_676_540_260_5,
            0.011181769732063588,
            0.004_858_952_681_545_991,
            -0.011181769790785997,
            0.999_937_481_689_212_5,
            -2.715_476_931_698_665_6e-5,
            -0.004_858_952_546_409_775,
            -2.717_893_922_878_699_2e-5,
            0.999_988_194_851_047_7,
        ),
    );

    frames.insert(
        "DE-143",
        Matrix3::new(
            0.999925676543585,
            0.011181774307743055,
            0.004_858_941_467_468_586,
            -0.011181774330053015,
            0.999_937_481_638_250_2,
            -2.716_221_152_505_747_5e-5,
            -0.004_858_941_416_127_174,
            -2.717_139_423_655_729_4e-5,
            0.999_988_194_905_334_9,
        ),
    );

    frames
});