MUSE Data Release II
Source Tutorial
In [1]:
%matplotlib inline
import matplotlib.pyplot as plt

Required material and software

  • The source file DR2_MXDF_001037.fits
  • The mpdaf python software

Generic Source format description

MPDAF source interface

Example 1

In this example we show how to review the content of a DR2 source using MPDAF

Loading the source

In [2]:
from mpdaf.sdetect.source import Source
src = Source.from_file('DR2_MXDF_001037.fits')

Info stored in source header

To display a summary of its content use the src.info() method

In [3]:
src.info()
[INFO] ID      =                 1037 / object ID %d                                   
[INFO] RA      =     53.1611895636303 / RA u.degree %.7f                               
[INFO] DEC     =    -27.7878516029122 / DEC u.degree %.7f                              
[INFO] FROM    = 'ORIGIN  '           / detection software                             
[INFO] FROM_V  = '0.3.dev143+g77bb12e.d20200608' / version of the detection software   
[INFO] CUBE    = 'DATACUBE_MXDF_ZAP_COR_V2.fits' / datacube                            
[INFO] CUBE_V  = '0.8     '           / version of the datacube                        
[INFO] SRC_V   =  / Source Version                                                     
[INFO] SIZE    =                  5.0                                                  
[INFO] CATALOG = 'DR2     '                                                            
[INFO] REFCAT  = 'None_CAT'                                                            
[INFO] EXPMEAN =     326.203248828125 / Mean value of EXPMAP                           
[INFO] EXPMIN  =    325.4805297851562 / Minimum value of EXPMAP                        
[INFO] EXPMAX  =    326.2738647460938 / Maximum value of EXPMAP                        
[INFO] FSFMODE =                    2 / Circular MOFFAT beta=poly(lbda) fwhm=poly(lbda)
[INFO] FSFLB1  =               4750.0 / FSF Blue Ref Wave (A)                          
[INFO] FSFLB2  =               9350.0 / FSF Red Ref Wave (A)                           
[INFO] FSF00FNC=                    6 / FSF00 FWHM Poly Ncoef                          
[INFO] FSF00F00=    0.601215458726201 / FSF00 FWHM Poly C00                            
[INFO] FSF00F01= -0.00700243065638504 / FSF00 FWHM Poly C01                            
[INFO] FSF00F02=   0.1024062794142009 / FSF00 FWHM Poly C02                            
[INFO] FSF00F03=  0.02766615182914884 / FSF00 FWHM Poly C03                            
[INFO] FSF00F04=  -0.2611952310298198 / FSF00 FWHM Poly C04                            
[INFO] FSF00F05=   0.4895101375683303 / FSF00 FWHM Poly C05                            
[INFO] FSF00BNC=                    6 / FSF00 BETA Poly Ncoef                          
[INFO] FSF00B00=   0.7737860306799237 / FSF00 BETA Poly C00                            
[INFO] FSF00B01=  -0.6485159978895241 / FSF00 BETA Poly C01                            
[INFO] FSF00B02=    0.499740225815882 / FSF00 BETA Poly C02                            
[INFO] FSF00B03=  0.03055676749736491 / FSF00 BETA Poly C03                            
[INFO] FSF00B04=  -0.4688548536876497 / FSF00 BETA Poly C04                            
[INFO] FSF00B05=    1.954910116377009 / FSF00 BETA Poly C05                            
[INFO] ORI_ID  =                  505                                                  
[INFO] ORI_RA  =     53.1611895636303                                                  
[INFO] ORI_DEC =    -27.7878516029122                                                  
[INFO] ORI_OFF =                  0.0                                                  
[INFO] RAF_ID  =                 4595                                                  
[INFO] RAF_RA  =          53.16117097                                                  
[INFO] RAF_DEC =         -27.78784455                                                  
[INFO] RAF_OFF =   0.0644316204339674                                                  
[INFO] HIERARCH C3DHST_ID = 26802                                                      
[INFO] HIERARCH C3DHST_RA = 53.161161                                                  
[INFO] HIERARCH C3DHST_DEC = -27.787844                                                
[INFO] HIERARCH C3DHST_OFF = 0.0949991119781613                                        
[INFO] HIERARCH CANDELS_ID = 105133                                                    
[INFO] HIERARCH CANDELS_RA = 53.16116714                                               
[INFO] HIERARCH CANDELS_DEC = -27.7878418                                              
[INFO] HIERARCH CANDELS_OFF = 0                                                        
[INFO] ZCONF   =                    3                                                  
[INFO] DEPTH   =     135.918020345052                                                  
[INFO] DATASET = 'MXDF    '                                                            
[INFO] REFSPEC = 'ORI_MXDF_505'                                                        
[INFO] REFZ    = 'forbidden'                                                           
[INFO] HIERARCH REFCENTER = 'ORIGIN  '                                                 
[INFO] FORMAT  = '0.6     '           / Version of the Source format                   
[INFO] HISTORY [None] inserted from input catalog (RBA 2020-03-09 16:53:01.658231)     
[INFO] HISTORY [None] inserted from input catalog (RBA 2020-03-09 19:49:58.697953)     
[INFO] HISTORY [None] inserted from input catalog (RBA 2020-03-09 20:14:56.342837)     
[INFO] HISTORY [None] updated from input catalog (RBA 2020-03-31 06:51:03.196579)      
[INFO] HISTORY [None] source created (RBA 2021-02-26T09:56:34.381866)                  
[INFO] 24 spectra: ORI_MXDF_505 PL_CONT PL_LINE PL_LINEFIT PL_FIT PL_ABSINIT PL_ABSLINE PL_ABSCONT PL_ABSFIT EMI_MXDF_1037 RAF_MXDF_4595 RAF_MOSAIC_4595 RAF_UDF10_4595 CAN_MXDF_105133 CAN_MOSAIC_105133 CAN_UDF10_105133 C3D_MXDF_26802 C3D_MOSAIC_26802 C3D_UDF10_26802 RAF_MXDF_4663 RAF_MXDF_4594 RAF_MXDF_4596 RAF_MXDF_4797 RAF_MXDF_4798
[INFO] 49 images: MUSE_WHITE MUSE_EXPMAP HST_F435W HST_F775W HST_F606W HST_F850LP HST_F160W NB_EMI_NEIII3869 NB_ABS_H10 NB_EMI_HBETA NB_ABS_H11 NB_ABS_CAG NB_ABS_HDELTA NB_ABS_HEPSILON NB_EMI_HGAMMA NB_EMI_OIII5000 NB_ABS_COMBINED NB_ABS_H9 NB_EMI_OII3727 NB_EMI_COMBINED NB_ABS_H8 SEGNB_EMI_OII3727 SEGNB_ABS_CAG SEGNB_ABS_COMBINED SEGNB_ABS_HDELTA SEGNB_EMI_HGAMMA SEGNB_ABS_H10 SEGNB_ABS_H9 SEGNB_ABS_HEPSILON SEGNB_EMI_HBETA SEGNB_EMI_NEIII3869 SEGNB_ABS_H11 SEGNB_EMI_OIII5000 SEGNB_EMI_COMBINED SEGNB_ABS_H8 NB_ABS_HBETA NB_EMI_H8 NB_EMI_HEPSILON NB_ABS_HGAMMA ORI_MAXMAP ORI_CORR_1365 ORI_CORR_1367 ORI_CORR_1361 ORI_CORR_1363 ORI_CORR_1368 ORI_CORR_1364 HST_SEGRAF HST_SEGCAN HST_SEG3D
[INFO] 1 cubes: MUSE_CUBE
[INFO] 11 tables: HST_CAT CANDELS_CAT HST3D_CAT DR1_CAT LSD_CAT DR2_CAT ORIG_CAT PL_LINES PL_Z NB_PAR ORI_LINES
[INFO] 1 redshifts

