Material prepared for the 52nd Saas-Fee Advanced Course on "The circum-galactic medium across cosmic time: an observational and modelling challenge"¶

by Alejandro Benitez-Llambay & Michele Fumagalli¶

Contact for questions or comments: alejandro.benitezllambay@unimib.it

HANDS-ON GUIDE¶

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.

Download the datacubes¶

Link to the data: https://drive.google.com/drive/folders/1g4tl7AHjei8ivktS1m9S-9v7csXoY-lq?usp=sharing

image.png

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:

In [2]:
# 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

Problems:¶

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

=========================================================================================================¶

1) Ly-alpha line profiles from MUSE cubes¶

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:

  1. Read the files and familiarize yourself with the data.
  2. Extract the spectrum of the source and its associated uncertainty. You can do this for the entire spatial range or focus on select regions.
  3. Find the line profile and transform the spectrum's wavelength into relative velocity with respect to the peak of the Ly-alpha line.
  4. Fit a single gaussian profile to the line, considering the intrinsic uncertainties.
  5. Fir multiple (n >= 2) gaussian profiles to the line.

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.

=========================================================================================================¶

2) OII Surface Brightness images from MUSE datacubes¶

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:

  1. Read the files and familiarize yourself with the data.
  2. Extract the spectrum of the source and its associated uncertainty. You can do this for the entire spatial range or focus on select regions.
  3. Find the line profile and transform the spectrum's wavelength into relative velocity with respect to the peak of the OII line.
  4. Stack the cube in velocity to produce an OII surface brightness image with its associated uncertainty.
  5. Find the velocity window that maximizes the signal-to-noise ratio

=========================================================================================================¶

3) MgII Surface Brightness profile from MUSE datacubes¶

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:

  1. Stack all the datacubes to boost the S/N ratio.
  2. Find the optimal wavelength window that maximizes the spatial S/N.
  3. Calculate the MgII surface brightness profile.