F: Cubos de imágenes

En el anterior notebook, el estudio de espectros de SDSS se basaba como hemos visto en un solo espectro por galaxia. Actualmente se realiza lo que conocemos como espectrografía IFU (Integral Field Unit). Gracias a esta técnica podemos obtener un espectro de una galaxia entera, es decir, ya no solo de su centro, sino también de su estructura.

Para ello los datos IFU que obtenemos son cubos de imágenes, donde en dos ejes tenemos la posición de la galaxia y en un tercer eje tenemos el espectro de cada punto de la galaxia.

_images/the-spectral-data-cube.png

Fuente de la imagen

_images/data_cube.jpg

Fuente de la imagen

Datos de MaNGA (Mapping Nearby Galaxies at APO)

MaNGA es el proyecto SDSS más reciente que tiene como objetivo mapear la composición detallada y la estructura cinemática de 10,000 galaxias cercanas. MaNGA utiliza IFUs para poder analizar las propiedades de las galaxias

Las IFUs de MaNGA son un grupo de fibras llamadas bundles, en el que cada fibra individual produce un espectro. Debido a que las fibras son circulares, MaNGA o cualquier instrumento que utilice este tipo de fibras, necesita realizar lo que se conoce como dithering, esto es tomar diferentes datos realizando pequeños movimientos entre la obtención de cubos de imagenes para poder llenar los huecos que hay entre las fibras.

A partir de los datos que obtenemos para cada fibra, resueltos espacialmente através de la posición del objeto (RA / Dec), podemos generar una imagen en la parte del espectro que queramos.

Galaxia 024837.58-003315.4

Abrimos el cubo como si de una imagen se tratase

[1]:
from astropy.io import fits
from astropy.wcs import WCS
import glob
import matplotlib.pyplot as plt
import numpy as np

fileList = sorted(glob.glob('imagenes/cubo/*'))
print ('Number of cubes in dir:', len(fileList))
fileList[0]
hdul = fits.open(fileList[0])

data = hdul[1].data
header = hdul[1].header
wcs_cube = WCS(header)