In the source header we find the MUSE catalog ID and DATASET, plus some matched catalogs ID

In [4]:
print("** Source Identifiers **")
print(f"Main MUSE ID: {src.ID} DATASET: {src.DATASET}")
print(f"ORIGIN ID: {src.ORI_ID}")
print(f"Matched Catalogs RAFELSKI ID: {src.RAF_ID}  3D-HST ID: {src.C3DHST_ID}  CANDELS ID: {src.CANDELS_ID}")
** Source Identifiers **
Main MUSE ID: 1037 DATASET: MXDF
ORIGIN ID: 505
Matched Catalogs RAFELSKI ID: 4595  3D-HST ID: 26802  CANDELS ID: 105133

The exposure map average over the source field is availble and the corresponding depth in hours. The depth in hours can also be computed by scaling the number of exposure, using the 25 min integration time of one exposure

In [5]:
print("** Source Exposure Map and Depth **")
print(f"Number of combined exposures, Mean:{src.EXPMEAN:.2f} Min:{src.EXPMIN:.2f} Max:{src.EXPMAX:.2f}")
print(f"Mean Depth in hours: {src.DEPTH:.2f}")
f = 25.0/60.0
print(f"Depth in hours, Mean:{f*src.EXPMEAN:.2f} Min:{f*src.EXPMIN:.2f} Max:{f*src.EXPMAX:.2f}")
** Source Exposure Map and Depth **
Number of combined exposures, Mean:326.20 Min:325.48 Max:326.27
Mean Depth in hours: 135.92
Depth in hours, Mean:135.92 Min:135.62 Max:135.95

