Usual Tips & Tricks¶
We loosely group here a few code lines that are relevant and useful throughout the analysis.
Initializaion of the notebooks¶
We detail here the header we start almost all our notebooks with.
Imports¶
In [ ]:
#useful to make plots editable in the notebook; should not be used in a regular script
%matplotlib notebook
#To avoid typing the main path each time
from sitelle.constants import FITS_DIR
#We prefer our implementation of the SpectralCube
from sitelle.process import SpectralCubePatch as SpectralCube
Loading¶
The datacubes are not calibrated by default. Calibration should be performed by the suer and respecified each time we launch a new instance of the cube.
In [ ]:
SN2_ORCS = SpectralCube(FITS_DIR/'orig/M31_SN2.merged.cm1.1.0.hdf5')
#Astrometric calibration level 1 and 2:
SN2_ORCS.set_wcs(FITS_DIR/'M31_SN2.1.0.ORCS/M31_SN2.1.0.wcs.deep_frame.fits')
#Astrometric calibration level 3:
SN2_ORCS.set_dxdymaps(FITS_DIR/'M31_SN2.1.0.ORCS/M31_SN2.1.0.wcs.dxmap.fits',
FITS_DIR/'M31_SN2.1.0.ORCS/M31_SN2.1.0.wcs.dymap.fits')
#Wavelength calibration
SN2_ORCS.correct_wavelength(FITS_DIR/'M31_SN2.1.0.ORCS/M31_SN2.1.0.skymap.fits')