X-SAPR CMAC 2.0

Test for second trip rejection and using texture filter and gate ids to analysis.


In [1]:
import cartopy
import imp
import matplotlib
import matplotlib.patheffects as mpatheffects
import matplotlib.pyplot as plt
import netCDF4
import numpy as np
import operator
import os
import pandas as pd
import pyart
import tempfile
import yt

from boto.s3.connection import S3Connection
from datetime import datetime

import processing_code

%matplotlib inline
get_ipython().magic(
    'install_ext https://raw.github.com/cpcloud/ipython-\
autotime/master/autotime.py')
get_ipython().magic('load_ext autotime')


## You are using the Python ARM Radar Toolkit (Py-ART), an open source
## library for working with weather radar data. Py-ART is partly
## supported by the U.S. Department of Energy as part of the Atmospheric
## Radiation Measurement (ARM) Climate Research Facility, an Office of
## Science user facility.
##
## If you use this software to prepare a publication, please cite:
##
##     JJ Helmus and SM Collis, JORS 2016, doi: 10.5334/jors.119

/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
/home/zsherman/anaconda3/lib/python3.5/site-packages/sympy/core/function.py:107: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
  evalargspec = inspect.getargspec(cls.eval)
ERROR:root:Line magic function `%install_ext` not found.
Loading extensions from ~/.ipython/extensions is deprecated. We recommend managing extensions like any other Python packages, in site-packages.

In [2]:
# Helper function for the search.
def _nearestDate(dates, pivot):
    return min(dates, key=lambda x: abs(x - pivot))


def get_radar_from_aws(site, datetime_t):
    """
    Get the closest volume of NEXRAD data to a particular datetime.

    Parameters
    ----------
    site : string
        four letter radar designation.
    datetime_t : datetime
        desired date time.

    Returns
    -------
    radar : Py-ART Radar Object
        Radar closest to the queried datetime.

    """

    # First create the query string for the bucket knowing
    # how NOAA and AWS store the data
    my_pref = datetime_t.strftime('%Y/%m/%d/') + site

    # Connect to the bucket.
    conn = S3Connection(anon = True)
    bucket = conn.get_bucket('noaa-nexrad-level2')

    # Get a list of files.
    bucket_list = list(bucket.list(prefix = my_pref))

    # We are going to create a list of keys and datetimes to allow easy searching.
    keys = []
    datetimes = []

    # Populate the list.
    for i in range(len(bucket_list)):
        this_str = str(bucket_list[i].key)
        if 'gz' in this_str:
            endme = this_str[-22:-4]
            fmt = '%Y%m%d_%H%M%S_V0'
            dt = datetime.strptime(endme, fmt)
            datetimes.append(dt)
            keys.append(bucket_list[i])

        if this_str[-3::] == 'V06':
            endme = this_str[-19::]
            fmt = '%Y%m%d_%H%M%S_V06'
            dt = datetime.strptime(endme, fmt)
            datetimes.append(dt)
            keys.append(bucket_list[i])

    #find the closest available radar to your datetime

    closest_datetime = _nearestDate(datetimes, datetime_t)
    index = datetimes.index(closest_datetime)

    localfile = tempfile.NamedTemporaryFile()
    keys[index].get_contents_to_filename(localfile.name)
    radar = pyart.io.read(localfile.name)
    return radar


time: 65.1 ms

In [3]:
radar = pyart.io.read('/home/zsherman/xsapr_sgp/data/05_19_2017/XSW170519014005.RAW54Y8')
radar.altitude['data'][0] = 320.0


time: 527 ms

In [4]:
radar.altitude


Out[4]:
{'data': array([ 320.]),
 'long_name': 'Altitude',
 'positive': 'up',
 'standard_name': 'Altitude',
 'units': 'meters'}
time: 4.38 ms

In [5]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lol = np.arange(min_lon, max_lon, .2)

