added function that converts posteriors into rank maps
changed write functionality so it produces fits.gz files