8 releases

new 0.1.9 Jun 15, 2024
0.1.8 Feb 21, 2024
0.0.1 Feb 10, 2023

#83 in Images

Download history 50/week @ 2024-02-26 13/week @ 2024-03-11 45/week @ 2024-04-01 190/week @ 2024-06-10

190 downloads per month

MIT license

226 lines

Rusty FITSRotate

A commandline tool to rotate FITS cubes.


This was mostly a project to help me learn Rust, but it does have a useful purpose. I've taken inspiration from Miriad's reorder command.

When reading FITS data from disk the last (FITS-ordering) axis is the slowest to read. Typically, the frequency axis is placed last. This results in slow operations along the frequency axis. One can get a nice speed up in such operations, such as RM-synthesis, by rotating the FITS cube to place the frequency axis first.


You can install the release version using Cargo:

cargo install fitsrotate_rs

For the latest version, you can clone this repository and build it locally:

git clone https://github.com/AlecThomson/fitsrotate_rs.git
cd fitsrotate_rs.git
cargo install --path .


On the commandline:

 fitsrotate_rs -h
Rotate FITS images

Usage: fitsrotate_rs [OPTIONS] <FILENAME> <MODE>

  <FILENAME>  The FITS file
  <MODE>      Mode of rotation - a sequence of integers specifying the order of the axes (e.g. 321 for a 3D cube)

  -o, --overwrite  Overwrite the FITS file if it already exists
  -h, --help       Print help
  -V, --version    Print version

To use the crate in your own Rust development, add the following line to your Cargo.toml:

fitsrotate_rs = "0.1.1"


Contributions are very welcome! As stated above, this has been a learning project for me, so please forgive any major blunders.




~205K SLoC