Our goal is to use reduced MUSE data cubes of bright Lya and OII emitters, and MgII absorbers, to understand the structure of the data cubes, how to read them, and how to carry out simple analysis of the data.
1) The data are stored in fits files: Read the files using astropy
2) The data consist of cubes of dimensions [nz,ny,nx], in which nx, and ny correspond to the cube's spatial dimensions and nz corresponds to the wavelength dimension.
3) The information about the data structure is stored in the header of the file. One for the data (cube[0]), and another for the intrumental variance (cube[1]). This is easy to read using, astropy. Check the model solution to see how to read the files:
A simple reader to handle the data could be:
# We define a helper class to handle the datacube
class muse_file():
def __init__(self, filename):
current_cube = fits.open(filename)
#flux in electron counts
self.flux = current_cube[0].data
#variance as reported by the intrument
self.var = current_cube[1].data
#header with useful information
self.header = current_cube[0].header
#dimensions of the cube
self.nz, self.ny, self.nx = self.flux.shape
#zero point for wavelength and space.
self.l0 = self.header["CRVAL3"]
self.x0 = self.header["CRVAL1"]
self.y0 = self.header["CRVAL3"]
#Spatial sampling in arcsec
self.dx = self.header['CD2_2'] * 60 * 60
self.dy = self.header['CD2_2'] * 60 * 60
#Wavelength sampling is done every 0.125 A
self.dl = self.header["CD3_3"]
self.l = self.l0 + np.arange(0,self.nz,1)*self.dl
self.x = self.x0 + np.arange(0,self.nx,1)*self.dx
self.y = self.y0 + np.arange(0,self.ny,1)*self.dy
1) Extract the spectrum of Ly-alpha emmiters and its associated error. This is particularly useful for those who have never worked with a spectrum before and would like to get to know how to do this.
Example solution: https://github.com/alejandrobll/Saas-Fee-School/blob/main/MUSE-hands-on/Lya.ipynb
2) Extract the spectrum of OII emitters and produce images of the source while ensuring an optimal S/N ratio. As 1), this is particularly useful for those who would like to understand how to handle real data and extract an optimal signal.
Example solution: https://github.com/alejandrobll/Saas-Fee-School/blob/main/MUSE-hands-on/OII.ipynb
3) Measure the absorption profile (or emmision) of selected MgII aborbers. Maximimizing the S/N ratio and carrying out the proper progagation of uncertaintites. This is perhaps the more advanced of the three excersices, and it will be more useful for those who finish 1 or 2.
Example solution: https://github.com/alejandrobll/Saas-Fee-School/blob/main/MUSE-hands-on/MgII.ipynb
In this exercise, you have access to MUSE datacubes of bright Ly-alpha emitters. These have already been reduced and centered around the relevant source. Your task is:
BONUS EXERCISE:
6) Estimate the redshift to the sources:
Note:
Consider $f=\displaystyle\sum_{i=0}^{N-1} x_{i}$, in which $x_{i}$ has an associated uncertainty $\sigma_{i}$.
The uncertainty of $f$ can be calculated via:
$\sigma_{f}^2 = \displaystyle\sum_{i=0}^{N-1} \left | \displaystyle\frac{\partial f}{\partial x_{i}}\right |^2 \sigma_{i}^2 = \displaystyle\sum_{i=0}^{N-1} \sigma_{i}^2 = \displaystyle\sum_{i=0}^{N-1} Var(x_{i})$,
where $Var(x_{i})$ is the variace of $x_{i}$.
The uncertainty of $f$ thus becomes:
$\sigma_{f} = \sqrt {\displaystyle\sum_{i=0}^{N-1} Var(x_{i})}$.
The muse datacubes have stored the intrinsic variance in the cell.
In this exercise, you have access to MUSE datacubes of bright OII emitters. These have already been reduced and centered around the relevant source. Your task is:
In this exercise, you have access to MUSE datacubes of 100 MgII absorbers. These have already been reduced and centered around the relevant source. Your task is: