Python code to extract all spectra from grids to fits files.