Source location

The reference center for the source location is given. Locations of the matched source are also given with their offset in arcsec with respect to the source center.

In [6]:
print("** Source Location and offsets **")
print(f"Reference location: {src.REFCENTER}")
print(f"Source location RA: {src.RA:.5f} DEC: {src.DEC:.5f}")
print(f"OFFSETS (arcsec) ORIGIN {src.ORI_OFF:.2f} RAFELSKI {src.RAF_OFF:.2f} CANDELS {src.CANDELS_OFF:.2f} 3D-HST {src.C3DHST_OFF:.2f}")
** Source Location and offsets **
Reference location: ORIGIN
Source location RA: 53.16119 DEC: -27.78785
OFFSETS (arcsec) ORIGIN 0.00 RAFELSKI 0.06 CANDELS 0.00 3D-HST 0.09

Redshift

There can be more than one redshift measurement (e.g. forbidden lines or lyman-alpha). These redshift information are given in a specific table PL_Z. The reference redshift is given and can be used to get the source redshift. The table PL_Z contains additional information which are discussed later.

In [7]:
print("** Source Redshift **")
print(f"Redshift confidence: {src.ZCONF}")
tab = src.tables['PL_Z']
z = tab[tab['FAMILY']==src.REFZ]['Z'][0]
print(f"Reference redshift: {src.REFZ} Z:{z:.5f}")
** Source Redshift **
Redshift confidence: 3
Reference redshift: forbidden Z:0.66458

Spectra

As discussed in the paper, various signal extractions have been used, each one result in a spectrum. The reference one is the one used for redshift measurement and lines fitting information. The reference spectrum is in MPDAF format. See https://mpdaf.readthedocs.io/en/latest/api/mpdaf.obj.Spectrum.html#mpdaf.obj.Spectrum for the list of available methods. In the follwing we plot the reference spectra. We also display the platefit line fit in a zoomed region.

In [8]:
ref = src.spectra[src.REFSPEC]
fig,ax = plt.subplots(1,2,figsize=(17,5),sharey=True)
ax[0].set_title(f"Reference spectrum: {src.REFSPEC}")
ref.plot(ax=ax[0])
ref.plot(ax=ax[1], lmin=8000, lmax=8400, label='ref', noise=True)
src.spectra['PL_FIT'].plot(ax=ax[1], lmin=8000, lmax=8400, color='r', label='platefit')
ax[1].legend();

Images

The source contain a list of images. In the following we display the white light image, the OIII4959+OIII5007 narrow band and its segmentation image.

In [9]:
fig,ax = plt.subplots(1,3,figsize=(17,5))
src.images['MUSE_WHITE'].plot(ax=ax[0], scale='arcsinh', colorbar='v')
src.images['NB_EMI_OIII5000'].plot(ax=ax[1], scale='arcsinh', colorbar='v')
src.images['SEGNB_EMI_OIII5000'].plot(ax=ax[2], cmap='Paired')
Out[9]:
<matplotlib.image.AxesImage at 0x7f91ad17c160>

Matched Catalogs and Images