display = pyart.graph.RadarMapDisplay(radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('reflectivity', sweep=0, resolution='c',
                     vmin=-8, vmax=64, mask_outside=False,
                     cmap=pyart.graph.cm.NWSRef,
                     min_lat=min_lat, min_lon=min_lon,
                     max_lat=max_lat, max_lon=max_lon,
                     lat_lines=lal, lon_lines=lol)
# plt.savefig('')


time: 999 ms

In [6]:
time_at_start_of_radar = netCDF4.num2date(radar.time['data'][0], 
                                          radar.time['units'])
my_radar = get_radar_from_aws('KVNX', time_at_start_of_radar )


ERROR:boto:Caught exception reading instance data
Traceback (most recent call last):
  File "/home/zsherman/anaconda3/lib/python3.5/urllib/request.py", line 1254, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/home/zsherman/anaconda3/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/home/zsherman/anaconda3/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/home/zsherman/anaconda3/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/home/zsherman/anaconda3/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/home/zsherman/anaconda3/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/home/zsherman/anaconda3/lib/python3.5/http/client.py", line 849, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/home/zsherman/anaconda3/lib/python3.5/socket.py", line 712, in create_connection
    raise err
  File "/home/zsherman/anaconda3/lib/python3.5/socket.py", line 703, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/zsherman/anaconda3/lib/python3.5/site-packages/boto/utils.py", line 210, in retry_url
    r = opener.open(req, timeout=timeout)
  File "/home/zsherman/anaconda3/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/home/zsherman/anaconda3/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/home/zsherman/anaconda3/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/home/zsherman/anaconda3/lib/python3.5/urllib/request.py", line 1282, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/home/zsherman/anaconda3/lib/python3.5/urllib/request.py", line 1256, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error timed out>
ERROR:boto:Unable to read instance data, giving up
time: 7.25 s

In [7]:
my_radar.fields.keys()


Out[7]:
dict_keys(['cross_correlation_ratio', 'reflectivity', 'velocity', 'differential_reflectivity', 'spectrum_width', 'differential_phase'])
time: 2.65 ms

In [8]:
display = pyart.graph.RadarMapDisplay(my_radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('reflectivity', sweep=0, resolution='c',
                     vmin=-8, vmax=64, mask_outside=False,
                     cmap=pyart.graph.cm.NWSRef,
                     min_lat=min_lat, min_lon=min_lon,
                     max_lat=max_lat, max_lon=max_lon,
                     lat_lines=lal, lon_lines=lol)
# plt.savefig('')


time: 1.52 s

In [9]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lol = np.arange(min_lon, max_lon, .2)
nyq = radar.instrument_parameters['nyquist_velocity']['data'][0]
display = pyart.graph.RadarMapDisplay(radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('velocity', sweep=0, resolution='c',
                    vmin=-nyq, vmax=nyq, mask_outside=False,
                    cmap=pyart.graph.cm.NWSVel,
                    min_lat=min_lat, min_lon=min_lon,
                    max_lat=max_lat, max_lon=max_lon,
                    lat_lines=lal, lon_lines=lol)
# plt.savefig('')


time: 908 ms

In [10]:
print(radar.fixed_angle['data'])


[  0.49987793   1.49963379   2.49938965   3.49914551   4.49890137
   5.49865723   6.49841309   7.49816895   8.4979248    9.49768066
  10.49743652  11.50268555  12.50244141  14.0020752   15.00183105
  17.00134277  20.00061035  24.99938965  29.99816895  40.0012207
  49.9987793   54.99755859  60.00183105]
time: 2.56 ms

In [11]:
radar_start_date = netCDF4.num2date(
    radar.time['data'][0], radar.time['units'])
print(radar_start_date)
ymd_string = datetime.strftime(radar_start_date, '%Y%m%d')
hms_string = datetime.strftime(radar_start_date, '%H%M%S')
print(ymd_string, hms_string)


2017-05-19 01:40:14.681000
20170519 014014
time: 5.38 ms

In [12]:
sndfile = '/home/zsherman/xsapr_sgp/data/sonde_05_2017/sgpsondewnpnC1.b1.20170517.052500.cdf'
# soundings_dir = '/home/zsherman/xsapr_sgp/data/sonde_05_2017/'
# z_dict, temp_dict, snr = processing_code.snr_and_sounding(
    # radar, soundings_dir, override_file=sndfile)
sonde = netCDF4.Dataset(sndfile)
print(sonde.variables.keys())


odict_keys(['base_time', 'time_offset', 'time', 'qc_time', 'pres', 'qc_pres', 'tdry', 'qc_tdry', 'dp', 'qc_dp', 'wspd', 'qc_wspd', 'deg', 'qc_deg', 'rh', 'qc_rh', 'u_wind', 'qc_u_wind', 'v_wind', 'qc_v_wind', 'wstat', 'asc', 'qc_asc', 'lat', 'lon', 'alt'])
time: 3.08 ms

In [13]:
radar.instrument_parameters['nyquist_velocity']['data']


Out[13]:
array([ 10.69499969,  10.69499969,  10.69499969, ...,  10.69499969,
        10.69499969,  10.69499969], dtype=float32)
time: 1.99 ms

In [14]:
z_dict, temp_dict = pyart.retrieve.map_profile_to_gates(
    sonde.variables['tdry'][:], sonde.variables['alt'][:], radar)
texture = processing_code.get_texture(radar)


time: 2.17 s

In [15]:
snr = pyart.retrieve.calculate_snr_from_reflectivity(radar)


time: 262 ms

In [16]:
radar.add_field('sounding_temperature', temp_dict, replace_existing=True)
radar.add_field('height', z_dict, replace_existing=True)
radar.add_field('SNR', snr, replace_existing=True)
radar.add_field('velocity_texture', texture, replace_existing=True)
print(radar.fields.keys())


dict_keys(['velocity_texture', 'spectrum_width', 'reflectivity', 'velocity', 'differential_reflectivity', 'total_power', 'height', 'normalized_coherent_power', 'cross_correlation_ratio', 'SNR', 'specific_differential_phase', 'sounding_temperature', 'differential_phase'])
time: 3.49 ms

In [17]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lol = np.arange(min_lon, max_lon, .2)

display = pyart.graph.RadarMapDisplay(radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('sounding_temperature', sweep=0, resolution='c',
                     vmin=-0, vmax=40, mask_outside=False,
                     cmap=pyart.graph.cm.NWSRef,
                     min_lat=min_lat, min_lon=min_lon,
                     max_lat=max_lat, max_lon=max_lon,
                     lat_lines=lal, lon_lines=lol)
# plt.savefig('')


time: 921 ms

In [18]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lol = np.arange(min_lon, max_lon, .2)

display = pyart.graph.RadarMapDisplay(radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('SNR', sweep=0, resolution='c',
                     vmin=0, vmax=10, mask_outside=False,
                     cmap=pyart.graph.cm.NWSRef,
                     min_lat=min_lat, min_lon=min_lon,
                     max_lat=max_lat, max_lon=max_lon,
                     lat_lines=lal, lon_lines=lol)
# plt.savefig('')


time: 839 ms

In [19]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lol = np.arange(min_lon, max_lon, .2)

display = pyart.graph.RadarMapDisplay(radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('normalized_coherent_power', sweep=0,
                     resolution='c', vmin=0, vmax=1,
                     mask_outside=False, cmap=pyart.graph.cm.NWSRef,
                     min_lat=min_lat, min_lon=min_lon,
                     max_lat=max_lat, max_lon=max_lon,
                     lat_lines=lal, lon_lines=lol)
# plt.savefig('')


time: 983 ms

In [20]:
my_fuzz, cats = processing_code.do_my_fuzz(radar)
print(my_fuzz['notes'])
radar.add_field('gate_id', my_fuzz, 
                replace_existing=True)

print(radar.fields['gate_id']['notes'])
cat_dict = {}
for pair_str in radar.fields['gate_id']['notes'].split(','):
    print(pair_str)
    cat_dict.update(
        {pair_str.split(':')[1]:int(pair_str.split(':')[0])})

sorted_cats = sorted(cat_dict.items(), key=operator.itemgetter(1))


##
## CMAC calculation using fuzzy logic:
##    Doing melting
##    Doing snow
##    Doing no_scatter
##    Doing multi_trip
##    Doing rain
##    Doing hard constraining melting
##     (array([   0,    0,    0, ..., 9199, 9199, 9199]), array([ 0,  1,  2, ..., 26, 27, 28]))
##    Doing hard constraining multi_trip
##     (array([4400, 4400, 4400, ..., 9199, 9199, 9199]), array([480, 481, 482, ..., 498, 499, 500]))
##    Doing hard constraining melting
##     (array([1600, 1600, 1600, ..., 9199, 9199, 9199]), array([476, 477, 478, ..., 498, 499, 500]))
##    Doing hard constraining rain
##     (array([2000, 2000, 2000, ..., 9199, 9199, 9199]), array([426, 427, 428, ..., 321, 322, 323]))
##    Doing hard constraining melting
##     (array([   0,    0,    0, ..., 9199, 9199, 9199]), array([  0,   1,   2, ..., 498, 499, 500]))
1
0:no_scatter,1:snow,2:melting,3:multi_trip,4:rain
0:no_scatter,1:snow,2:melting,3:multi_trip,4:rain
0:no_scatter
1:snow
2:melting
3:multi_trip
4:rain
time: 6.9 s

In [21]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lat_lines = np.arange(min_lon, max_lon, .2)

sw = 0

display = pyart.graph.RadarMapDisplay(radar)

f = plt.figure(figsize=[15, 10])
plt.subplot(2, 2, 1) 
lab_colors=['green', 'cyan', 'blue', 'red', 'grey']
cmap = matplotlib.colors.ListedColormap(lab_colors)
display.plot_ppi_map('gate_id', sweep=sw, min_lon=min_lon,
                     max_lon=max_lon, min_lat=min_lat,
                     max_lat=max_lat, resolution='l', cmap=cmap,
                     vmin=0, vmax=5)
cbax=plt.gca()
#labels = [item.get_text() for item in cbax.get_xticklabels()]
#my_display.cbs[-1].ax.set_yticklabels(cats)
tick_locs = np.linspace(0, len(cats) - 1, len(cats)) + 0.5
display.cbs[-1].locator = matplotlib.ticker.FixedLocator(tick_locs)
catty_list = [sorted_cats[i][0] for i in range(len(sorted_cats))]
display.cbs[-1].formatter = matplotlib.ticker.FixedFormatter(catty_list)
display.cbs[-1].update_ticks()
plt.subplot(2, 2, 2) 
display.plot_ppi_map('reflectivity', sweep=sw, vmin=-8, vmax=64,
                     min_lon=min_lon, max_lon=max_lon, min_lat=min_lat, max_lat=max_lat,
                     resolution='l', cmap=pyart.graph.cm.NWSRef)

plt.subplot(2, 2, 3) 
display.plot_ppi_map('velocity_texture', sweep=sw, vmin=0, vmax=14, 
                     min_lon=min_lon, max_lon=max_lon, min_lat=min_lat, max_lat=max_lat,
                     resolution='l', cmap=pyart.graph.cm.NWSRef)
plt.subplot(2, 2, 4) 
display.plot_ppi_map('cross_correlation_ratio', sweep=sw, vmin=.5,
                     vmax=1, min_lon=min_lon, max_lon=max_lon,
                     min_lat=min_lat, max_lat=max_lat, resolution='l',
                     cmap=pyart.graph.cm.Carbone42)

# plt.savefig('')


time: 4.09 s

In [22]:
print(radar.fields['gate_id']['notes'])
cat_dict = {}
for pair_str in radar.fields['gate_id']['notes'].split(','):
    print(pair_str)
    cat_dict.update(
        {pair_str.split(':')[1]:int(pair_str.split(':')[0])})


0:no_scatter,1:snow,2:melting,3:multi_trip,4:rain
0:no_scatter
1:snow
2:melting
3:multi_trip
4:rain
time: 7.12 ms

In [23]:
print(cat_dict)


{'melting': 2, 'snow': 1, 'no_scatter': 0, 'multi_trip': 3, 'rain': 4}
time: 1.35 ms

In [24]:
happy_gates = pyart.correct.GateFilter(radar)
happy_gates.exclude_all()
happy_gates.include_equal('gate_id', cat_dict['rain'])
happy_gates.include_equal('gate_id', cat_dict['melting'])
happy_gates.include_equal('gate_id', cat_dict['snow'])


time: 14.3 ms

In [25]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lol = np.arange(min_lon, max_lon, .2)

display = pyart.graph.RadarMapDisplay(radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('reflectivity', sweep=1, resolution='c',
                     vmin=-8, vmax=64, mask_outside=False,
                     cmap=pyart.graph.cm.NWSRef,
                     min_lat=min_lat, min_lon=min_lon,
                     max_lat=max_lat, max_lon=max_lon,
                     lat_lines=lal, lon_lines=lol,
                     gatefilter=happy_gates)
# plt.savefig('')


time: 780 ms

In [26]:
max_lat = 37
min_lat = 36
min_lon = -98.3
max_lon = -97
lal = np.arange(min_lat, max_lat, .2)
lol = np.arange(min_lon, max_lon, .2)

display = pyart.graph.RadarMapDisplay(radar)
fig = plt.figure(figsize=[10, 8])
display.plot_ppi_map('reflectivity', sweep=3, resolution='c',
                     vmin=-8, vmax=64, mask_outside=False,
                     cmap=pyart.graph.cm.NWSRef,
                     min_lat=min_lat, min_lon=min_lon,
                     max_lat=max_lat, max_lon=max_lon,
                     lat_lines=lal, lon_lines=lol)
# plt.savefig('')


time: 929 ms

In [27]:
grids = pyart.map.grid_from_radars(
    (radar, ), grid_shape=(46, 251, 251),
    grid_limits=((0, 15000.0), (-50000, 50000), (-50000, 50000)),
    fields=list(radar.fields.keys()), gridding_algo="map_gates_to_grid",
    weighting_function='BARNES', gatefilters=(happy_gates, ),
    min_radius=200.0)


time: 17.4 s

In [28]:
display = pyart.graph.GridMapDisplay(grids)
fig = plt.figure(figsize=[15, 7])

# Panel sizes.
map_panel_axes = [0.05, 0.05, .4, .80]
x_cut_panel_axes = [0.55, 0.10, .4, .25]
y_cut_panel_axes = [0.55, 0.50, .4, .25]

# Parameters.
level = 3
vmin = -8
vmax = 64
lat = 36.5
lon = -97.7

# Panel 1, basemap, radar reflectivity and NARR overlay.
ax1 = fig.add_axes(map_panel_axes)
display.plot_basemap(lon_lines = np.arange(-104, -93, 2))
display.plot_grid('reflectivity', level=level, vmin=vmin, vmax=vmax,
                  cmap=pyart.graph.cm.NWSRef)
display.plot_crosshairs(lon=lon, lat=lat)

# Panel 2, longitude slice.
ax2 = fig.add_axes(x_cut_panel_axes)
display.plot_longitude_slice('reflectivity', lon=lon, lat=lat, vmin=vmin, vmax=vmax,
                             cmap=pyart.graph.cm.NWSRef)
ax2.set_ylim([0, 15])
ax2.set_xlim([-50, 50])
ax2.set_xlabel('Distance from SGP CF (km)')

# Panel 3, latitude slice.
ax3 = fig.add_axes(y_cut_panel_axes)
ax3.set_ylim([0, 15])
ax3.set_xlim([-50, 50])
display.plot_latitude_slice('reflectivity', lon=lon, lat=lat, vmin=vmin, vmax=vmax,
                            cmap=pyart.graph.cm.NWSRef)
# plt.savefig('')


time: 1.68 s

In [29]:
display = pyart.graph.GridMapDisplay(grids)
fig = plt.figure(figsize=[15, 7])

# Panel sizes.
map_panel_axes = [0.05, 0.05, .4, .80]
x_cut_panel_axes = [0.55, 0.10, .4, .25]
y_cut_panel_axes = [0.55, 0.50, .4, .25]

# Parameters.
level = 3
vmin = -8
vmax = 0
lat = 36.5
lon = -97.7

# Panel 1, basemap, radar reflectivity and NARR overlay.
ax1 = fig.add_axes(map_panel_axes)
display.plot_basemap(lon_lines = np.arange(-104, -93, 2))
display.plot_grid('differential_reflectivity', level=level, vmin=vmin, vmax=vmax,
                  cmap=pyart.graph.cm.NWSRef)
display.plot_crosshairs(lon=lon, lat=lat)

# Panel 2, longitude slice.
ax2 = fig.add_axes(x_cut_panel_axes)
display.plot_longitude_slice('differential_reflectivity', lon=lon, lat=lat, vmin=vmin,
                             vmax=vmax, cmap=pyart.graph.cm.NWSRef)
ax2.set_ylim([0, 15])
ax2.set_xlim([-50, 50])
ax2.set_xlabel('Distance from SGP CF (km)')

# Panel 3, latitude slice.
ax3 = fig.add_axes(y_cut_panel_axes)
ax3.set_ylim([0, 15])
ax3.set_xlim([-50, 50])
display.plot_latitude_slice('differential_reflectivity', lon=lon, lat=lat, vmin=vmin,
                            vmax=vmax, cmap=pyart.graph.cm.NWSRef)
# plt.savefig('')


time: 918 ms

In [30]:
display = pyart.graph.GridMapDisplay(grids)
fig = plt.figure(figsize=[15, 7])

# Panel sizes.
map_panel_axes = [0.05, 0.05, .4, .80]
x_cut_panel_axes = [0.55, 0.10, .4, .25]
y_cut_panel_axes = [0.55, 0.50, .4, .25]

# Parameters.
level = 3
vmin = -8
vmax = 0
lat = 36.5
lon = -97.7

# Panel 1, basemap, radar reflectivity and NARR overlay.
ax1 = fig.add_axes(map_panel_axes)
display.plot_basemap(lon_lines = np.arange(-104, -93, 2))
display.plot_grid('differential_reflectivity', level=level, vmin=vmin, vmax=vmax,
                  cmap=pyart.graph.cm.NWSRef)
display.plot_crosshairs(lon=lon, lat=lat)

# Panel 2, longitude slice.
ax2 = fig.add_axes(x_cut_panel_axes)
display.plot_longitude_slice('differential_reflectivity', lon=lon, lat=lat, vmin=vmin, vmax=vmax,
                             cmap=pyart.graph.cm.NWSRef)
ax2.set_ylim([0, 15])
ax2.set_xlim([-50, 50])
ax2.set_xlabel('Distance from SGP CF (km)')

# Panel 3, latitude slice.
ax3 = fig.add_axes(y_cut_panel_axes)
ax3.set_ylim([0, 15])
ax3.set_xlim([-50, 50])
display.plot_latitude_slice('differential_reflectivity', lon=lon, lat=lat, vmin=vmin, vmax=vmax,
                            cmap=pyart.graph.cm.NWSRef)


time: 1.02 s

In [31]:
arr = grids.fields['reflectivity']['data']
ff = arr.transpose()
data = dict(density = (ff, "((mm**6)/(m**3))"))
bbox = np.array([[-50000., 50000.], [-50000., 50000.],[0., 15000.0]])
ds = yt.load_uniform_grid(data, ff.shape, length_unit="m", bbox=bbox)

slc = yt.SlicePlot(ds, "z", ["density"])
slc.set_cmap("density", "Blues")
slc.annotate_grids(cmap=None)
slc.show()


yt : [INFO     ] 2017-07-21 14:53:49,830 Parameters: current_time              = 0.0
yt : [INFO     ] 2017-07-21 14:53:49,831 Parameters: domain_dimensions         = [251 251  46]
yt : [INFO     ] 2017-07-21 14:53:49,831 Parameters: domain_left_edge          = [-50000. -50000.      0.]
yt : [INFO     ] 2017-07-21 14:53:49,832 Parameters: domain_right_edge         = [ 50000.  50000.  15000.]
yt : [INFO     ] 2017-07-21 14:53:49,833 Parameters: cosmological_simulation   = 0.0
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/arraytypes.py:34: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
  blanks.append(np.zeros(elements, dtype=atype))
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/arraytypes.py:34: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
  blanks.append(np.zeros(elements, dtype=atype))
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/arraytypes.py:34: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
  blanks.append(np.zeros(elements, dtype=atype))
/home/zsherman/anaconda3/lib/python3.5/site-packages/numpy/core/records.py:158: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
  dtype = sb.dtype(formats, aligned)
/home/zsherman/anaconda3/lib/python3.5/site-packages/numpy/core/records.py:158: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
  dtype = sb.dtype(formats, aligned)
/home/zsherman/anaconda3/lib/python3.5/site-packages/numpy/core/records.py:158: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
  dtype = sb.dtype(formats, aligned)
yt : [INFO     ] 2017-07-21 14:53:50,015 xlim = -50000.000000 50000.000000
yt : [INFO     ] 2017-07-21 14:53:50,015 ylim = -50000.000000 50000.000000
yt : [INFO     ] 2017-07-21 14:53:50,017 xlim = -50000.000000 50000.000000
yt : [INFO     ] 2017-07-21 14:53:50,018 ylim = -50000.000000 50000.000000
yt : [INFO     ] 2017-07-21 14:53:50,019 Making a fixed resolution buffer of (('gas', 'density')) 800 by 800
yt : [WARNING  ] 2017-07-21 14:53:50,060 Plot image for field ('gas', 'density') has both positive and negative values. Min = -0.000000, Max = 0.000000.
yt : [WARNING  ] 2017-07-21 14:53:50,061 Switching to symlog colorbar scaling unless linear scaling is specified later
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/visualization/plot_container.py:112: DeprecationWarning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
  lmticks = np.hstack( (lmticks, np.linspace(cofA, cofB, cofB-cofA+1)*10**expA) )
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/visualization/plot_container.py:108: DeprecationWarning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
  lmticks = np.hstack( (lmticks, np.linspace(cofA, 9, 10-cofA)*10**expA) )
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/visualization/plot_container.py:112: DeprecationWarning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
  lmticks = np.hstack( (lmticks, np.linspace(cofA, cofB, cofB-cofA+1)*10**expA) )
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/visualization/plot_container.py:112: DeprecationWarning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
  lmticks = np.hstack( (lmticks, np.linspace(cofA, cofB, cofB-cofA+1)*10**expA) )
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/visualization/plot_container.py:108: DeprecationWarning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
  lmticks = np.hstack( (lmticks, np.linspace(cofA, 9, 10-cofA)*10**expA) )
/home/zsherman/anaconda3/lib/python3.5/site-packages/yt/visualization/plot_container.py:112: DeprecationWarning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
  lmticks = np.hstack( (lmticks, np.linspace(cofA, cofB, cofB-cofA+1)*10**expA) )

time: 1.08 s

In [32]:
sc = yt.create_scene(ds, lens_type='perspective')

source = sc[0]

source.set_field('density')
source.set_log(False)

# Modify the transfer function
sc.camera.focus = ds.domain_center
sc.camera.resolution = 1024

sc.camera.roll(np.pi)
# Move the camera position to the other side of the dataset.
sc.camera.position = ds.arr([1, 1, 1], 'unitary')

# First get the render source, in this case the entire domain, with field ('gas','density').
render_source = sc.get_source(0)

# Clear the transfer function.
render_source.transfer_function.clear()
# Map a range of density values (in log space) to the Reds_r colormap.
render_source.transfer_function.map_to_colormap(
    ds.quan(-10.0, 'g/cm**3'),
    ds.quan(64., 'g/cm**3'),
    scale=15.0, colormap=pyart.graph.cm.NWSRef)

# Draw the domain boundary.
sc.annotate_axes(alpha=.52)

sc.annotate_domain(ds, color=[1, 1, 1, 0.51])

# sc.save('')
sc.show()


yt : [INFO     ] 2017-07-21 14:53:50,897 Setting default field to ('gas', 'density')
yt : [INFO     ] 2017-07-21 14:53:50,918 Creating transfer function
yt : [INFO     ] 2017-07-21 14:53:50,919 Calculating data bounds. This may take a while.  Set the TranferFunctionHelper.bounds to avoid this.
yt : [INFO     ] 2017-07-21 14:53:50,995 Rendering scene (Can take a while).
yt : [INFO     ] 2017-07-21 14:53:51,009 Creating volume
time: 3.42 s