{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "As Herve Aussel failed to deliver all the legacy *Spitzer* MIPS maps, I have had to collect certian maps. For the Bootes field, these have come from Mattia Vaccari's [Datafusion folders](http://mattiavaccari.net/df/m24/). The files available are:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "bootes_24um_v2_mosaic.fits.gz bootes_24um_v2_mosaic_std.fits.gz\n", "bootes_24um_v2_mosaic_cov.fits.gz bootes_24um_v2_mosaic_unc.fits.gz\n" ] } ], "source": [ "ls" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from astropy.io import fits " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lets check format of one of the previous maps" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "elais_n1=fits.open('../../dmu26/data/ELAIS_N1/MIPS/wp4_elais-n1_mips24_map_v1.0.fits.gz')" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[, , , , ]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "elais_n1" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "SIMPLE = T / conforms to FITS standard \n", "BITPIX = 8 / array data type \n", "NAXIS = 0 / number of array dimensions \n", "EXTEND = T \n", "LONGSTRN= 'OGIP 1.0' \n", "PRODUCT = 'WP4_ELAIS-N1_OFFICIAL_MIPS_24' \n", "VERSION = 'V1.0 ' \n", "FIELD = 'ELAIS-N1' \n", "SFILTERS= 'MIPS_24 ' \n", "DESC = 'SWIRE ELAIS-1 Region 24um Spring ''05 image, uncertainty and &' \n", "CONTINUE 'coverage' \n", "RIGHTS = 'Public ' " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "elais_n1[0].header" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "XTENSION= 'IMAGE ' / Image extension \n", "BITPIX = -32 / array data type \n", "NAXIS = 2 / number of array dimensions \n", "NAXIS1 = 10690 \n", "NAXIS2 = 11647 \n", "PCOUNT = 0 / number of parameters \n", "GCOUNT = 1 / number of groups \n", "TELESCOP= 'Spitzer ' / Spitzer Space Telescope \n", "INSTRUME= 'MIPS ' / Spitzer Space Telescope instrument ID \n", "CHNLNUM = 1 / This image: 1=24um,2=70um,3=160um \n", "EXPTYPE = 'scn ' / Exposure Type \n", "FOVID = 113 / Field of View ID for Commanded Pointing \n", "FOVNAME = 'MIPS_70um_scan' / Field of View Name for Commanded Pointing \n", "OBSRVR = 'Carol Lonsdale' / Observer Name (Last, First) \n", "OBSRVRID= 88 / Observer ID of Principal Investigator \n", "PROCYCL = 2 / Proposal Cycle \n", "PROGID = 185 / Program ID \n", "DATE_OBS= '2004-07-29T18:11:23.947' / Date & time at DCE start \n", "CRVAL1 = 242.7499670682272 / [deg] RA at CRPIX1,CRPIX2 \n", "CRVAL2 = 54.99997388888889 / [deg] DEC at CRPIX1,CRPIX2 \n", "RADESYS = 'ICRS ' / International Celestial Reference System \n", "EQUINOX = 2000. / Equinox for ICRS celestial coord. system \n", "CTYPE1 = 'RA---TAN' / RA projection type \n", "CTYPE2 = 'DEC--TAN' / DEC projection type \n", "CRPIX1 = 5500.500059 / Reference pixel along axis 1 \n", "CRPIX2 = 5508.5 / Reference pixel along axis 2 \n", "CDELT1 = -0.000333333 / [deg/pix] Scale for axis 1 \n", "CDELT2 = 0.000333333 / [deg/pix] Scale for axis 2 \n", "CROTA2 = 315. / [deg] Orientation of axis 2 (W of N, +=CW) \n", "BUNIT = 'MJy/sr ' / Units of image data \n", "AORKEY = 11796992 / AOR or IER key. Astro. Obs Req/Instr Eng Req \n", "DPID = 19697561 / Data Product Instance ID \n", "COMMENT MOSAIC_INT Module Version 3.1 image created \n", "COMMENT Mon Apr 18 11:37:23 2005 \n", "COMMENT MOSAIC_REINT Module Version 2.1 image created \n", "COMMENT Mon Apr 25 01:07:37 2005 \n", "COMMENT MOSAIC_COADD Module Version 3.3 image created \n", "COMMENT Mon Apr 25 19:05:25 2005 \n", "COMMENT MOSAIC_COMBINE Module Version 1.7 image created \n", "COMMENT Mon Apr 25 19:15:24 2005 \n", "TOTALBCD= 64959 / Total number of BCD's used in this mosaic \n", "EXTNAME = 'MOSAIC ' \n", "DESC = 'Image, from swire_EN1_M1_v4_mosaic.fits' " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "elais_n1[1].header" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "XTENSION= 'IMAGE ' / Image extension \n", "BITPIX = -32 / array data type \n", "NAXIS = 2 / number of array dimensions \n", "NAXIS1 = 10690 \n", "NAXIS2 = 11647 \n", "PCOUNT = 0 / number of parameters \n", "GCOUNT = 1 / number of groups \n", "TELESCOP= 'Spitzer ' / Spitzer Space Telescope \n", "INSTRUME= 'MIPS ' / Spitzer Space Telescope instrument ID \n", "CHNLNUM = 1 / This image: 1=24um,2=70um,3=160um \n", "EXPTYPE = 'scn ' / Exposure Type \n", "FOVID = 113 / Field of View ID for Commanded Pointing \n", "FOVNAME = 'MIPS_70um_scan' / Field of View Name for Commanded Pointing \n", "OBSRVR = 'Carol Lonsdale' / Observer Name (Last, First) \n", "OBSRVRID= 88 / Observer ID of Principal Investigator \n", "PROCYCL = 2 / Proposal Cycle \n", "PROGID = 185 / Program ID \n", "DATE_OBS= '2004-07-29T18:11:23.947' / Date & time at DCE start \n", "CRVAL1 = 242.7499670682272 / [deg] RA at CRPIX1,CRPIX2 \n", "CRVAL2 = 54.99997388888889 / [deg] DEC at CRPIX1,CRPIX2 \n", "RADESYS = 'ICRS ' / International Celestial Reference System \n", "EQUINOX = 2000. / Equinox for ICRS celestial coord. system \n", "CTYPE1 = 'RA---TAN' / RA projection type \n", "CTYPE2 = 'DEC--TAN' / DEC projection type \n", "CRPIX1 = 5500.500059 / Reference pixel along axis 1 \n", "CRPIX2 = 5508.5 / Reference pixel along axis 2 \n", "CDELT1 = -0.000333333 / [deg/pix] Scale for axis 1 \n", "CDELT2 = 0.000333333 / [deg/pix] Scale for axis 2 \n", "CROTA2 = 315. / [deg] Orientation of axis 2 (W of N, +=CW) \n", "BUNIT = 'MJy/sr ' / Units of image data \n", "AORKEY = 11796992 / AOR or IER key. Astro. Obs Req/Instr Eng Req \n", "DPID = 19697561 / Data Product Instance ID \n", "COMMENT MOSAIC_INT Module Version 3.1 image created \n", "COMMENT Mon Apr 18 11:37:23 2005 \n", "COMMENT MOSAIC_REINT Module Version 2.1 image created \n", "COMMENT Mon Apr 25 01:07:37 2005 \n", "COMMENT MOSAIC_COADD Module Version 3.3 image created \n", "COMMENT Mon Apr 25 19:05:25 2005 \n", "COMMENT MOSAIC_COMBINE Module Version 1.7 image created \n", "COMMENT Mon Apr 25 19:15:24 2005 \n", "TOTALBCD= 64959 / Total number of BCD's used in this mosaic \n", "EXTNAME = 'UNCERTAINTY' \n", "DESC = 'Uncertainty, from swire_EN1_M1_v4_mosaic_unc.fits' " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "elais_n1[2].header" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "XTENSION= 'IMAGE ' / Image extension \n", "BITPIX = -32 / array data type \n", "NAXIS = 2 / number of array dimensions \n", "NAXIS1 = 10690 \n", "NAXIS2 = 11647 \n", "PCOUNT = 0 / number of parameters \n", "GCOUNT = 1 / number of groups \n", "TELESCOP= 'Spitzer ' / Spitzer Space Telescope \n", "INSTRUME= 'MIPS ' / Spitzer Space Telescope instrument ID \n", "CHNLNUM = 1 / This image: 1=24um,2=70um,3=160um \n", "EXPTYPE = 'scn ' / Exposure Type \n", "FOVID = 113 / Field of View ID for Commanded Pointing \n", "FOVNAME = 'MIPS_70um_scan' / Field of View Name for Commanded Pointing \n", "OBSRVR = 'Carol Lonsdale' / Observer Name (Last, First) \n", "OBSRVRID= 88 / Observer ID of Principal Investigator \n", "PROCYCL = 2 / Proposal Cycle \n", "PROGID = 185 / Program ID \n", "DATE_OBS= '2004-07-29T18:11:23.947' / Date & time at DCE start \n", "CRVAL1 = 242.7499670682272 / [deg] RA at CRPIX1,CRPIX2 \n", "CRVAL2 = 54.99997388888889 / [deg] DEC at CRPIX1,CRPIX2 \n", "RADESYS = 'ICRS ' / International Celestial Reference System \n", "EQUINOX = 2000. / Equinox for ICRS celestial coord. system \n", "CTYPE1 = 'RA---TAN' / RA projection type \n", "CTYPE2 = 'DEC--TAN' / DEC projection type \n", "CRPIX1 = 5500.500059 / Reference pixel along axis 1 \n", "CRPIX2 = 5508.5 / Reference pixel along axis 2 \n", "CDELT1 = -0.000333333 / [deg/pix] Scale for axis 1 \n", "CDELT2 = 0.000333333 / [deg/pix] Scale for axis 2 \n", "CROTA2 = 315. / [deg] Orientation of axis 2 (W of N, +=CW) \n", "BUNIT = ' ' / Number of images \n", "AORKEY = 11796992 / AOR or IER key. Astro. Obs Req/Instr Eng Req \n", "DPID = 19697561 / Data Product Instance ID \n", "COMMENT MOSAIC_INT Module Version 3.1 image created \n", "COMMENT Mon Apr 18 11:37:23 2005 \n", "COMMENT MOSAIC_REINT Module Version 2.1 image created \n", "COMMENT Mon Apr 25 01:07:37 2005 \n", "COMMENT MOSAIC_COADD Module Version 3.3 Coverage image created \n", "COMMENT Mon Apr 25 19:05:25 2005 \n", "COMMENT MOSAIC_COMBINE Module Version 1.7 image created \n", "COMMENT Mon Apr 25 19:26:21 2005 \n", "TOTALBCD= 64959 / Total number of BCD's used in this mosaic \n", "EXTNAME = 'COVERAGE' \n", "DESC = 'Coverage, from swire_EN1_M1_v4_mosaic_unc.fits' " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "elais_n1[3].header" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Ok, so there is a primary header, an image map, an uncertianty map and a coverage map. Lets create the FITS file for Bootes." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": true }, "outputs": [], "source": [ "hdr = fits.Header()\n", "hdr['PRODUCT'] = 'WP4_Bootes_OFFICIAL_MIPS_24' \n", "hdr['VERSION'] = 'V1.0 ' \n", "hdr['FIELD'] = 'Bootes' \n", "hdr['SFILTERS']= 'MIPS_24 ' \n", "hdr['DESC'] = 'image, uncertainty and & coverage' \n", "hdr['RIGHTS'] = 'Public ' " ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "primary_hdu = fits.PrimaryHDU(header=hdr)\n", "hd1=fits.open('./data/bootes_24um_v2_mosaic.fits.gz')\n", "hd2=fits.open('./data/bootes_24um_v2_mosaic_unc.fits.gz')\n", "hd3=fits.open('./data/bootes_24um_v2_mosaic_cov.fits.gz')" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "hdul=fits.HDUList([primary_hdu,fits.ImageHDU(hd1[0].data,\n", " header=hd1[0].header),fits.ImageHDU(hd2[0].data, header=hd2[0].header),\n", " fits.ImageHDU(hd3[0].data, header=hd3[0].header)])" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "hdul.writeto('wp4_bootes_mips24_map_v1.0.fits.gz')" ] } ], "metadata": { "kernelspec": { "display_name": "Python (herschelhelp_internal)", "language": "python", "name": "helpint" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.6" } }, "nbformat": 4, "nbformat_minor": 2 }