astronomy - Collapsing / Flattening a FITS data cube in python -
i've looked on place , not finding solution issue. feel should straightforward, we'll see.
i have .fits format data cube , need collapse 2d fits image. data cube has 2 spacial dimensions , 1 spectral/velocity dimension.
just looking simple python routine load in cube , flatten these layers (i.e. integrate them along spectral/velocity axis). help.
this tutorial on pyfits little old, still correct. key output of opening fits cube pyfits (or astropy.io.fits) have 3 dimensional numpy array.
import pyfits # if using astropy example # astropy.io import fits pyfits data_cube, header_data_cube = pyfits.getdata("data_cube.fits", 0, header=true) data_cube.shape # (z, x, y)
you have decided how flatten/integrate cube along z axis, , there plenty of resources out there decide right (hopefully based in analysis framework) that.
Comments
Post a Comment