The SKIRT project
advanced radiative transfer for astrophysics
Functions
pts.simulation.fits Namespace Reference

Handling SKIRT FITS output files. More...

Functions

def _grid (npix, crpix, crval, cdelt, cunit)
 This helper function constructs a regular linear grid based on the information for an axis in the FITS header. More...
 
def getFitsAxes (path)
 This function retrieves the axis grid points from a FITS file produced by SKIRT, and returns the result as a tuple of astropy quantity arrays: (x, y) for data frames or (x, y, z) for data cubes. More...
 
def loadFits (path)
 This function loads the complete contents from a FITS file produced by SKIRT, and returns the resulting data frame or data cube as a two- or three-dimensional astropy quantity array. More...
 

Detailed Description

Handling SKIRT FITS output files.

This module offers functions for reading frames and data cubes from SKIRT FITS output files with support for units.

Function Documentation

◆ _grid()

def pts.simulation.fits._grid (   npix,
  crpix,
  crval,
  cdelt,
  cunit 
)
private

This helper function constructs a regular linear grid based on the information for an axis in the FITS header.

◆ getFitsAxes()

def pts.simulation.fits.getFitsAxes (   path)

This function retrieves the axis grid points from a FITS file produced by SKIRT, and returns the result as a tuple of astropy quantity arrays: (x, y) for data frames or (x, y, z) for data cubes.

The function assumes that x and y represent spatial axes with a regular, linear grid. For a data cube, the function expects the z-axis grid points (often wavelengths) to be listed in a binary table extension.

The file path is interpreted as described for the pts.utils.absPath() function.

◆ loadFits()

def pts.simulation.fits.loadFits (   path)

This function loads the complete contents from a FITS file produced by SKIRT, and returns the resulting data frame or data cube as a two- or three-dimensional astropy quantity array.

The indices of the array are in the order [x, y] for a data frame and [x, y, z] for a data cube, where x and y are usually spatial axes and z is often the wavelength axis. The appropriate units for the array values are obtained from the FITS file header written by SKIRT.

The file path is interpreted as described for the pts.utils.absPath() function.