# Convert raw flux values to logarithmic values. import numpy import pyfits import os import math # Changes to the directory where the script is located abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) os.chdir(dname) infile = 'SphericalCubeRho2.fits' outfile = 'SphericalCubeRho3.fits' FitsFile = pyfits.open(infile) image= FitsFile[0].data header=FitsFile[0].header image = numpy.log(image) FitsFile = pyfits.writeto(outfile,image,header=header)