Right panel displat the location of Rafelski sources is shown here, overlaid on the HST F775W image. Left panel the DR2 catalog ovralaid on the WHITE light image. Note we use the MPDAF Catalog class (based on astropy table), which has additional methods, such as plot_symb.

In [10]:
from mpdaf.sdetect import Catalog
fig,ax = plt.subplots(1,2,figsize=(18,8))
ima = src.images['HST_F775W']
ima.plot(ax=ax[0], vmin=-0.005, vmax=0.05, scale='arcsinh', cmap='Greys')
tab = Catalog(src.tables['HST_CAT'])
tab.plot_symb(ax[0],  ima.wcs, ra='RA', dec='DEC', id='ID', label=True, ecol='b', esize=0.3, fontsize=12, tcol='r')
ax[0].set_title('image: HST_F775W catalog: HST_CAT');
ima = src.images['MUSE_WHITE']
ima.plot(ax=ax[1], scale='arcsinh', cmap='Greys')
tab = Catalog(src.tables['DR2_CAT'])
tab = tab[tab['DATASET']=='MXDF']
tab.plot_symb(ax[1],  ima.wcs, ra='RA', dec='DEC', id='ID', label=True, ecol='b', esize=0.3, fontsize=12, tcol='r')
ax[1].set_title('image: MUSE_WHITE catalog: DR2_CAT');
[ERROR] the 'adjustText' package is needed to avoid labels overlap
[ERROR] the 'adjustText' package is needed to avoid labels overlap

Emission and absorption lines

The platefit results are available in the PL_LINES table. Here we list all individual forbidden lines which (we exclude the blended line OII3727b)

In [11]:
tab = src.tables['PL_LINES']
tab[(tab['FAMILY']=='forbidden') & (~tab['ISBLEND'])]
Out[11]:
Table masked=True length=9
FAMILYLINELBDA_RESTDNAMEVELVEL_ERRZZ_ERRZ_INITVDISPVDISP_ERRVDINSTFLUXFLUX_ERRSNRSKEWSKEW_ERRLBDA_OBSPEAK_OBSLBDA_LEFTLBDA_RIGHTFWHM_OBSNSTDLBDA_LNSTDLBDA_RNSTDBLENDISBLENDEQWEQW_ERRCONT_OBSCONTCONT_ERRORI_MATCH_DLBDAORI_MATCH_TGLRORI_MATCH_STDORI_MATCH_PURITY
str20str20float64bytes10float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int64boolfloat64float64float64float64float64float64float64float64float64
forbiddenNeV34263426.85Neá´ 0.321.370.664587.58e-060.6645740.521.7755.550.0019.230.000.000.005702.670.005701.135704.213.088.525698.055707.290False-0.000.5620.7234.496.07-1.00-1.00-1.00-1.00
forbiddenOII37263727.09None0.321.370.664587.58e-060.6645740.521.7749.34458.4720.0522.870.000.006202.31138.486200.756203.863.11-2.436197.646211.613727False-14.630.8618.8331.345.571.066.66-1.000.99
forbiddenOII37293729.88[Oɪɪ]0.321.370.664587.58e-060.6645740.521.7749.29659.3117.4537.780.000.006206.95199.116205.396208.503.11-2.436197.646211.613727False-20.970.8718.8931.445.550.5513.9432.251.00
forbiddenNeIII38693870.16[Neɪɪɪ]0.321.370.664587.58e-060.6645740.521.7746.8960.2414.274.220.000.006440.3918.056438.826441.963.14-1.276435.696445.090False-1.510.3723.9839.925.04-1.00-1.00-1.00-1.00
forbiddenHeI38893889.73None0.321.370.664587.58e-060.6645740.521.7746.5870.3817.344.060.000.006472.9621.066471.396474.533.14-1.136468.256477.670False-1.710.4424.6641.044.92-1.00-1.00-1.00-1.00
forbiddenNeIII39673968.91None0.321.370.664587.58e-060.6645740.521.7745.3628.6018.821.520.000.006604.728.516603.156606.303.16-0.516599.996609.460False-0.670.4525.6142.634.88-1.00-1.00-1.00-1.00
forbiddenOIII43634364.44None0.321.370.664587.58e-060.6645740.521.7740.420.3114.300.020.000.007262.940.097261.307264.573.270.967258.047267.830False-0.010.3723.4639.055.47-1.00-1.00-1.00-1.00
forbiddenOIII49594960.30None0.321.370.664587.58e-060.6645740.521.7735.70236.8917.2813.710.000.008254.5263.568252.778256.273.50-1.688249.278259.770False-6.660.6021.3735.587.000.488.14-1.001.00
forbiddenOIII50075008.24[Oɪɪɪ]0.321.370.664587.58e-060.6645740.521.7735.43678.7218.5036.690.000.008334.30180.968332.548336.063.52-2.088329.018339.590False-19.120.9221.3335.508.600.7022.1945.021.00

