Crate spv_rs

Source
Expand description

§Welcome to spv-rs!

crates Rust License Discord DOI

ko-fi

This crate is a set of functions for either extracting or manipulating astronomcial data. However it is (at least for now) mainly focused on position and velocity data.

§Examples

First if you want to see a calculator like application usecase please check the sourcecode for the SPV gui utility at SPV github repo.

Now we will look at the position function as an example: For the position::position function we use three input variables. Parallax for the distance to the object, you can read more about parallax here. Right ascension and Declination is basically a dots position on a sphere where the distance we get from the Parllax is the radius of the sphere.

One easy way to use this function if you had the required variables would be like this:

use spv_rs::position::position;
use glam::f64::DVec3;

fn main() {
    let parallax = 1.5_f64;
    let right_ascension = 35.8_f64;
    let declination = 67.3_f64;

    let body_name = "x";

    let position = position(parallax, right_ascension, declination).to_array();

    println!("The body {} was at the position x: {}, y: {}, z: {} at epoch J2000",
    body_name, position[0], position[1], position[2]);
}

The same general principles apply to most functions.

§Extra

Feel free to propose additions/changes, file issues and or help with the project over on GitHub!

Modules§

common
Set of common functions used by spv-rs exposed if you want to used them for your own calculations.
coordinate_transforms
Transform fucntions used by spv-rs but exposed her if you want to use them yourself.
input_data
Basic csv parsing for extracting real world data or any old data table you want to parse really. To get a csv if you got some other format from something like Vizier I would recomend a tool like Topcat.
nbss
Specific usecase functions for NBSS
output_data
Basic csv writing utility for saving large datasets to file.
position
Set of functions to calculate the position of either primary or companion bodies for diffrent usecases. All outputs are in the cartesian coordinate system.
velocity
Set of functions to calculate the velocity of either primary or companion bodies for diffrent usecases. All outputs are in the cartesian coordinate system.