4 releases (breaking)
0.4.0 | Dec 17, 2024 |
---|---|
0.3.0 | Nov 19, 2024 |
0.2.0 | Oct 17, 2024 |
0.1.0 | Sep 29, 2024 |
#807 in Network programming
133 downloads per month
83KB
1.5K
SLoC
Rust VDIF
A rust crate for interacting with data encoded in the VLBI Data Interchange Format (VDIF), commonly used in radio astronomy experiments. The VDIF data format is defined in the VDIF specification, found here.
This is a minimalist crate designed to relieve the problem of dealing with VDIF data in your own applications.
With rustvdif
you can:
- Read VDIF frames from and write to various sources, including files, TCP Streams and UDP Sockets.
- Access VDIF data encoded using the VDIF Transport Protocol (VTP)
- Easily access fields within a VDIF header.
- Access VDIF payload data in
u32
or byte form. - Encode and decode VDIF payloads, with up to 16 bits/sample.
Documentation is available here.
Usage
Reading VDIF frames is made easy by wrapping around types implementing the Rust Read trait.
For example, frames can be easily read from a file:
fn main() {
// A file of 8032 byte VDIF frames
let mut file = VDIFReader::open("path/to/my/vdif", 8032).unwrap();
// Read the first 100 frames and print header information on each one
for _ in 0..100 {
let frame = file.read_frame().unwrap();
println!("{}", frame.get_header());
}
}
Contributing
I'd love to see contributions from the VLBI community, and if you have any suggestions or questions you can always reach out to me directly or open an issue.
Known Issues
Since VDIF is an explicitly little-endian format, supporting big-endian systems takes a bit of extra effort. So big-endian systems aren't currently supported, but I could probably be persuaded to implement support if someone needs it.
Licensing
This library is licensed under either the MIT License or the Apache 2.0 License at your option.
Dependencies
~1MB
~18K SLoC