y_center, x_center = int(header['CRPIX1']), int(header['CRPIX2'])
Number of cubes in dir: 1
WARNING: FITSFixedWarning: PLATEID = 8078 / Current plate
a string value was expected. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 57309.000000 from DATE-OBS'. [astropy.wcs.wcs]
[2]:
header
[2]:
XTENSION= 'IMAGE   '           / IMAGE extension
BITPIX  =                  -32 / Number of bits per data pixel
NAXIS   =                    3 / Number of data axes
NAXIS1  =                   74 /
NAXIS2  =                   74 /
NAXIS3  =                 4563 /
PCOUNT  =                    0 / No Group Parameters
GCOUNT  =                    1 / One Data Group
AUTHOR  = 'Brian Cherinka & David Law <bcherin1@jhu.edu, dlaw@stsci.edu>' /
VERSDRP2= 'v2_4_3  '           / MaNGA DRP version (2d processing)
VERSDRP3= 'v2_4_3  '           / MaNGA DRP Version (3d processing)
VERSPLDS= 'v2_52   '           / Platedesign Version
VERSFLAT= 'v1_31   '           / Specflat Version
VERSCORE= 'v1_6_2  '           / MaNGAcore Version
VERSPRIM= 'v2_5    '           / MaNGA Preimaging Version
VERSUTIL= 'v5_5_32 '           / Version of idlutils
VERSIDL = 'x86_64 linux unix linux 7.1.1 Aug 21 2009 64 64 ' / Version of IDL
BSCALE  =              1.00000 / Intensity unit scaling
BZERO   =              0.00000 / Intensity zeropoint
BUNIT   = '1E-17 erg/s/cm^2/Ang/spaxel' / Specific intensity (per spaxel)
MASKNAME= 'MANGA_DRP3PIXMASK'  / Bits in sdssMaskbits.par used by mask extension
TELESCOP= 'SDSS 2.5-M'         / Sloan Digital Sky Survey
INSTRUME= 'MaNGA   '           / SDSS-IV MaNGA IFU
SRVYMODE= 'MaNGA dither'       / Survey leading this observation and its mode
PLATETYP= 'APOGEE-2&MaNGA'     / Type of plate (e.g. MaNGA, APOGEE-2&MANGA)
OBJSYS  = 'ICRS    '           / The TCC objSys
EQUINOX =              2000.00 /
RADESYS = 'FK5     '           /
LAMPLIST= 'lamphgcdne.dat'     /
TPLDATA = 'BOSZ_3000-11000A.fits' /
NEXP    =                    9 / Total number of exposures
EXPTIME =              8100.81 / Total exposure time (seconds)
BLUESN2 =              19.6000 / Total SN2 in blue channel
REDSN2  =              39.4569 / Total SN2 in red channel
AIRMSMIN=              1.19701 / Minimum airmass
AIRMSMED=              1.21160 / Median airmass
AIRMSMAX=              1.28464 / Maximum airmass
SEEMIN  =              1.46489 / Best guider seeing
SEEMED  =              1.53414 / Median guider seeing
SEEMAX  =              1.66010 / Worst guider seeing
TRANSMIN=             0.907613 / Worst guider transparency
TRANSMED=             0.916000 / Median guider transparency
TRANSMAX=             0.926174 / Best guider transparency
MJDMIN  =                57309 / MJD of first exposure
MJDMED  =                57309 / MJD of median exposure
MJDMAX  =                57309 / MJD of last exposure
DATE-OBS= '2015-10-14'         / Date of median exposure
MJDRED  =                58197 / MJD of the reduction
DATERED = '2018-03-20'         / Date of the reduction
MNGTARG1=                 2336 / manga_target1 maskbit
MNGTARG2=                    0 / manga_target2 maskbit
MNGTARG3=                    0 / manga_target3 maskbit
IFURA   =        42.1567760000 / IFU R.A. (J2000 deg.)
IFUDEC  =      -0.554292590000 / IFU Dec. (J2000 deg.)
OBJRA   =        42.1567757009 / Object R.A. (J2000 deg.)
OBJDEC  =      -0.554292603774 / Object Dec. (J2000 deg.)
CENRA   =        41.3331000000 / Plate center R.A. (J2000 deg.)
CENDEC  =        0.00000000000 / Plate center Dec. (J2000 deg.)
PLATEID =                 8078 / Current plate
DESIGNID=                 8638 / Current design
IFUDSGN =                12704 / ifuDesign
FRLPLUG =                   34 / Plugged ferrule
PLATEIFU= '8078-12704'         / PLATEID-ifuDesign
CARTID  = '3       '           / Cart(s) used
HARNAME = 'ma076   '           / Harness name(s)
METFILE = 'ma076-56887-1.par'  / IFU metrology file(s)
MANGAID = '1-109073'           / MaNGA ID number
CATIDNUM= '1       '           / Primary target input catalog
PLTTARG = 'plateTargets-1.par' / plateTarget reference file
DRP3QUAL=                   64 / DRP-3d quality bitmask
IFUGLON =        174.445513341 / IFU Galactic longitude (deg)
IFUGLAT =       -51.3087918114 / IFU Galactic latitude (deg)
EBVGAL  =            0.0418251 / Galactic reddening E(B-V)
GFWHM   =              2.53556 / Reconstructed FWHM in g-band (arcsec)
RFWHM   =              2.49654 / Reconstructed FWHM in r-band (arcsec)
IFWHM   =              2.47039 / Reconstructed FWHM in i-band (arcsec)
ZFWHM   =              2.43737 / Reconstructed FWHM in z-band (arcsec)
CTYPE3  = 'WAVE-LOG'           /
CRPIX3  =                    1 / Starting pixel (1-indexed)
CRVAL3  =        3621.59598486 / Central wavelength of first pixel
CD3_3   =       0.833903304339 / Initial dispersion per pixel
CUNIT3  = 'Angstrom'           /
CRPIX1  =              38.0000 /Reference pixel (1-indexed)
CRPIX2  =              38.0000 /Reference pixel (1-indexed)
CRVAL1  =        42.1567760000 /
CRVAL2  =      -0.554292590000 /
CD1_1   =         -0.000138889 /
CD2_2   =          0.000138889 /
CTYPE1  = 'RA---TAN'           /
CTYPE2  = 'DEC--TAN'           /
CUNIT1  = 'deg     '           /
CUNIT2  = 'deg     '           /
HDUCLASS= 'SDSS    '           /SDSS format class
HDUCLAS1= 'CUBE    '           /
HDUCLAS2= 'DATA    '           /
ERRDATA = 'IVAR    '           / Error extension name
QUALDATA= 'MASK    '           / Mask extension name
EXTNAME = 'FLUX    '           /
DATASUM = '1524664746'         / data unit checksum updated 2018-03-20T23:20:32
CHECKSUM= 'EXOMFXLLEXLLEXLL'   / HDU checksum updated 2018-03-20T23:20:32
[3]:
plt.figure(figsize=(8, 8))
plt.plot(hdul[1].data[:, y_center ,x_center])
plt.xlabel(r'Pixeles en el eje \lambda')
plt.ylabel(f"Flujo [{header['BUNIT']}]")
[3]:
Text(0, 0.5, 'Flujo [1E-17 erg/s/cm^2/Ang/spaxel]')
_images/F-6-cubos_11_1.png

Para convertir nuestro eje x en longitud de onda deberemos tener en cuenta los valores de CRVAL3, CRPIX3 y CRDEL3, es decir los del tercer eje que se corresponde a la longitud de onda.

[4]:
plt.figure(figsize=(8, 8))
plt.imshow(hdul[1].data[2500, :, :], origin='lower')
plt.xlabel('Pixeles')
plt.ylabel("Pixeles")
plt.show()
_images/F-6-cubos_13_0.png