Example 2

In this example we use the datacube itself to estimate the flux at the Rafelski ID 4663 location

In [12]:
cube = src.cubes['MUSE_CUBE']
cube.info()
[INFO] 3721 x 25 x 25 Cube (DR2_MXDF_001037.fits)
[INFO] .data(3721 x 25 x 25) (1e-20 erg / (Angstrom cm2 s)), .var(3721 x 25 x 25)
[INFO] center:(-27:47:16.3344,03:32:38.6911) size:(5.000",5.000") step:(0.200",0.200") rot:-0.0 deg frame:FK5
[INFO] wavelength: min:4700.00 max:9350.00 step:1.25 Angstrom
In [13]:
tab = src.tables['HST_CAT']
row = tab[tab['ID']==4663][0]
ra,dec = row['RA'],row['DEC']
print(f'Rafleski ID 4663 RA {ra} DEC {dec}')
Rafleski ID 4663 RA 53.16101303 DEC -27.78742872
In [14]:
# we use an aperture of 0.5 arcsec radius (1 arcsec diameter)
rad = 0.5
sp = cube.aperture((dec,ra), rad)
[INFO] 25 spaxels used
In [28]:
# let's filter the spectrum with a box of 7 pixel width
fsp = sp.filter(width=7)
WARNING: nan_treatment='interpolate', however, NaN values detected post convolution. A contiguous region of NaN values, larger than the kernel size, are present in the input array. Increase the kernel size to avoid this. [astropy.convolution.convolve]
In [17]:
# We display the resulting spectra
fig,ax = plt.subplots(1,2,figsize=(17,5))
sp.plot(ax=ax[0], noise=True, title='data and noise')
fsp.plot(ax=ax[1], title='filtered')
In [18]:
# A low S/N flux can be seen at 6200 A
fig,ax = plt.subplots(1,2,figsize=(17,5))
sp.plot(ax=ax[0], title='data', lmin=6000, lmax=6500)
sp.plot(ax=ax[1], snr=True, title='S/N', lmin=6000, lmax=6500)
In [24]:
# we compute the narrow band around 6200 A to check if this flux is related to RAF-ID 4663
nb = cube.get_image((6190,6220),subtract_off=True)
In [27]:
from mpdaf.sdetect import Catalog
fig,ax = plt.subplots(1,2,figsize=(18,8))
ima = src.images['HST_F775W']
ima.plot(ax=ax[0], vmin=-0.005, vmax=0.05, scale='arcsinh', cmap='Greys')
tab = Catalog(src.tables['HST_CAT'])
tab.plot_symb(ax[0],  ima.wcs, ra='RA', dec='DEC', id='ID', label=True, ecol='b', esize=0.3, fontsize=12, tcol='r')
ax[0].set_title('image: HST_F775W catalog: HST_CAT');
nb.plot(ax=ax[1], scale='arcsinh', cmap='Greys')
tab.plot_symb(ax[1],  nb.wcs, ra='RA', dec='DEC', id='ID', label=True, ecol='b', esize=0.3, fontsize=12, tcol='r')
ax[1].set_title('image: Narrow-band 6200A catalog: HST_CAT');
[ERROR] the 'adjustText' package is needed to avoid labels overlap
[ERROR] the 'adjustText' package is needed to avoid labels overlap

As shown in the figure, the narrow-band is centered on RAF-ID 4595, ie MUSE-ID 1037. The flux measured at RAF-ID 4663 is just the contamination of the central source.