Extract the deep frame and use the WCS

In this example you can see how the deep frame of the cube can be extracted from the HDF5 archive and how the WCS can be used.

The deep frame is simply the mean of the interferometric images along the scan axis. The same operation on the spectral cube would give a similar result but the noise would be much more important as each spectral frame has a photon noise (N_{spectral}) which is the combined noise of all the interferometric frames (N_{\text{spectral, frame}} = N_{\text{interf, frame}} \times \sqrt{M}, M being the number of frames). So that the deep frame made from the spectral cube would have a combined noise equivalent to only one frame of the interferometric cube (N_{\text{spectral, deep}} = N_{\text{spectral, frame}} / \sqrt{M} = N_{\text{interf, frame}}, M being the number of frames).

%matplotlib inline
from orcs.process import SpectralCube
import pylab as pl
import orb.utils.io
import numpy as np
cube = SpectralCube('/home/thomas/M57_SN3.merged.cm1.1.0.hdf5')
INFO| Data shape : (2048, 2064, 593)
INFO| Cube is in WAVENUMBER (cm-1)
INFO| Cube is CALIBRATED in wavenumber

Displaying the deep frame

deep_frame = cube.get_deep_frame()
fig = pl.figure()
ax = fig.add_subplot(111, projection=cube.get_wcs())
pl.imshow(deep_frame.T, origin='bottom-left',
          vmin=np.nanpercentile(deep_frame, 0.1),
          vmax=np.nanpercentile(deep_frame, 99.9),

Exporting the deep frame with the WCS

orb.utils.io.write_fits('deep_frame.fits', deep_frame, fits_header=cube.get_wcs_header(), overwrite=True)
INFO| Data written as deep_frame.fits in 1.26 s
[ ]: