{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Process multiple IFS images in parallel" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import time\n", "import sys\n", "codefolder = '../../../../crispy'\n", "if codefolder not in sys.path: sys.path.append(codefolder)\n", "from crispy.PISCESparams import Params\n", "codefolder = '../../../crispy'\n", "\n", "par = Params(codefolder)\n", "\n", "# activate this if you want to get rid of all console messages\n", "# but want to keep the file\n", "# from tools.initLogger import getLogger\n", "# t t\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Import files to reduce, doesn't matter how many" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import glob\n", "# call the reduction routine with an example image\n", "filelist= glob.glob(par.wavecalDir+'IFS???nm.fits')\n", "from crispy.tools.image import Image" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### No parallelization" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS605nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/Users/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:703: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Writing data to ../../code/SimResults/IFS605nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS615nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: AstropyDeprecationWarning: \"clobber\" was deprecated in version 1.3 and will be removed in a future version. Use argument \"overwrite\" instead. [astropy.utils.decorators]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Writing data to ../../code/SimResults/IFS615nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS625nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS625nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS635nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS635nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS645nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS645nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS655nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS655nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS665nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS665nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS675nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS675nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS685nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS685nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS695nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS695nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS705nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS705nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS715nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS715nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS725nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS725nm_red_optext.fits\n", "Elapsed time: 201.540511s\n" ] } ], "source": [ "# import parallel tools\n", "from IFS import reduceIFSMap\n", "start = time.time()\n", "for filename in filelist:\n", " reduceIFSMap(par,filename)\n", "print('Elapsed time: %fs' % (time.time()-start))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Parallelized version" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS615nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS625nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS605nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS655nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS665nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS635nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS645nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS675nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS645nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS615nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS605nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS675nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS635nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS685nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS705nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS695nm.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS715nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS655nm_red_optext.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS625nm_red_optext.fits\n", "crispy - INFO - Read data from HDU 0 of ../../code/ReferenceFiles/Calibra_170306/IFS725nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS615nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS645nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS605nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS675nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS635nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS655nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS625nm.fits processed\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS665nm_red_optext.fits\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS665nm.fits processed\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS695nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS705nm_red_optext.fits\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS695nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS705nm.fits processed\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS725nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS685nm_red_optext.fits\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS725nm.fits processed\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS685nm.fits processed\n", "crispy - INFO - Writing data to ../../code/SimResults/IFS715nm_red_optext.fits\n", "File ../../code/ReferenceFiles/Calibra_170306/IFS715nm.fits processed\n", "Elapsed time: 45.754292s\n" ] } ], "source": [ "import multiprocessing\n", "from tools.par_utils import Task, Consumer\n", "\n", "start = time.time()\n", "\n", "tasks = multiprocessing.Queue()\n", "results = multiprocessing.Queue()\n", "ncpus = multiprocessing.cpu_count()\n", "consumers = [ Consumer(tasks, results)\n", " for i in range(ncpus) ]\n", "for w in consumers:\n", " w.start()\n", "\n", "# you call the function here, with all its arguments in a list\n", "for i in range(len(filelist)):\n", " tasks.put(Task(i, reduceIFSMap, (par, filelist[i]))) \n", "\n", "for i in range(ncpus):\n", " tasks.put(None)\n", "\n", "# if the function returns something, that's where you process them\n", "for i in range(len(filelist)):\n", " index, result = results.get()\n", " # index tells us which task this was\n", " print(\"File %s processed\" % filelist[index]) \n", " # if the function you put in Task returned something, it is result\n", " \n", "print('Elapsed time: %fs' % (time.time()-start))" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Built-in parallelized reduction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We implemented a parallelized version of reduceIFSMap called reduceIFSMapList" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function reduceIFSMapList in module crispy.IFS:\n", "\n", "reduceIFSMapList(par, IFSimageNameList, method='optext', parallel=True)\n", " Main reduction function\n", " \n", " Uses various routines to extract an IFS detector map into a spectral-spatial cube.\n", " \n", " Parameters\n", " ----------\n", " par : Parameter instance\n", " Contains all IFS parameters\n", " IFSimageNameList : list\n", " List of strings containing the paths to the image files\n", " method : 'lstsq', 'optext'\n", " Method used for reduction.\n", " 'lstsq': use the knowledge of the PSFs at each location and each wavelength and fits\n", " the microspectrum as a weighted sum of these PSFs in the least-square sense. Can weigh the data by its variance.\n", " 'optext': use a matched filter to appropriately weigh each pixel and assign the fluxes, making use of the inverse\n", " wavlength calibration map. Then remap each microspectrum onto the desired wavelengths\n", "\n" ] } ], "source": [ "from crispy.IFS import reduceIFSMapList\n", "help(reduceIFSMapList)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS635nm.fits\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS635nm.fits\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS605nm.fits\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS605nm.fits\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS655nm.fits\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS655nm.fits\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS695nm.fits\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS695nm.fits\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS645nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS645nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS705nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS705nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS715nm.fits\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS715nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS675nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS675nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS625nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS625nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS665nm.fits\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS665nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS615nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS615nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS685nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS685nm.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS725nm.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Read data from HDU 0 of ../../../crispy/ReferenceFiles/Calibra_170306/IFS725nm.fits\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "crispy - INFO - Elapsed time: 49.567595s\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS695nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS605nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS645nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS625nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS655nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS635nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS705nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS715nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS675nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS665nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS615nm_red_optext.fits\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS685nm_red_optext.fits\n", "crispy - INFO - Reduced cube will have 17 wavelength bins\n", "crispy - INFO - Writing data to ../../../crispy/SimResults/IFS725nm_red_optext.fits\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:crispy:Elapsed time: 49.567595s\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS605nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS645nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS635nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS655nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS695nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS705nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS715nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS675nm_red_optext.fits\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "/local/data/nicolaus2/mrizzo/anaconda/lib/python2.7/site-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice\n", " warnings.warn(\"Mean of empty slice\", RuntimeWarning)\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS625nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS665nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS615nm_red_optext.fits\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS685nm_red_optext.fits\n", "INFO:crispy:Reduced cube will have 17 wavelength bins\n", "INFO:crispy:Writing data to ../../../crispy/SimResults/IFS725nm_red_optext.fits\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Elapsed time: 49.575726s\n" ] } ], "source": [ "import time\n", "start= time.time()\n", "reduceIFSMapList(par,filelist)\n", "print('Elapsed time: %fs' % (time.time()-start))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.13" } }, "nbformat": 4, "nbformat_minor": 2 }